naginterfaces.library.specfun.psi_​deriv_​real

naginterfaces.library.specfun.psi_deriv_real(x, k)[source]

psi_deriv_real returns the value of the th derivative of the psi function for real and .

For full information please refer to the NAG Library document for s14ae

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/s/s14aef.html

Parameters
xfloat

The argument of the function.

kint

The function to be evaluated.

Returns
pkxfloat

The value of the th derivative of the psi function for real and .

Raises
NagValueError
(errno )

On entry, is ‘too close’ to a non-positive integer: and .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

Evaluation abandoned due to likelihood of underflow.

(errno )

Evaluation abandoned due to likelihood of overflow.

Notes

psi_deriv_real evaluates an approximation to the th derivative of the psi function given by

where is real with and . For negative noninteger values of , the recurrence relationship

is used. The value of is obtained by a call to polygamma_deriv(), which is based on the function PSIFN in Amos (1983).

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).

References

Abramowitz, M and Stegun, I A, 1972, Handbook of Mathematical Functions, (3rd Edition), Dover Publications

Amos, D E, 1983, Algorithm 610: A portable FORTRAN subroutine for derivatives of the psi function, ACM Trans. Math. Software (9), 494–502