Skip to main content

Special Functions

Erf(z:complex)

Evaluate to the error function of a complex number.

The error function is an odd function (

 \operatorname{erf} -z = -
\operatorname{erf} z
) that is used in statistics to calculate probabilities of normally distributed events.

The formula for the error function of a complex number is:

\operatorname{erf} z = \frac{2}{\sqrt{\pi}} \int_0^z e^{-t^2} dt

where z is a complex number.

Erfc(z:complex)

Evaluate to the complementary error function of a complex number.

It is defined as \operatorname{erfc} z = 1 - \operatorname {erf} z.

ErfInv(x:real)

Evaluate to the inverse error function of a real number -1 < x < 1

It is defined as

\operatorname{erf} \left(\operatorname{erf} ^{-1}x\right)
= x
.

Factorial(n)

n!
$$$n!$$
["Factorial", 5]
// -> 120

Factorial2(n)

The double factorial of n:

 n!! = n \cdot (n-2) \cdot (n-4) \times
\cdots
, that is the product of all the positive integers up to n that have the same parity (odd or even) as n.

n!!
$$$n!!$$
["Factorial2", 5]
// -> 15

It can also be written in terms of the \Gamma function:

n!! = 2^{\frac{n}{2}+\frac{1}{4}(1-\cos(\pi n))}\pi^{\frac{1}{4}(\cos(\pi
n)-1)}\Gamma\left(\frac{n}{2}+1\right)

This is not the same as the factorial of the factorial of n (i.e. ((n!)!)).

Reference

Gamma(z)

\\Gamma(n) = (n-1)!
$$$\\Gamma(n) = (n-1)!$$

The Gamma Function is an extension of the factorial function, with its argument shifted by 1, to real and complex numbers.

\operatorname{\Gamma}\left(z\right) = \int\limits_{0}^{\infty} t^{z-1}
\mathrm{e}^{-t} \, \mathrm{d}t
["Gamma", 5]
// 24

GammaLn(z)

\\ln(\\gamma(z))
$$$\\ln(\\gamma(z))$$

This function is called gammaln in MatLab and SciPy and LogGamma in Mathematica.