Complex Psi Digamma Function


For Psi(x) with x.i == 0, use the real Psi(x.r) function.

See: Real Psi Digamma Function

For n a positive integer the Digamma function Psi(n) = −gamma + 1 + 1/2 + 1/3 + ... + 1/(n−1) = Sum{k=1, n−1}[1/k], where gamma = −Psi(1) = 5.77215,66490,15328,6...E−1 is Euler's constant. Psi is defined for all values of x except for integers <= 0 where it is infinite.

For example, Psi(2) = −0.5772156649... + 1 = 0.422784335... .

Here are some notes from my program XCCalc - Extra Precision Floating-Point Complex Calculator http://www.oocities.com/hjsmithh/download.html#XCCalc :

Psi(x) = DigammaFunction(x):

Psi(x) = logarithmic derivative of the Gamma function d/dx(Ln(Gam(x))) = Gamma'(x) / Gam(x). For x >= −5, the asymptotic formula with Bernoulli numbers is used to compute this. If x is an integer <= zero, an alarm is displayed. For non-integer negative x < −5, the reflection formula is used:

Psi(x) = Psi(y) + Pi / (Tan(Pi * y)), where y = 1 − x.

For large x,

Psi(x) =~ Ln(x) − 1/2*x − Sum{k=1,2,...}[B(2*k) / (2*k*x^(2*k))],

where B(2*k) are Bernoulli numbers. For small x,

Psi(x) = Psi(n + x) − 1/(n−1+x) − 1/(n−2+x) − ... − 1/(1+x) − 1/x.

This is based on Psi(x) = Psi(x+1) − 1/x. n is computed by a heuristic, n = max( (int)((digits^1.5) / 13.0 + 1 − x), 0), where digits is the current decimal digits in a computed mantissa.

See: Digamma Function -- From MathWorld
And: Wolfram Function Evaluation -- PolyGamma (1-arg, PolyGamma[z] = PolyGamma[0, z])

Return to Complex Computations
Return to Harry's Home Page


This page accessed times since Feb 13, 2006.
Page created by: hjsmithh@sbcglobal.net
Changes last made on Monday, 06-Aug-07 16:15:43 PDT

1