SPECFUN
Special Function Evaluation


SPECFUN, a FORTRAN90 library which evaluates special functions, including Bessel I, J, K and Y functions, Dawson Integral, Error (Erf), Exponential Integral (E1 and EI), Gamma, log Gamma, and Psi/Digamma, by William Cody and Laura Stoltz.

The library can evaluate the I, J, K and Y Bessel functions, of orders 0, 1, or arbitrary positive integer order N, or for any positive non-integer order (an unusual feature).

Routines are also available for the Gamma function, the logarithm of the Gamma function, the exponential integrals, the error function, the Psi function, and Dawson's integral.

The original, true, correct (FORTRAN77) version of SPECFUN is available through NETLIB: http://www.netlib.org/specfun/index.html".

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

SPECFUN is available in a FORTRAN90 version.

Related Data and Programs:

CORDIC, a FORTRAN90 library which use the CORDIC method to compute certain elementary functions.

FN, a FORTRAN90 library which evaluates elementary and special functions, by Wayne Fullerton.

G95_INTRINSICS, FORTRAN90 programs which demonstrate the use of intrinsic functions peculiar to the G95 FORTRAN compiler, which include Bessel J and Y functions, ERF and GAMMA.

GSL, a C++ library which evaluates many special functions.

MACHAR, a FORTRAN90 library which is used to compute machine arithmetic parameters.

POLPAK, a FORTRAN90 library which evaluates certain mathematical functions, especially some recursive polynomial families.

SLATEC, a FORTRAN90 library which evaluates many special functions.

SPECIAL_FUNCTIONS, a FORTRAN90 library which computes the Beta, Error, Gamma, Lambda, Psi functions, the Airy, Bessel I, J, K and Y, Hankel, Jacobian elliptic, Kelvin, Mathieu, Struve functions, spheroidal angular functions, parabolic cylinder functions, hypergeometric functions, the Bernoulli and Euler numbers, the Hermite, Laguerre and Legendre polynomials, the cosine, elliptic, exponential, Fresnel and sine integrals, by Shanjie Zhang, Jianming Jin;

TEST_VALUES, a FORTRAN90 library which contains a few test values of many functions.

TOMS644, a FORTRAN77 library which evaluates the Bessel I, J, K, Y functions, the Airy functions Ai and Bi, and the Hankel function, for complex argument and real order.

TOMS715, a FORTRAN90 library which evaluates special functions, including the Bessel I, J, K, and Y functions of order 0, of order 1, and of any real order, Dawson's integral, the error function, exponential integrals, the gamma function, the normal distribution function, the psi function. This is a version of ACM TOMS algorithm 715.

Author:

The original FORTRAN77 version is by William Cody and Laura Stoltz.

Reference:

  1. Donald Amos,
    Computation of Modified Bessel Functions and Their Ratios,
    Mathematics of Computation,
    Volume 28, Number 24, January 1974.
  2. John Campbell,
    On Temme's Algorithm for the Modified Bessel Functions of the Third Kind,
    ACM Transactions on Mathematical Software,
    Volume 6, Number 4, December 1980, pages 581-586.
  3. John Campbell,
    Bessel functions J_nu(x) and Y_nu(x) of real order and real argument,
    Computational Physics Communications,
    Volume 18, 1979, pages 133-142.
  4. William Cody,
    An Overview of Software Development for Special Functions, in Numerical Analysis Dundee, 1975,
    edited by GA Watson,
    Lecture Notes in Mathematics, 506,
    Springer, 1976,
    LC: QA3.L28.v506.
  5. William Cody,
    Rational Chebyshev Approximations for the Error Function,
    Mathematics of Computation,
    Volume 23, Number 107, July 1969, pages 631-638.
  6. William Cody,
    Algorithm 597: Sequence of Modified Bessel Functions of the First Kind,
    ACM Transactions of Mathematical Software,
    Volume 9, Number 2, June 1983, pages 242-245.
  7. William Cody,
    Algorithm 665: MACHAR, a subroutine to dynamically determine machine parameters,
    ACM Transactions on Mathematical Software,
    Volume 14, Number 4, December 1988, pages 303-311.
  8. William Cody,
    Algorithm 715: SPECFUN - A Portable FORTRAN Package of Special Function Routines and Test Drivers,
    ACM Transactions on Mathematical Software,
    Volume 19, Number 1, March 1993, pages 22-32.
  9. William Cody,
    Performance evaluation of programs for the error and complementary error functions,
    ACM Transactions on Mathematical Software,
    Volume 16, Number 1, March 1990, pages 29-37.
  10. William Cody,
    Performance evaluation of programs related to the real gamma function,
    ACM Transactions on Mathematical Software,
    Volume 17, Number 1, March 1991, pages 46-54.
  11. William Cody, Kenneth Hillstrom,
    Chebyshev Approximations for the Natural Logarithm of the Gamma Function, Mathematics of Computation,
    Volume 21, Number 98, April 1967, pages 198-203.
  12. William Cody, Kathleen Paciorek, Henry Thacher,
    Chebyshev Approximations for Dawson's Integral,
    Mathematics of Computation,
    Volume 24, Number 109, January 1970, pages 171-178.
  13. William Cody, Laura Stoltz,
    Performance evaluation of programs for certain Bessel functions,
    ACM Transactions on Mathematical Software,
    Volume 15, Number 1, March 1989, pages 41-48.
  14. William Cody, Laura Stoltz,
    The Use of Taylor series to test accuracy of function programs,
    ACM Transactions on Mathematical Software,
    Volume 17, Number 1, March 1991, pages 55-63.
  15. William Cody, Anthony Strecok, Henry Thacher,
    Chebyshev Approximations for the Psi Function,
    Mathematics of Computation,
    Volume 27, Number 121, January 1973, pages 123-127.
  16. William Cody, Henry Thacher,
    Rational Chebyshev Approximations for the Exponential Integral E1(x),
    Mathematics of Computation,
    Volume 22, Number 103, July 1968, pages 641-649.
  17. William Cody, Henry Thacher,
    Chebyshev Approximations for the Exponential Integral Ei(x),
    Mathematics of Computation,
    Volume 23, Number 106, April 1969, pages 289-303.
  18. William Cody, William Waite,
    Software Manual for the Elementary Functions,
    Prentice Hall, 1980,
    ISBN: 0138220646,
    LC: QA331.C635.
  19. Walter Gautschi,
    Algorithm 282: Derivatives of EXP(X)/X, COS(X)/X, and SIN(X)/X,
    Communications of the ACM,
    Volume 9, April 1966, page 272.
  20. John Hart, Ward Cheney, Charles Lawson, Hans Maehly, Charles Mesztenyi, John Rice, Henry Thatcher, Christoph Witzgall,
    Computer Approximations,
    Wiley, 1968,
    LC: QA297.C64.
  21. Michael Malcolm,
    Algorithms to Reveal Properties of Floating Point Arithmetic,
    Communications of the ACM,
    Volume 15, Number 11, November 1972, pages 949-951.
  22. Frank Olver, David Sookne,
    A Note on Backward Recurrence Algorithms,
    Mathematics of Computation,
    Volume 26, 1972, pages 941-947.
  23. Malcolm Pike, David Hill,
    Algorithm 266: Pseudo-Random Numbers,
    Communications of the ACM,
    Volume 8, Number 10, October 1965, page 605.
  24. David Sookne,
    Bessel Functions of Real Argument and Integer Order,
    NBS Journal of Research B,
    Volume 77B, 1973, pages 125-132.
  25. Nico Temme,
    On the numerical evaluation of the ordinary Bessel function of the second kind,
    Journal of Computational Physics,
    Volume 21, 1976, pages 343-350.

Source Code:

Examples and Tests:

SPECFUN_TEST1 makes some sophisticated accuracy checks.

SPECFUN_TEST2 compares computed results to tables of values extracted from the program library TEST_VALUES.

List of Routines:

You can go up one level to the FORTRAN90 source codes.


Last revised on 13 April 2013.