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
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)
["Factorial", 5]
// -> 120
Factorial2(n)
The double factorial of n
:
n!! = n \cdot (n-2) \cdot (n-4) \times
\cdots
n
that have
the same parity (odd or even) as 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
- WikiPedia: Double Factorial
Gamma(z)
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
- Wikidata: Q190573
- NIST: http://dlmf.nist.gov/5.2.E1
["Gamma", 5]
// 24
GammaLn(z)
This function is called gammaln
in MatLab and SciPy and LogGamma
in
Mathematica.