naginterfaces.library.specfun.polygamma_​deriv

naginterfaces.library.specfun.polygamma_deriv(x, n, m)[source]

polygamma_deriv returns a sequence of values of scaled derivatives of the psi function (also known as the digamma function).

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

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/s/s14adf.html

Parameters
xfloat

The argument of the function.

nint

The index of the first member of the sequence of functions.

mint

The number of members required in the sequence , for .

Returns
ansfloat, ndarray, shape

The first elements of contain the required values , for .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

Computation abandoned due to the likelihood of underflow.

(errno )

Computation abandoned due to the likelihood of overflow.

(errno )

There is not enough internal workspace to continue computation. is probably too large.

Notes

polygamma_deriv computes values of the function

for , , , where is the psi function

and denotes the th derivative of .

The function is derived from the function PSIFN in Amos (1983). The basic method of evaluation of is the asymptotic series

for large greater than a machine-dependent value , followed by backward recurrence using

for smaller values of , where when , when , and , , are the Bernoulli numbers.

When is large, the above procedure may be inefficient, and the expansion

which converges rapidly for large , is used instead.

References

NIST Digital Library of Mathematical Functions

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