For Psi(x) with x.i == 0, use the real Psi(x.r) 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:

For large x,

where B(2*k) are Bernoulli numbers. For small 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.

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