GSL Shell has moved
The project, its documentation and the release packages are now hosted on Github. Please find here the user manual.
The library includes routines for calculating the values of Airy functions, Bessel functions, Clausen functions, Coulomb wave functions, Coupling coefficients, the Dawson function, Debye functions, Dilogarithms, Elliptic integrals, Jacobi elliptic functions, Error functions, Exponential integrals, Fermi-Dirac functions, Gamma functions, Gegenbauer functions, Hypergeometric functions, Laguerre functions, Legendre functions and Spherical Harmonics, the Psi (Digamma) Function, Synchrotron functions, Transport functions, Trigonometric functions and Zeta functions. Any error returned by the special function (such as invalid input domains, etc...) will be signaled.
The Airy functions and are defined by the integral representations,
For further information see Abramowitz & Stegun, Section 10.4.
These routines compute a scaled version of the Airy function . For x>0 the scaling factor is
and is 1 for x<0.
These routines compute the Airy function derivatives and their scaled version with the same scaling factor as the airyAi_scaled and airyBi_scaled versions.
Return the n-th zero of the respective functions or their derivatives.
These routines compute the regular cylindrical Bessel function of n-th order, J_{n}(x)
Return the s-th zero of the Bessel J_{n} function.
These routines compute the irregular cylindrical Bessel function of n-th order, Y_{n}(x)
Compute the irregular cylindrical Bessel function of fractional order , .
Regular modified cylindrical Bessel function of n-th order and their scaled version.
These routines compute the (scaled) regular modified Bessel function of fractional order with for x>0, nu>0.
Irregular modified cylindrical Bessel function of order n and their scaled version.
Compute the (scaled or logarithm) irregular modified Bessel function of fractional order for x>0, nu>0.
Compute the regular spherical Bessel function of l-th order.
Compute the irregular spherical Bessel function of l-th order.
Compute the scaled regular modified spherical Bessel function of l-th order.
Compute the irregular modified spherical Bessel function of l-th order.
The Clausen function is defined by the following integral,
It is related to the dilogarithm by .
These routines compute the lowest-order normalized hydrogenic bound state radial wavefunction
These routines compute the n-th normalized hydrogenic bound state radial wave function,
where is the generalized Laguerre polynomial (see Laguerre Functions). The normalization is chosen such that the wave function is given by .
This function computes the Coulomb wave functions , and their derivatives , with respect to x. The parameters are restricted to L, L-k > -1/2, x > 0 and integer k.
Note that L itself is not restricted to being an integer. The results are returned as:
F, Fp, G, Gp, exp_F, exp_G = coulomb_wave_FG(eta, x, L_F,k)
with Fp and Gp being the derivates. If an overflow occurs, GSL_EOVRFLW is returned as an error and scaling exponents are stored in the return values exp_F, exp_G.
This function computes the Coulomb wave function normalization constant for L > -1.
These routines compute the Wigner 3-j coefficient,
where the arguments are given in half-integer units, ja = two_ja/2, ma = two_ma/2, etc.
These routines compute the Wigner 6-j coefficient,
where the arguments are given in half-integer units, ja = two_ja/2, ma = two_ma/2, etc.
These routines compute the Wigner 9-j coefficient,
where the arguments are given in half-integer units, ja = two_ja/2, ma = two_ma/2, etc.
The Dawson integral is defined by
A table of Dawson’s integral can be found in Abramowitz & Stegun, Table 7.5.
The Debye functions are defined by the following integral,
For further information see Abramowitz & Stegun, Section 27.1.
These routines compute the dilogarithm for a real argument. In Lewin’s notation this is Li_{2}(x), the real part of the dilogarithm of a real x. It is defined by the integral representation
Note that for x <= 1, and for x > 1.
Note that Abramowitz & Stegun refer to the Spence integral as the dilogarithm rather than .
Compute the dilogarithm for a complex argument.
The Legendre forms of elliptic integrals , and are defined by,
The complete Legendre forms are denoted by and . The notation used here is based on Carlson, Numerische Mathematik 33 (1979) 1 and differs slightly from that used by Abramowitz & Stegun, where the functions are given in terms of the parameter and n is replaced by -n.
The Carlson symmetric forms of elliptical integrals , , and are defined by,
These functions compute the incomplete elliptic integral which is defined through the Carlson form by the following relation,
The argument n is not used and will be removed in a future release.
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode. Note that Abramowitz & Stegun define this function in terms of the parameter .
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode. Note that Abramowitz & Stegun define this function in terms of the parameter .
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode. Note that Abramowitz & Stegun define this function in terms of the parameters and , with the change of sign .
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral to the accuracy specified by the mode variable mode.
This function computes the Jacobian elliptic functions , , by descending Landen transformations. It returns sn, cn and dn as:
sn, cn, dn = elljac(u, m)
The error function erf(x)
These routines compute the (logarithmic) complementary error function .
These routines compute the upper tail of the Gaussian probability function
These routines compute the Gaussian probability density function .
These routines compute the hazard function for the normal distribution.
These routines provide an exponential function .
This function exponentiates x with an associated absolute error dx.
These routines exponentiate x and multiply by the factor y to return the product .
This routine computes the product for the quantities x, y with associated absolute errors dx, dy.
These routines compute the quantity using an algorithm that is accurate for small x.
These routines compute the quantity using an algorithm that is accurate for small x. For small x the algorithm is based on the expansion .
These routines compute the quantity using an algorithm that is accurate for small x. For small x the algorithm is based on the expansion .
These routines compute the N-relative exponential given by,
These routines compute the exponential integral of order n,
These routines compute the exponential integral ,
where PV denotes the principal value of the integral.
These routines compute the integral .
These routines compute the integral , where is the Euler constant (available as the macro M_EULER).
These routines compute the third-order exponential integral for x >= 0.
These routines compute the Sine integral .
These routines compute the Cosine integral for x > 0.
These routines compute the Arctangent integral, which is defined as .
The complete Fermi-Dirac integral F_{n}(x) is given by,
Note that the Fermi-Dirac integral is sometimes defined without the normalization factor in other texts.
These routines compute the incomplete Fermi-Dirac integral with an index of zero, .
The incomplete Fermi-Dirac integral is given by,
Compute the integral .
Compute the integral
where γ_{E} is the Euler constant.
Compute the Sine integral .
Compute the Cosine integral for x > 0.
compute the Arctangent integral, which is defined as .
Compute the factorial n!. The factorial is related to the Gamma function by .
Compute the double factorial .
These routines compute the logarithm of the factorial of N, log(n!). The algorithm is faster than computing ln(Γ (n+1)).
Compute the logarithm of the double factorial of N, log(n!!).
Compute the combinatorial factor
Compute the logarithm of “n choose m”. This is equivalent to the sum .
Compute the Gamma function Γ (x), subject to x not being a negative integer or zero. The function is computed using the real Lanczos method.
Compute the logarithm of the Gamma function, , subject to x not being a negative integer or zero. For x<0 the real part of is returned, which is equivalent to . The function is computed using the real Lanczos method.
These routines compute the regulated Gamma Function for x > 0. The regulated gamma function is given by,
and is a useful suggestion of Temme.
These routines compute the reciprocal of the gamma function, using the real Lanczos method.
This routine computes for complex z and z not a negative integer or zero, using the complex Lanczos method. The returned parameters are and . Note that the phase part (arg) is not well-determined when is very large, due to inevitable roundoff in restricting to (-pi,pi]. This will result in a GSL_ELOSS error when it occurs. The absolute value part (lnr), however, never suffers from loss of precision.
The functions returns:
lnr, arg = lngammac(z)
These routines compute the Beta Function, subject to a and b not being negative integers.
These routines compute the logarithm of the Beta Function, subject to a and b not being negative integers.
These routines compute the normalized incomplete Beta function where for 0 <= x <= 1. For a > 0, b > 0 the value is computed using a continued fraction expansion. For all other values it is computed using the relation .
These routines compute the Taylor coefficient for x >= 0, n >= 0.
These routines compute the Pochhammer symbol . The Pochhammer symbol is also known as the Apell symbol and sometimes written as (a,x). When a and a+x are negative integers or zero, the limiting value of the ratio is returned.
These routines compute the logarithm of the Pochhammer symbol, .
These routines compute the relative Pochhammer symbol .
These functions compute the unnormalized incomplete Gamma Function for a real and x >= 0.
These routines compute the normalized incomplete Gamma Function for a > 0, x >= 0.
These routines compute the complementary normalized incomplete Gamma Function for a > 0, x >= 0. Note that Abramowitz & Stegun call P(a,x) the incomplete gamma function (section 6.5).
These functions evaluate the Gegenbauer polynomial for a specific value of n, lambda, x subject to , n >= 0.
These routines compute the hypergeometric function .
These routines compute the confluent hypergeometric function . The parameters m and n can be integer or real numbers.
These routines compute the confluent hypergeometric function . The parameters m and n can be integer or real numbers.
These routines compute the Gauss hypergeometric function for .
If the arguments (a,b,c,x) are too close to a singularity then the function can return the error code GSL_EMAXITER when the series approximation converges too slowly. This occurs in the region of x=1, c - a - b = m for integer m.
These routines compute the Gauss hypergeometric function where a is complex parameter, c and x are real parameters with .
The generalized Laguerre polynomials are defined in terms of confluent hypergeometric functions as
and are sometimes referred to as the associated Laguerre polynomials. They are related to the plain Laguerre polynomials by
and
For more information see Abramowitz & Stegun, Chapter 22.
Lambert’s W functions, W(x), are defined to be solutions of the equation . This function has multiple branches for x < 0; however, it has only two real-valued branches. We define to be the principal branch, where W > -1 for x < 0, and to be the other real branch, where W < -1 for x < 0.
These compute the principal branch of the Lambert W function, .
These compute the secondary real-valued branch of the Lambert W function, .
These functions evaluate the Legendre polynomial for a specific value of l, x subject to l >= 0,
These routines compute the Legendre function for x > -1, x != 1 and l >= 0.
These routines compute the associated Legendre polynomial for m >= 0, l >= m, .
These routines compute the normalized associated Legendre polynomial suitable for use in spherical harmonics. The parameters must satisfy m >= 0, l >= m, . Theses routines avoid the overflows that occur for the standard normalization of .
These routines compute the regular Spherical Conical Function for x > -1 where n in {-12, 0, 12, 1}
These routines compute the Regular Spherical Conical Function for x > -1, l >= -1.
These routines compute the Regular Cylindrical Conical Function for x > -1, m >= -1.
These routines compute the l-th radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space , l >= 0. In the flat limit this takes the form .
The polygamma functions of order n are defined by
where is known as the digamma function.
These routines compute the digamma function for general x, x ne 0.
These routines compute the Trigamma function for general x.
These routines compute the real part of the digamma function on the line 1+i y, .
These routines compute the polygamma function for n >= 0, x > 0.
These routines compute the first synchrotron function for x >= 0.
These routines compute the second synchrotron function for x >= 0.
The transport functions J(n,x) are defined by the integral representations .
These routines compute the transport function with
The Riemann zeta function is defined by the infinite sum . These routines compute the Riemann zeta function for arbitrary s, .
For large positive argument, the Riemann zeta function approaches one. In this region the fractional part is interesting, and therefore we need a function to evaluate it explicitly. These routines compute for arbitrary s, .
The eta function is defined by . These routines compute the eta function eta(s) for arbitrary s.
These routines compute the Hurwitz zeta function for s > 1, q > 0.