[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
7.19.1 Gamma Functions
The Gamma function is defined by the following integral, It is related to the factorial function by \Gamma(n)=(n-1)! for positive integer n. Further information on the Gamma function can be found in Abramowitz & Stegun, Chapter 6. The functions described in this section are declared in the header file ‘gsl_sf_gamma.h’.
- Function: double gsl_sf_gamma (double x)
- Function: int gsl_sf_gamma_e (double x, gsl_sf_result * result)
These routines compute the Gamma function \Gamma(x), subject to x not being a negative integer or zero. The function is computed using the real Lanczos method. The maximum value of x such that \Gamma(x) is not considered an overflow is given by the macro
GSL_SF_GAMMA_XMAX
and is 171.0.
- Function: double gsl_sf_lngamma (double x)
- Function: int gsl_sf_lngamma_e (double x, gsl_sf_result * result)
-
These routines compute the logarithm of the Gamma function, \log(\Gamma(x)), subject to x not being a negative integer or zero. For x<0 the real part of \log(\Gamma(x)) is returned, which is equivalent to \log(|\Gamma(x)|). The function is computed using the real Lanczos method.
- Function: int gsl_sf_lngamma_sgn_e (double x, gsl_sf_result * result_lg, double * sgn)
This routine computes the sign of the gamma function and the logarithm of its magnitude, subject to x not being a negative integer or zero. The function is computed using the real Lanczos method. The value of the gamma function can be reconstructed using the relation \Gamma(x) = sgn * \exp(resultlg).
- Function: double gsl_sf_gammastar (double x)
- Function: int gsl_sf_gammastar_e (double x, gsl_sf_result * result)
-
These routines compute the regulated Gamma Function \Gamma^*(x) for x > 0. The regulated gamma function is given by, and is a useful suggestion of Temme.
- Function: double gsl_sf_gammainv (double x)
- Function: int gsl_sf_gammainv_e (double x, gsl_sf_result * result)
-
These routines compute the reciprocal of the gamma function, 1/\Gamma(x) using the real Lanczos method.
- Function: int gsl_sf_lngamma_complex_e (double zr, double zi, gsl_sf_result * lnr, gsl_sf_result * arg)
-
This routine computes \log(\Gamma(z)) for complex z=z_r+i z_i and z not a negative integer or zero, using the complex Lanczos method. The returned parameters are lnr = \log|\Gamma(z)| and arg = \arg(\Gamma(z)) in (-\pi,\pi]. Note that the phase part (arg) is not well-determined when |z| 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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |