pFq - Generalized Hypergeometric Functions
Version 0.09 alpha
Copyright 2023 Brian M. Sutin, Skewray Research, LLC
GNU General Public License version 3.0 (GPLv3)
pFq is a subroutine library for computing Generalized Hypergeometric Functions of any order.
Both double and complex version of the primary argument are provided for all functions where a complex argument makes sense.
The original impetus for this library was to serve as a unit test for computing stable distributions.
Consequently, this package is likely to never contain its own unit tests for stable distributions.
Currently, pFq only uses the method of series summation.
Convergence to double precision is guaranteed, except for cases where the number of terms becomes egregious.
(Convergence does not guarantee accuracy. See status and unit tests.)
This library is mainly of use for larger values of p and q. 1F1 and 2F1 have been thoroughly studied and other library packages exist.
Language is C17.
Status:
* The following are generalizations from eyeballing the current unit tests:
* q+1-p=0: accuracy |z|<0.999 is bit error < 5 (a decimal place is 3.32 bits)
* q+1-p=1: accuracy is very roughly bits error ~ z
* q+1-p=2: accuracy is very roughly bits error ~ sqrt(z)
* q+1-p>2: no known test cases, but convergence is extremely fast
* Accuracy is high enough to require long double for math.h routines
* Accuracy failures in the GSL library (used for unit testing) are evident
Derived functions:
* Confluent hypergeometric functions (1F1)
* Caveat: PSI(a,c,z)/U(a,c,z) fails at integer values of c
* Derived from above, so have the same issue:
* Whittaker functions
* Incomplete gamma function
* Bessel K
* Hypergeometric functions (2F1)
* Lommel functions
* Bessel functions
* (See caveat for Bessel K above)
* Fresnel integrals
* Stable distributions
* beta=0, alpha={1/3,1/2,2/3}
* beta=0, alpha=3/2 (Holtsmark distribution)
* beta=0, alpha=4/3 (formula from [Garoni] may be wrong?)
* beta=1/3, alpha=3/2 (not yet tested)
* beta=1, alpha={1/3,2/3,3/2}
* Math Library functions (for testing)
* exp(), cexp()
* log(), clog()
* pow(), cpow()
* j0(), j1(), jn()
* erf(), erfc()
* sin(), csin(), cos(), ccos(), tan(), ctan()
* asin(), casin(), atan(), catan(), atanh(), catanh()
Short-term to-do list & issues:
* Add more derived functions (Meijer G-functions!)
* More clean up of unit-test harness (in work)
* Tail estimation (in work)
* Write user documentation
Long-term to-do list:
* Complex parameters (A and B)
* Other computational methods besides series summation (may be none for general case)
* Computational speed
* Float and long double versions
* Analytic continuation & continuity
* Branch cuts
* Vectorize on x/z
References:
* [Bateman] - Higher Transcendental Functions, Bateman Manuscript Project (1953)
* [A&S] - Abramowitz & Stegun, Handbook of Mathematical Functions (1972)
* [Zolotarev] - One-dimensional Stable Distributions (1986)
* [Garoni] - https://doi.org/10.1063/1.1467095 (2002)
* [CVZ] - Cohen, Villegas & Zagier, Experimental Mathematics 9:1 (2000)
* [G&R] - Table of Integrals, Series, and Products (1980)
* [Slater] - Generalized Hypergeometric Functions (1966)
* [Wolfram] - https://mathworld.wolfram.com/GeneralizedHypergeometricFunction.html
* [NIST] - https://dlmf.nist.gov/
* [B&G] - Baker & Graves-Morris, Padé Approximants (1981)