next up previous index
Next: C305 Gamma Function Up: CERNLIB Previous: C303 Gamma Function

C304 Logarithm of the Gamma Function

Routine ID: C304
Author(s): K.S. KölbigLibrary: MATHLIB or Fortran Compiler Library
Submitter: Submitted: 07.06.1992
Language: FortranRevised: 15.03.1993

Function subprograms ALGAMA, DLGAMA and QLGAMA compute the logarithm of the gamma function

lnΓ(x) = ln∫0&inf;e-ttx-1 dt (x>0)

for real argument x>0.

The quadruple-precision version QLGAMA is available only on computers which support a REAL*16 Fortran data type.

Structure:

FUNCTION subprograms
User Entry Names: ALGAMA, DLGAMA, QLGAMA
Obsolete User Entry Names: ALOGAM ALGAMA, DLOGAM DLGAMA
Files Referenced: Unit 6
External References: MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, ALGAMA(X), DLGAMA or QLGAMA(X) has the value lnΓ(X) ,

where ALGAMA is of type REAL, DLGAMA is of type DOUBLE PRECISION, QLGAMA is of type REAL*16, and X has the same type as the function name.

Method:

Rational approximations.

Accuracy:

The system-supplied version (see Notes) has full machine accuracy. The CERN-supplied version of ALGAMA (except on CDC and Cray computers) has full single-precision accuracy. For most values of the argument X, the CERN-supplied versions of DLGAMA, QLGAMA (and of ALGAMA, DLGAMA on CDC and Cray computers) have an accuracy of approximately one significant digit less than the machine precision.

Error handling:

Error C304.1: X ≤0 . The function value is set equal to zero, and a message is written on on Unit 6, unless subroutine MTLSET (N002) has been called.

Notes:

If the function ALGAMA or DLGAMA is available in the system-supplied Fortran mathematical library, the system-supplied function will be loaded instead of the CERN version.

References:

  1. W.J. Cody and K.E. Hillstrom, Chebyshev approximations for the natural logarithm of the gamma function, Math. Comp. 21 (1967) 198--203.
  2. J.F. Hart et al., Computer approximations (John Wiley Sons, New York 1968) 287.

C305



next up previous index
Next: C305 Gamma Function Up: CERNLIB Previous: C303 Gamma Function


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995