Evaluates the derivative of the log gamma function.
#include <imsl.h>
float imsl_f_psi (float x)
The type double function is imsl_d_psi.
float x
(Input)
Argument at which the function is to be evaluated.
The value of the derivative of the log gamma function at x. NaN is returned if an error occurs.
The psi function, also called the digamma function, is defined to be

See imsl_f_gamma for the definition of Γ(x).
The argument x
must not be exactly zero or a negative integer, or
is undefined. Also, x
must not be too close to a negative integer such that the accuracy of the result
is less than half precision. If no value can be computed, then NaN is
returned.
In this example,
is evaluated.
#include <imsl.h>
#include <stdio.h>
int main(){
float x=1.915, ans;
ans=imsl_f_psi(x);
printf("psi(%f) = %f\n", x, ans);
}
psi(1.915000) = 0.366452
IMSL_NEAR_NEG_INT_WARN The result is accurate to less than one-half precision because “x” is too close to a negative integer.