FN The Fullerton Function Library.

FN is a C library which approximates elementary and special functions using Chebyshev polynomials; functions include Airy, Bessel I, Bessel J, Bessel K, Bessel Y, beta, confluent hypergeometric, cosine integral, Dawson's integral, digamma (psi), error, exponential integral, gamma, hyperbolic cosine integral, hyperbolic sine integral, incomplete gamma, log gamma, logarithmic integral, Pochhammer, psi, sine integral, Spence; by Wayne Fullerton.

The original version of the library provided routines for complex, single precision real, and double precision real arguments and used the prefixes "C" and "D" to indicate the complex and double precision versions.

This scheme has been modified for consistency, and also to avoid conflict with the names of functions commonly provided by various compilers. The prefixes "C4_", "R4_" and "R8_" are used to indicate functions for complex, single precision real, and double precision real arguments. For example, the sine function can be calculated by the functions C4_SIN, R4_SIN or R8_SIN.

The original, true, correct version of FN is available through NETLIB: http://www.netlib.org/fn/index.html.

Languages:

FN is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

BESSELJ, a C library which evaluates Bessel J functions of noninteger order.

C4LIB, a C library which implements certain elementary functions for "C4" or single precision complex variables using the C++ "complex " datatype.

C8LIB, a C library which implements certain elementary functions for "C8" or double precision complex variables using the C++ "complex " datatype.

CLAUSEN, a C library which evaluates a Chebyshev interpolant to the Clausen function Cl2(x).

CORDIC, a C library which uses the CORDIC method to compute certain elementary functions.

GCC_INTRINSICS, a C program which tests or demonstrates some of the intrinsic functions provided by the G++ compiler.

MACHAR, a C library which computes the appropriate values of machine constants for a given machine.

MACHINE, a C library which stores the appropriate values of machine constants for a given machine.

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

R4LIB, a C library which contains many utility routines, using "R4" or "single precision real" arithmetic.

R8LIB, a C library which contains many utility routines, using "R8" or "double precision real" arithmetic.

TEST_VALUES, a C library which supplies test values of various mathematical functions.

Reference:

1. Wayne Fullerton,
Portable Special Function Routines,
in Portability of Numerical Software,
edited by Wayne Cowell,
Lecture Notes in Computer Science, Volume 57, pages 452-483,
Springer 1977,
ISBN: 978-3-540-08446-4,
LC: QA297.W65.

Source Code:

• fn.c, the source code.
• fn.h, the include file.

List of Routines:

• C4_COS evaluates the cosine of a C4 argument.
• C4_SIN evaluates the sine of a C4 argument.
• I4_ABS returns the absolute value of an I4.
• I4_MACH returns integer machine constants.
• I4_MAX returns the maximum of two I4's.
• I4_MIN returns the minimum of two I4's.
• I4_POW returns the value of I^J.
• R4_ABS returns the absolute value of an R4.
• R4_ACOS evaluates the arc-cosine of an R4 argument.
• R4_ACOSH evaluates the arc-hyperbolic cosine of an R4 argument.
• R4_ADMP: modulus and phase of the derivative of the Airy function.
• R4_AI evaluates the Airy function Ai of an R4 argument.
• R4_AID evaluates the derivative of the Airy function Ai of an R4 argument.
• R4_AIDE: exponentially scaled derivative, Airy function Ai of an R4 argument.
• R4_AIE evaluates the exponential scaled Airy function Ai of an R4 argument.
• R4_AIMP evaluates the modulus and phase of the Airy function.
• R4_AINT truncates an R4 argument to an integer.
• R4_ASIN evaluates the arc-sine of an R4 argument.
• R4_ASINH evaluates the arc-sine of an R4 argument.
• R4_ATAN evaluates the arc-tangent of an R4 argument.
• R4_ATAN2 evaluates the arc-tangent of two R4 arguments.
• R4_ATANH evaluates the arc-hyperbolic tangent of an R4 argument.
• R4_BESI0 evaluates the Bessel function I of order 0 of an R4 argument.
• R4_BESI0E evaluates the exponentially scaled Bessel function I0(X).
• R4_BESI1 evaluates the Bessel function I of order 1 of an R4 argument.
• R4_BESJ0 evaluates the Bessel function J of order 0 of an R4 argument.
• R4_BESJ1 evaluates the Bessel function J of order 1 of an R4 argument.
• R4_BESK0 evaluates the Bessel function K of order 0 of an R4 argument.
• R4_BESK0E evaluates the exponentially scaled Bessel function K0(X).
• R4_BESK1 evaluates the Bessel function K of order 1 of an R4 argument.
• R4_BESK1E evaluates the exponentially scaled Bessel function K1(X).
• R4_BESKES evaluates a sequence of exponentially scaled K Bessel functions at X.
• R4_BESKS evaluates a sequence of K Bessel functions at X.
• R4_BESY0 evaluates the Bessel function Y of order 0 of an R4 argument.
• R4_BESY1 evaluates the Bessel function Y of order 1 of an R4 argument.
• R4_BETA evaluates the beta function of R4 arguments.
• R4_BETAI evaluates the incomplete beta ratio of R4 arguments.
• R4_BI evaluates the Airy function Bi of an R4 argument.
• R4_BID evaluates the derivative of the Airy function Bi of an R4 argument.
• R4_BIDE: exponentially scaled derivative, Airy function Bi of an R4 argument.
• R4_BIE evaluates the exponentially scaled Airy function Bi of an R4 argument.
• R4_BINOM evaluates the binomial coefficient using R4 arithmetic.
• R4_CBRT computes the cube root of an R4.
• R4_CHI evaluates the hyperbolic cosine integral of an R4 argument.
• R4_CHU evaluates the confluent hypergeometric function of R4 arguments.
• R4_CHU_SCALED: scaled confluent hypergeometric function of R4 arguments.
• R4_CI evaluates the cosine integral Ci of an R4 argument.
• R4_CIN evaluates the alternate cosine integral Cin of an R4 argument.
• R4_CINH evaluates the alternate hyperbolic cosine integral Cinh of an R4 argument.
• R4_COS evaluates the cosine of an R4 argument.
• R4_COS_DEG evaluates the cosine of an R4 argument in degrees.
• R4_COSH evaluates the hyperbolic cosine of an R4 argument.
• R4_COT evaluates the cotangent of an R4 argument.
• R4_CSEVL evaluates a Chebyshev series.
• R4_DAWSON evaluates Dawson's integral of an R4 argument.
• R4_E1 evaluates the exponential integral E1 for an R4 argument.
• R4_EI evaluates the exponential integral Ei for an R4 argument.
• R4_ERF evaluates the error function of an R4 argument.
• R4_ERFC evaluates the co-error function of an R4 argument.
• R4_EXP evaluates the exponential of an R4 argument.
• R4_EXPREL evaluates the exponential relative error term of an R4 argument.
• R4_FAC evaluates the factorial of an I4 argument.
• R4_GAMI evaluates the incomplete gamma function for an R4 argument.
• R4_GAMIC evaluates the complementary incomplete gamma function.
• R4_GAMIT evaluates Tricomi's incomplete gamma function for an R4 argument.
• R4_GAML evaluates bounds for an R4 argument of the gamma function.
• R4_GAMMA evaluates the gamma function of an R4 argument.
• R4_GAMR evaluates the reciprocal gamma function of an R4 argument.
• R4_GMIC: complementary incomplete gamma, small X, A near negative integer.
• R4_GMIT: Tricomi's incomplete gamma function for small X.
• R4_INITS initializes a Chebyshev series.
• R4_INT returns the integer part of an R4 argument.
• R4_KNUS computes a sequence of K Bessel functions.
• R4_LBETA evaluates the logarithm of the beta function of R4 arguments.
• R4_LGAMS evaluates the log of |gamma(x)| and sign, for an R4 argument.
• R4_LGIC evaluates the log complementary incomplete gamma function for large X.
• R4_LGIT evaluates the log of Tricomi's incomplete gamma function.
• R4_LGMC evaluates the log gamma correction factor for an R4 argument.
• R4_LI evaluates the logarithmic integral for an R4 argument.
• R4_LNGAM evaluates the log of the absolute value of gamma of an R4 argument.
• R4_LNREL evaluates log ( 1 + X ) for an R4 argument.
• R4_LOG evaluates the logarithm of an R4.
• R4_LOG10 evaluates the logarithm, base 10, of an R4.
• R4_MACH returns single precision real machine constants.
• R4_MACHAR computes machine constants for R4 arithmetic.
• R4_MAX returns the maximum of two R4's.
• R4_MIN returns the minimum of two R4's..
• R4_MOD returns the remainder of R4 division.
• R4_MOP returns the I-th power of -1 as an R4 value.
• R4_PAK packs a base 2 exponent into an R4.
• R4_POCH evaluates Pochhammer's function of R4 arguments.
• R4_POCH1 evaluates a quantity related to Pochhammer's symbol.
• R4_POW evaluates A^B.
• R4_PSI evaluates the psi function of an R4 argument.
• R4_RAND is a portable pseudorandom number generator.
• R4_RANDGS generates a normally distributed random number.
• R4_RANDOM is a portable pseudorandom number generator.
• R4_RANF is a driver for R4_RANDOM.
• R4_REN is a simple random number generator.
• R4_SHI evaluates the hyperbolic sine integral Shi of an R4 argument.
• R4_SI evaluates the sine integral Si of an R4 argument.
• R4_SIFG is a utility routine.
• R4_SIGN returns the sign of an R4.
• R4_SIN evaluates the sine of an R4 argument.
• R4_SIN_DEG evaluates the sine of an R4 argument in degrees.
• R4_SINH evaluates the hyperbolic sine of an R4 argument.
• R4_SPENCE evaluates a form of Spence's function for an R4 argument.
• R4_SQRT computes the square root of an R4.
• R4_TAN evaluates the tangent of an R4 argument.
• R4_TANH evaluates the hyperbolic tangent of an R4 argument.
• R4_UPAK unpacks an R4 into a mantissa and exponent.
• R8_ABS returns the absolute value of an R8.
• R8_ACOS evaluates the arc-cosine of an R8 argument.
• R8_ACOSH evaluates the arc-hyperbolic cosine of an R8 argument.
• R8_ADMP: modulus and phase of the derivative of the Airy function.
• R8_AI evaluates the Airy function Ai of an R8 argument.
• R8_AID evaluates the derivative of the Airy function Ai of an R8 argument.
• R8_AIDE: exponentially scaled derivative, Airy function Ai of an R8 argument.
• R8_AIE evaluates the exponentially scaled Airy function Ai of an R8 argument.
• R8_AIMP evaluates the modulus and phase of the Airy function.
• R8_AINT truncates an R8 argument to an integer.
• R8_ASIN evaluates the arc-sine of an R8 argument.
• R8_ASINH evaluates the arc-sine of an R8 argument.
• R8_ATAN evaluates the arc-tangent of an R8 argument.
• R8_ATAN2 evaluates the arc-tangent of two R8 arguments.
• R8_B0MP evaluates the modulus and phase for the Bessel J0 and Y0 functions.
• R8_B1MP evaluates the modulus and phase for the Bessel J1 and Y1 functions.
• R8_BESI0 evaluates the Bessel function I of order 0 of an R8 argument.
• R8_BESI0E evaluates the exponentially scaled Bessel function I0(X).
• R8_BESI1 evaluates the Bessel function I of order 1 of an R8 argument.
• R8_BESI1E evaluates the exponentially scaled Bessel function I1(X).
• R8_BESJ0 evaluates the Bessel function J of order 0 of an R8 argument.
• R8_BESJ1 evaluates the Bessel function J of order 1 of an R8 argument.
• R8_BESK0 evaluates the Bessel function K of order 0 of an R8 argument.
• R8_BESK0E evaluates the exponentially scaled Bessel function K0(X).
• R8_BESK1 evaluates the Bessel function K of order 1 of an R8 argument.
• R8_BESK1E evaluates the exponentially scaled Bessel function K1(X).
• R8_BESKES: a sequence of exponentially scaled K Bessel functions at X.
• R8_BESKS evaluates a sequence of K Bessel functions at X.
• R8_BESY0 evaluates the Bessel function Y of order 0 of an R8 argument.
• R8_BESY1 evaluates the Bessel function Y of order 1 of an R8 argument.
• R8_BETA evaluates the beta function of R8 arguments.
• R8_BETAI evaluates the incomplete beta ratio of R8 arguments.
• R8_BI evaluates the Airy function Bi of an R8 argument.
• R8_BID evaluates the derivative of the Airy function Bi of an R8 argument.
• R8_BIDE: exponentially scaled derivative, Airy function Bi of an R8 argument.
• R8_BIE evaluates the exponentially scaled Airy function Bi of an R8 argument.
• R8_BINOM evaluates the binomial coefficient using R8 arithmetic.
• R8_CBRT computes the cube root of an R8.
• R8_CHI evaluates the hyperbolic cosine integral of an R8 argument.
• R8_CHU evaluates the confluent hypergeometric function of R8 arguments.
• R8_CHU_SCALED: scaled confluent hypergeometric function of R8 arguments.
• R8_CI evaluates the cosine integral Ci of an R8 argument.
• R8_CIN evaluates the alternate cosine integral Cin of an R8 argument.
• R8_CINH: alternate hyperbolic cosine integral Cinh of an R8 argument.
• R8_COS evaluates the cosine of an R8 argument.
• R8_COS_DEG evaluates the cosine of an R8 argument in degrees.
• R8_COSH evaluates the hyperbolic cosine of an R8 argument.
• R8_COT evaluates the cotangent of an R8 argument.
• R8_CSEVL evaluates a Chebyshev series.
• R8_DAWSON evaluates Dawson's integral of an R8 argument.
• R8_E1 evaluates the exponential integral E1 for an R8 argument.
• R8_EI evaluates the exponential integral Ei for an R8 argument.
• R8_ERF evaluates the error function of an R8 argument.
• R8_ERFC evaluates the co-error function of an R8 argument.
• R8_EXP evaluates the exponential of an R8 argument.
• R8_EXPREL evaluates the exponential relative error term of an R8 argument.
• R8_FAC evaluates the factorial of an I4 argument.
• R8_GAMI evaluates the incomplete gamma function for an R8 argument.
• R8_GAMIC evaluates the complementary incomplete gamma function.
• R8_GAMIT evaluates Tricomi's incomplete gamma function for an R8 argument.
• R8_GAML evaluates bounds for an R8 argument of the gamma function.
• R8_GAMMA evaluates the gamma function of an R8 argument.
• R8_GAMR evaluates the reciprocal gamma function of an R8 argument.
• R8_GMIC: complementary incomplete gamma, small X, A near negative int.
• R8_GMIT: Tricomi's incomplete gamma function for small X.
• R8_INITS initializes a Chebyshev series.
• R8_INT returns the integer part of an R8 argument.
• R8_KNUS computes a sequence of K Bessel functions.
• R8_LBETA evaluates the logarithm of the beta function of R8 arguments.
• R8_LGAMS evaluates the log of |gamma(x)| and sign, for an R8 argument.
• R8_LGIC evaluates the log complementary incomplete gamma function for large X.
• R8_LGIT evaluates the log of Tricomi's incomplete gamma function.
• R8_LGMC evaluates the log gamma correction factor for an R8 argument.
• R8_LI evaluates the logarithmic integral for an R8 argument.
• R8_LNGAM: log of the absolute value of gamma of an R8 argument.
• R8_LNREL evaluates log ( 1 + X ) for an R8 argument.
• R8_LOG evaluates the logarithm of an R8.
• R8_LOG10 evaluates the logarithm, base 10, of an R8.
• R8_MACH returns double precision real machine constants.
• R8_MACHAR computes machine constants for R8 arithmetic.
• R8_MAX returns the maximum of two R8's.
• R8_MIN returns the minimum of two R8's.
• R8_MOD returns the remainder of R8 division.
• R8_MOP returns the I-th power of -1 as an R8 value.
• R8_PAK packs a base 2 exponent into an R8.
• R8_POCH evaluates Pochhammer's function of R8 arguments.
• R8_POCH1 evaluates a quantity related to Pochhammer's symbol.
• R8_POW evaluates A^B.
• R8_PSI evaluates the psi function of an R8 argument.
• R8_REN is a simple random number generator.
• R8_SHI evaluates the hyperbolic sine integral Shi of an R8 argument.
• R8_SI evaluates the sine integral Si of an R8 argument.
• R8_SIFG is a utility routine.
• R8_SIGN returns the sign of an R8.
• R8_SIN evaluates the sine of an R8 argument.
• R8_SIN_DEG evaluates the sine of an R8 argument in degrees.
• R8_SINH evaluates the hyperbolic sine of an R8 argument.
• R8_SPENCE evaluates a form of Spence's function for an R8 argument.
• R8_SQRT computes the square root of an R8.
• R8_TAN evaluates the tangent of an R8 argument.
• R8_TANH evaluates the hyperbolic tangent of an R8 argument.
• R8_UPAK unpacks an R8 into a mantissa and exponent.

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

Last revised on 17 January 2012.