next up previous index
Next: C318 Jacobian Elliptic Up: CERNLIB Previous: C315 Riemann Zeta

C316 Psi (Digamma) and Polygamma Functions

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

Function subprograms RPSIPG and DPSIPG calculate either the logarithmic derivative of the gamma function (the psi, or digamma, function)

ψ(x) ≡ ψ(0)(x) = {dlnΓ(x)dx}

or one of the other polygamma functions

ψ(k)(x) = {dkdxk} ψ(x) = {dk+1dxk+1} lnΓ(x)

for real arguments x ≠-n,(n=0,1,2,...) and k = 1,2,...,6 .

Note that the Euler constant γ= -ψ(1)= 0.57721 ...

can be calculated by using this subprogram.

On CDC and Cray computers, the double-precision version DPSIPG is not available.

Structure:

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

Usage:

In any arithmetic expression, RPSIPG(X,K) or DPSIPG(X,K) has the value ψ(K)(X) ,

where RPSIPG is of type REAL, DPSIPG is of type DOUBLE PRECISION, and where X has the same type as the function name. K is of type INTEGER.

Method:

Rational Chebyshev approximation (k = 0), approximation by truncated Chebyshev series (k > 0), and functional relations.

Accuracy:

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

Error handling:

Error C316.1: K < 0 or K > 6 .
Error C316.2: X= -n, (n=0,1,2,...) .
In both cases, the function value is set to zero, and a message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

References:

  1. W.J. Cody, A.J. Strecock and H.C. Thather, Jr., Chebyshev approximations for the psi function, Math. Comp. 27 (1973) 123--127.
  2. Y.L. Luke, Mathematical functions and their approximations (Academic Press, New York, l975) 5--6.

C318



next up previous index
Next: C318 Jacobian Elliptic Up: CERNLIB Previous: C315 Riemann Zeta


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