next up previous index
Next: C307 Digamma or Up: CERNLIB Previous: C305 Gamma Function

C306 Logarithm of the Gamma Function for Complex Argument

Routine ID: C306
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.03.1994
Language: FortranRevised:

Function subprograms CLGAMA and WLGAMA calculate the logarithm of the gamma function

lnΓ(z) = ln∫0&inf;e-ttz-1 dt (Re z>0)

for complex z ≠-n, (n=0,1,2,...) . The imaginary part Im lnΓ(z) is calculated in such a way that it is continuous for |argz|<π , i.e. it is not taken mod .

The double-precision version WLGAMA is available only on computers which support a COMPLEX*16 Fortran data type.

Structure:

FUNCTION subprograms
User Entry Names: CLGAMA, WLGAMA
Files Referenced: Unit 6
External References: MTLMTR (N002), ABEND (Z035)

Usage:

In any arithmetic expression, CLGAMA(Z) or WLGAMA(Z) has the value lnΓ(Z) ,

where CLGAMA is of type COMPLEX, WLGAMA is of type COMPLEX*16, and Z has the same type as the function name.

Method:

The method is described in Ref. 1.

Accuracy:

CLGAMA (except on CDC and Cray computers) has full single-precision accuracy. For most values of the argument X, WLGAMA (and CLGAMA on CDC and Cray computers) has an accuracy of approximately two significant digits less than the machine precision.

Error handling:

Error C306.1: Z= -n,(n = 0,1,2,...).

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

References:

  1. K.S. Kölbig, Programs for computing the logarithm of the gamma function, and the digamma function, for complex argument, Computer Phys. Comm. 4 (1972) 221--226.

C307


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