PSI 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

psif, psi, psil, psiw, psiq, psill, psidf, psid, psidl, psidll - psi function

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float psif (float x);

extern double psi (double x);

extern long double psil (long double x);

extern __float80 psiw (__float80 x);

extern __float128 psiq (__float128 x);

extern long_long_double psill (long_long_double x);

extern decimal_float psidf (decimal_float x);

extern decimal_double psid (decimal_double x);

extern decimal_long_double psidl (decimal_long_double x);

extern decimal_long_long_double psidll (decimal_long_long_double x);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the psi function, the logarithmic derivative of the gamma function:
psi(x) = (d/dx Gamma(x)) / Gamma(x) = d/dx (log Gamma(x))

Caution: For positive arguments of even modest size, psi(x) approaches log(x) fairly rapidly, so that psi(x) - log(x) suffers loss of leading significant digits. When you need that expression, use the companion function psiln(x) instead.


RETURN VALUES

Return the psi function of the argument.

ERRORS

If the argument is +Infinity or -Infinity, return that argument and set errno to ERANGE. If the argument is a NaN, return that NaN and set errno to EDOM. If the argument is zero or a negative integral value, return a quiet NaN and set errno to EDOM.

SEE ALSO

lgamma(3CW), lgamma_r(3CW), log(3CW), psiln(3CW), tgamma(3CW).