C304: Logarithm of the Gamma Function

Author(s): K.S. Kölbig Library: MATHLIB or Fortran Compiler Library
Submitter: Submitted: 07.06.1992
Language: Fortran Revised: 15.03.1993

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

displaymath94

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 tex2html_wrap_inline98 ALGAMA, DLOGAM tex2html_wrap_inline100 DLGAMA
Files Referenced: Unit 6
External References: MTLMTR, ABEND

Usage:

In any arithmetic expression,

ALGAMA(X), DLGAMA or QLGAMA(X) has the value tex2html_wrap_inline102 ,

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: tex2html_wrap_inline104 . 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.
tex2html_wrap_inline106

Michel Goossens Tue Jun 4 21:03:01 METDST 1996