ColSpecF (Collected Special Functions) is a Fortran library for evaluating mathematical Special Functions, built around adaptations of algorithms collected from several sources.
The following list describes the implemented functions and their domains.
- Exponential integrals
$\mathrm{Ei}(x)$ and$\mathrm{E}_1(x)$ $\lbrace x \in \mathbb{R} \mid x \neq 0 \rbrace$
- Exponential integral
$\mathrm{E}_1(z)$ $\lbrace z \in \mathbb{C} \mid x \neq 0 \rbrace$
- Bessel functions of the first kind
$J_0(x)$ and$J_1(x)$ $x \in \mathbb{R}$
- Bessel functions of the second kind
$Y_0(x)$ and$Y_1(x)$ $\lbrace x \in \mathbb{R} \mid x \gt 0 \rbrace$
- Gauss hypergeometric function
${}_2F_1(a, b; c; z)$ $a,\thinspace b,\thinspace c,\thinspace z \in \mathbb{C}$
- Struve functions
$\mathbf{H}_0(x)$ and$\mathbf{H}_1(x)$ $x \in \mathbb{R}$
The list above will be updated as new functions are added and tested. Next in line are:
- Polygamma functions
$\psi_0(x)$ and$\psi_1(x)$ - Hankel functions of the first kind
$H_n(x)$ - Modified Bessel functions of the second kind
$K_0(x)$ and$K_1(x)$
Tests are conducted by comparing the ColSpecF results with those of mpmath, an arbitrary-precision numerical library.
Testing routines are built using test-drive, a standard Fortran unit testing framework.
Test results can be found here.
The API documentation for this library is generated using FORD and is deployed and hosted on ReadTheDocs.
Fortran code for evaluating special functions is sourced from the following websites:
- Association for Computing Machinery. 2012. Collected Algorithms
- Jason Blevins. 2004. Alan Miller's Fortran Software
- Commonwealth Scientific and Industrial Research Organisation. 2004. Software from Alan J. Miller
- Elsevier. 2025. Elsevier Data Repository
- John Burkardt. 2025. Fortran77 Source Codes
- John Burkardt. 2025. Fortran90 Codes
Publications presenting the original algorithms are listed below:
- Kathleen A. Paciorek. 1970. Algorithm 385: Exponential integral Ei(x). Commun. ACM 13, 7 (July 1970), 446–447. https://doi.org/10.1145/362686.362696
- Donald E. Amos. 1990. Algorithms 683: a portable FORTRAN subroutine for exponential integrals of a complex argument. ACM Trans. Math. Softw. 16, 2 (June 1990), 178–182. https://doi.org/10.1145/78928.78934
- W. J. Cody. 1993. Algorithm 715: SPECFUN–a portable FORTRAN package of special function routines and test drivers. ACM Trans. Math. Softw. 19, 1 (March 1993), 22–30. https://doi.org/10.1145/151271.151273
- N. Michel and M. V. Stoitsov. 2008. Fast computation of the Gauss hypergeometric function with all its parameters complex with application to the Pöschl-Teller-Ginocchio potential wave functions. Computer Physics Communications 178, 7 (April 2008), 535–551. https://doi.org/10.1016/J.CPC.2007.11.007
- Allan J. MacLeod. 1996. Algorithm 757: MISCFUN, a software package to compute uncommon special functions. ACM Trans. Math. Softw. 22, 3 (Sept. 1996), 288–301. https://doi.org/10.1145/232826.232846
ColSpecF is a Fortran library distributed under multiple licenses or permissions based on code origin. Users must comply with the applicable license or permission for each portion of the code. See the License for full details.