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