next up previous index
Next: C309 Coulomb Wave Up: CERNLIB Previous: C306 Logarithm of

C307 Digamma or Psi Function for Complex Argument

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

Function subprograms CDIGAM and WDIGAM calculate the logarithmic derivative of the gamma function (the digamma, or psi, function) ψ(z) defined by

ψ(z) = {d lnΓ(z)dz}

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

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

Structure:

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

Usage:

In any arithmetic expression, CDIGAM(Z) or WDIGAM(Z) has the value ψ(Z) ,

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

Method:

The method is described in Ref. 1.

Accuracy:

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

Error handling:

Error C307.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.

C309


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