C302: Gamma Function for Positive Argument

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

Function subprograms GAMMA, DGAMMA and QGAMMA calculate the gamma function

displaymath89

for real argument x > 0.

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

Structure:

FUNCTION subprograms
User Entry Names: GAMMA, DGAMMA, QGAMMA
Files Referenced: Unit 6
External References: MTLMTR, ABEND

Usage:

In any arithmetic expression,

GAMMA(X), DGAMMA(X) or QGAMMA(X) has the value tex2html_wrap_inline93 ,

where GAMMA is of type REAL, DGAMMA is of type DOUBLE PRECISION, QGAMMA is of type REAL*16, and X has the same type as the function name.

Method:

Approximation by truncated Chebyshev series and functional relations.

Accuracy:

The system-supplied version (see Notes) has full machine accuracy. The CERN version of GAMMA (except on CDC and Cray computers) has full single-precision accuracy. The CERN version of DGAMMA, QGAMMA (and of GAMMA, DGAMMA on CDC and Cray computers) have an accuracy which is approximately one digit less than machine precision.

Error handling:

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

Notes:

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

References:

  1. Y.L. Luke, Mathematical functions and their approximations, (Academic Press, New York 1975) 4.
tex2html_wrap_inline97

Michel Goossens Tue Jun 4 21:00:22 METDST 1996