Functions

Here the Special Functions are listed according to the structure of NIST Digital Library of Mathematical Functions.

Gamma Function

FunctionDescription
gamma(z)gamma function $\Gamma(z)$
digamma(x)digamma function (i.e. the derivative of lgamma at x)
invdigamma(x)invdigamma function (i.e. inverse of digamma function at x using fixed-point iteration algorithm)
trigamma(x)trigamma function (i.e the logarithmic second derivative of gamma at x)
polygamma(m,x)polygamma function (i.e the (m+1)-th derivative of the lgamma function at x)
gamma_inc(a,x,IND)incomplete gamma function ratio P(a,x) and Q(a,x) (i.e evaluates P(a,x) and Q(a,x)for accuracy specified by IND and returns tuple (p,q))
beta_inc(a,b,x,y)incomplete beta function ratio Ix(a,b) and Iy(a,b) (i.e evaluates Ix(a,b) and Iy(a,b) and returns tuple (p,q))
gamma_inc_inv(a,p,q)inverse of incomplete gamma function ratio P(a,x) and Q(a,x) (i.e evaluates x given P(a,x)=p and Q(a,x)=q
loggamma(x)accurate log(gamma(x)) for large x
logabsgamma(x)accurate log(abs(gamma(x))) for large x
lgamma(x)accurate log(gamma(x)) for large x
logfactorial(x)accurate log(factorial(x)) for large x; same as lgamma(x+1) for x > 1, zero otherwise
beta(x,y)beta function at x,y
logbeta(x,y)accurate log(beta(x,y)) for large x or y
logabsbeta(x,y)accurate log(abs(beta(x,y))) for large x or y
logabsbinomial(x,y)accurate log(abs(beta(x,y))) for large x or y

Trigonometric Integrals

FunctionDescription
sinint(x)sine integral $Si(x)$
cosint(x)cosine integral $Ci(x)$

Error Functions, Dawson’s and Fresnel Integrals

FunctionDescription
erf(x)error function at $x$
erfc(x)complementary error function, i.e. the accurate version of $1-\operatorname{erf}(x)$ for large $x$
erfcinv(x)inverse function to erfc()
erfcx(x)scaled complementary error function, i.e. accurate $e^{x^2} \operatorname{erfc}(x)$ for large $x$
logerfc(x)log of the complementary error function, i.e. accurate $\operatorname{ln}(\operatorname{erfc}(x))$ for large $x$
logerfcx(x)log of the scaled complementary error function, i.e. accurate $\operatorname{ln}(\operatorname{erfcx}(x))$ for large negative $x$
erfi(x)imaginary error function defined as $-i \operatorname{erf}(ix)$
erfinv(x)inverse function to erf()
dawson(x)scaled imaginary error function, a.k.a. Dawson function, i.e. accurate $\frac{\sqrt{\pi}}{2} e^{-x^2} \operatorname{erfi}(x)$ for large $x$
FunctionDescription
airyai(z)Airy Ai function at z
airyaiprime(z)derivative of the Airy Ai function at z
airybi(z)Airy Bi function at z
airybiprime(z)derivative of the Airy Bi function at z
airyaix(z), airyaiprimex(z), airybix(z), airybiprimex(z)scaled Airy Ai function and kth derivatives at z

Bessel Functions

FunctionDescription
besselj(nu,z)Bessel function of the first kind of order nu at z
besselj0(z)besselj(0,z)
besselj1(z)besselj(1,z)
besseljx(nu,z)scaled Bessel function of the first kind of order nu at z
bessely(nu,z)Bessel function of the second kind of order nu at z
bessely0(z)bessely(0,z)
bessely1(z)bessely(1,z)
besselyx(nu,z)scaled Bessel function of the second kind of order nu at z
besselh(nu,k,z)Bessel function of the third kind (a.k.a. Hankel function) of order nu at z; k must be either 1 or 2
hankelh1(nu,z)besselh(nu, 1, z)
hankelh1x(nu,z)scaled besselh(nu, 1, z)
hankelh2(nu,z)besselh(nu, 2, z)
hankelh2x(nu,z)scaled besselh(nu, 2, z)
besseli(nu,z)modified Bessel function of the first kind of order nu at z
besselix(nu,z)scaled modified Bessel function of the first kind of order nu at z
besselk(nu,z)modified Bessel function of the second kind of order nu at z
besselkx(nu,z)scaled modified Bessel function of the second kind of order nu at z

Elliptic Integrals

FunctionDescription
ellipk(m)complete elliptic integral of 1st kind $K(m)$
ellipe(m)complete elliptic integral of 2nd kind $E(m)$
FunctionDescription
eta(x)Dirichlet eta function at x
zeta(x)Riemann zeta function at x