NAG Library Function Document
nag_complex_polygamma (s14afc) returns the value of the th derivative of the psi function for complex and .
||nag_complex_polygamma (Complex z,
nag_complex_polygamma (s14afc) evaluates an approximation to the
th derivative of the psi function
is complex provided
is real and thus
is singular when
is also known as the polygamma
is often referred to as the digamma
as the trigamma
function in the literature. Further details can be found in Abramowitz and Stegun (1972)
nag_complex_polygamma (s14afc) is based on a modification of the method proposed by Kölbig (1972)
To obtain the value of
is real, nag_real_polygamma (s14aec)
can be used.
Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Kölbig K S (1972) Programs for computing the logarithm of the gamma function, and the digamma function, for complex arguments Comp. Phys. Comm. 4 221–226
z – ComplexInput
On entry: the argument of the function.
must not be ‘too close’ (see Section 6
) to a non-positive integer when
k – IntegerInput
On entry: the function to be evaluated.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, .
Constraint: must not be ‘too close’ to a non-positive integer when . That is, .
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG
The evaluation has been abandoned due to the likelihood of overflow. The result is returned as zero.
Empirical tests have shown that the maximum relative error is a loss of approximately two decimal places of precision.
The example program evaluates the psi (trigamma) function at , and prints the results.
9.1 Program Text
Program Text (s14afce.c)
9.2 Program Data
Program Data (s14afce.d)
9.3 Program Results
Program Results (s14afce.r)