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:
-
Donald Amos,
Computation of Modified Bessel Functions and Their Ratios,
Mathematics of Computation,
Volume 28, Number 24, January 1974.
-
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.
-
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.
-
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.
-
William Cody,
Rational Chebyshev Approximations for the Error Function,
Mathematics of Computation,
Volume 23, Number 107, July 1969, pages 631-638.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
William Cody, Kathleen Paciorek, Henry Thacher,
Chebyshev Approximations for Dawson's Integral,
Mathematics of Computation,
Volume 24, Number 109, January 1970, pages 171-178.
-
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.
-
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.
-
William Cody, Anthony Strecok, Henry Thacher,
Chebyshev Approximations for the Psi Function,
Mathematics of Computation,
Volume 27, Number 121, January 1973, pages 123-127.
-
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.
-
William Cody, Henry Thacher,
Chebyshev Approximations for the Exponential
Integral Ei(x),
Mathematics of Computation,
Volume 23, Number 106, April 1969, pages 289-303.
-
William Cody, William Waite,
Software Manual for the Elementary Functions,
Prentice Hall, 1980,
ISBN: 0138220646,
LC: QA331.C635.
-
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.
-
John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
Charles Mesztenyi, John Rice, Henry Thatcher,
Christoph Witzgall,
Computer Approximations,
Wiley, 1968,
LC: QA297.C64.
-
Michael Malcolm,
Algorithms to Reveal Properties of Floating Point Arithmetic,
Communications of the ACM,
Volume 15, Number 11, November 1972, pages 949-951.
-
Frank Olver, David Sookne,
A Note on Backward Recurrence Algorithms,
Mathematics of Computation,
Volume 26, 1972, pages 941-947.
-
Malcolm Pike, David Hill,
Algorithm 266:
Pseudo-Random Numbers,
Communications of the ACM,
Volume 8, Number 10, October 1965, page 605.
-
David Sookne,
Bessel Functions of Real Argument and Integer Order,
NBS Journal of Research B,
Volume 77B, 1973, pages 125-132.
-
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:
-
BESEI0 evaluates the exponentially scaled Bessel I0(X) function.
-
BESEI1 evaluates the exponentially scaled Bessel I1(X) function.
-
BESEK0 evaluates the exponentially scaled Bessel K0(X) function.
-
BESEK1 evaluates the exponentially scaled Bessel K1(X) function.
-
BESI0 evaluates the Bessel I0(X) function.
-
BESI1 evaluates the Bessel I1(X) function.
-
BESJ0 evaluates the Bessel J0(X) function.
-
BESJ1 evaluates the Bessel J1(X) function.
-
BESK0 evaluates the Bessel K0(X) function.
-
BESK1 evaluates the Bessel K1(X) function.
-
BESY0 evaluates the Bessel Y0(X) function.
-
BESY1 evaluates the Bessel Y1(X) function.
-
CALCEI computes various exponential integrals.
-
CALCI0 computes various I0 Bessel functions.
-
CALCI1 computes various I1 Bessel functions.
-
CALCK0 computes various K0 Bessel functions.
-
CALCK1 computes various K1 Bessel functions.
-
CALERF computes various forms of the error function.
-
CALJY0 computes various J0 and Y0 Bessel functions.
-
CALJY1 computes various J1 and Y1 Bessel functions.
-
DAW evaluates Dawson's integral function.
-
DSUBN evaluates derivatives of Ei(X).
-
EI evaluates the exponential integral Ei(X).
-
EONE evaluates the exponential integral E1(X).
-
EXPEI evaluates the scaled exponential integral exp(-X) * Ei(X).
-
MACHAR determines various machine arithmetic parameters.
-
R8_ERF evaluates the error function.
-
R8_ERFC evaluates the complementary error function.
-
R8_ERFCX evaluates the exponentially scaled complementary error function.
-
R8_GAMMA evaluates Gamma(X) for a real argument.
-
R8_GAMMA_LOG evaluates log ( Gamma ( X ) ) for a real argument.
-
R8_PSI evaluates the function Psi(X).
-
REN is a random number generator.
-
RIBESL calculates I Bessel function with non-integer orders.
-
RJBESL calculates J Bessel function with non-integer orders.
-
RKBESL calculates K Bessel function with non-integer orders.
-
RYBESL calculates Y Bessel function with non-integer orders.
-
TIMESTAMP prints out the current YMDHMS date as a timestamp.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 13 April 2013.