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

Table of contents


NAME

psilnf, psiln, psilnl, psilnw, psilnq, psilnll, psilndf, psilnd, psilndl, psilndll - psi function minus natural (base-e) logarithm function

SYNOPSIS

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

#include <mathcw.h>

extern float psilnf (float x);

extern double psiln (double x);

extern long double psilnl (long double x);

extern __float80 psilnw (__float80 x);

extern __float128 psilnq (__float128 x);

extern long_long_double psilnll (long_long_double x);

extern decimal_float psilndf (decimal_float x);

extern decimal_double psilnd (decimal_double x);

extern decimal_long_double psilndl (decimal_long_double x);

extern decimal_long_long_double psilndll (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 minus the logarithm function.

The psi function is the logarithmic derivative of the gamma function:

psi(x) = (d/dx Gamma(x)) / Gamma(x) = d/dx (log Gamma(x))
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. The psiln(x) function handles the subtraction analytically, avoiding accuracy loss.

RETURN VALUES

Return the difference of the psi function of the argument and the logarithm 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), psi(3CW), tgamma(3CW).