These are some more exotic mathematical functions which are sometimes useful. Currently they only have real-valued versions.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
erfreturns the error function of x. The error function is defined aserf (x) = 2/sqrt(pi) * integral from 0 to x of exp(-t^2) dt
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
erfcreturns1.0 - erf(x), but computed in a fashion that avoids round-off error when x is large.
Preliminary: | MT-Unsafe race:signgam | AS-Unsafe | AC-Safe | See POSIX Safety Concepts.
lgammareturns the natural logarithm of the absolute value of the gamma function of x. The gamma function is defined asgamma (x) = integral from 0 to ∞ of t^(x-1) e^-t dtThe sign of the gamma function is stored in the global variable signgam, which is declared in math.h. It is
1if the intermediate result was positive or zero, or-1if it was negative.To compute the real gamma function you can use the
tgammafunction or you can compute the values as follows:lgam = lgamma(x); gam = signgam*exp(lgam);The gamma function has singularities at the non-positive integers.
lgammawill raise the zero divide exception if evaluated at a singularity.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
lgamma_ris just likelgamma, but it stores the sign of the intermediate result in the variable pointed to by signp instead of in the signgam global. This means it is reentrant.The
lgammafN_randlgammafNx_rfunctions are GNU extensions.
Preliminary: | MT-Unsafe race:signgam | AS-Unsafe | AC-Safe | See POSIX Safety Concepts.
These functions exist for compatibility reasons. They are equivalent to
lgammaetc. It is better to uselgammasince for one the name reflects better the actual computation, and moreoverlgammais standardized in ISO C99 whilegammais not.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
tgammaapplies the gamma function to x. The gamma function is defined asgamma (x) = integral from 0 to ∞ of t^(x-1) e^-t dtThis function was introduced in ISO C99. The
_FloatN and_FloatNxvariants were introduced in ISO/IEC TS 18661-3.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
j0returns the Bessel function of the first kind of order 0 of x. It may signal underflow if x is too large.The
_FloatN and_FloatNxvariants are GNU extensions.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
j1returns the Bessel function of the first kind of order 1 of x. It may signal underflow if x is too large.The
_FloatN and_FloatNxvariants are GNU extensions.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
jnreturns the Bessel function of the first kind of order n of x. It may signal underflow if x is too large.The
_FloatN and_FloatNxvariants are GNU extensions.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
y0returns the Bessel function of the second kind of order 0 of x. It may signal underflow if x is too large. If x is negative,y0signals a domain error; if it is zero,y0signals overflow and returns -∞.The
_FloatN and_FloatNxvariants are GNU extensions.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
y1returns the Bessel function of the second kind of order 1 of x. It may signal underflow if x is too large. If x is negative,y1signals a domain error; if it is zero,y1signals overflow and returns -∞.The
_FloatN and_FloatNxvariants are GNU extensions.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
ynreturns the Bessel function of the second kind of order n of x. It may signal underflow if x is too large. If x is negative,ynsignals a domain error; if it is zero,ynsignals overflow and returns -∞.The
_FloatN and_FloatNxvariants are GNU extensions.