next up previous index
Next: C306 Logarithm of Up: CERNLIB Previous: C304 Logarithm of

C305 Gamma Function for Complex Argument

Routine ID: C305
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 02.05.1966
Language: FortranRevised: 15.03.1993

Function subprograms CGAMMA and WGAMMA calculate the gamma function

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

for complex arguments z ≠-n,(n = 0,1,2,...) .

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

Structure:

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

Usage:

In any arithmetic expression, CGAMMA(Z) or WGAMMA(Z) has the value Γ(Z),

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

Method:

The method is described in Ref. 1.

Accuracy:

CGAMMA (except on CDC and Cray computers) has full single-precision accuracy. For most values of the argument Z, WGAMMA (and CGAMMA on CDC and Cray computers) has an accuracy of approximately one significant digit less than the machine precision.

Error handling:

Error C305.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. Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York 1969) 304--305

C306


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