The function may be called by the names: s14afc, nag_specfun_psi_deriv_complex or nag_complex_polygamma.
s14afc evaluates an approximation to the th derivative of the psi function given by
where is complex provided and . If , is real and thus is singular when .
Note that is also known as the polygamma function. Specifically, is often referred to as the digamma function and as the trigamma function in the literature. Further details can be found in Abramowitz and Stegun (1972).
s14afc is based on a modification of the method proposed by Kölbig (1972).
To obtain the value of when is real, 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
1: – ComplexInput
On entry: the argument of the function.
must not be ‘too close’ (see Section 6) to a non-positive integer when .
2: – IntegerInput
On entry: the function to be evaluated.
3: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, is ‘too close’ to a non-positive integer when : , .
On entry, .
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 for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
Evaluation abandoned due to likelihood of overflow.
Empirical tests have shown that the maximum relative error is a loss of approximately two decimal places of precision.
8Parallelism and Performance
s14afc is not threaded in any implementation.
This example evaluates the psi (trigamma) function at , and prints the results.