Functions | |
double | bessi1 (double x) |
double | bessk1 (double x) |
double | beta (double a, double b) |
double | beta (double x, double a, double b) |
double | betaRegularized (double x, double a, double b) |
double | dawson (double x) |
double | DebyeD (int n, double x) |
double | EllipticE (double k) |
double | EllipticE (double x, double k) |
double | EllipticF (double x, double k) |
double | EllipticK (double k) |
double | EllipticPi (double nu, double k) |
double | EllipticPi (double x, double nu, double k) |
double | functionX (double s) |
double | gamma (double a) |
double | gexp (double p, double x) |
double | gln (double p, double x) |
double | gln2 (double p, double x1, double x2) |
double | incompleteGamma (double a, double x) |
double | LambertW (double z) |
double | LambertW1 (double z) |
double | lngamma (double a) |
double | lnmean (double x1, double x2) |
double | lnmean (double x1, double x2, double lnx1, double lnx2) |
double | rc (double x, double y) |
double | rd (double x, double y, double z) |
double | rf (double x, double y, double z) |
double | rj (double x, double y, double z, double p) |
This namespace contains a number of special mathematical functions. It includes the usual mathematical special functions such as the gamma function and elliptic integrals, but also a number of specific functions that often occur in the program. Many functions are copied or adapted from the famous Numerical Recipes books. The version used is the second edition of Numerical Recipes in C++ (Press et al. 2002). Other functions are taken from the web or are just implemented ad hoc.
double SpecialFunctions::bessi1 | ( | double | x | ) |
This function returns the modified Bessel function
double SpecialFunctions::bessk1 | ( | double | x | ) |
This function returns the modified Bessel function
double SpecialFunctions::beta | ( | double | a, |
double | b | ||
) |
This function returns the complete Beta function
with the two parameters
double SpecialFunctions::beta | ( | double | x, |
double | a, | ||
double | b | ||
) |
This function returns the incomplete Beta function
with the parameters
double SpecialFunctions::betaRegularized | ( | double | x, |
double | a, | ||
double | b | ||
) |
This function returns the regularized incomplete Beta function
with the parameters
double SpecialFunctions::dawson | ( | double | x | ) |
Dawson's integral, defined as
The implementation is based on the series
which guarantees an exponential increase in accuracy. The implementation is adapted from Numerical Recipes, where additional tricks are included to make the computation even faster.
double SpecialFunctions::DebyeD | ( | int | n, |
double | x | ||
) |
This function returns the Debye function of order
The order
double SpecialFunctions::EllipticE | ( | double | k | ) |
This function returns the complete elliptic integral of the second kind, defined as
where
double SpecialFunctions::EllipticE | ( | double | x, |
double | k | ||
) |
This function returns the incomplete elliptic integral of the second kind, defined as
The arguments must satisfy
It is important to note that different incompatible argument conventions are being used for the elliptic integrals. Instead of the coordinate
double SpecialFunctions::EllipticF | ( | double | x, |
double | k | ||
) |
This function returns the incomplete elliptic integral of the first kind, defined as
The arguments must satisfy
It is important to note that different incompatible argument conventions are being used for the elliptic integrals. Instead of the coordinate
double SpecialFunctions::EllipticK | ( | double | k | ) |
This function returns the complete elliptic integral of the first kind, defined as
where
double SpecialFunctions::EllipticPi | ( | double | nu, |
double | k | ||
) |
This function returns the complete elliptic integral of the third kind, defined as
where
double SpecialFunctions::EllipticPi | ( | double | x, |
double | nu, | ||
double | k | ||
) |
This function returns the incomplete elliptic integral of the third kind, defined as
The arguments must satisfy
It is important to note that different incompatible argument conventions are being used for the elliptic integrals. Instead of the coordinate
double SpecialFunctions::functionX | ( | double | s | ) |
This function returns the value of the function defined as
This function is completely smooth (it is the same function if one considers it in the complex plane).
double SpecialFunctions::gamma | ( | double | a | ) |
This function returns the Gamma function
double SpecialFunctions::gexp | ( | double | p, |
double | x | ||
) |
This function returns a generalized exponential function
When
double SpecialFunctions::gln | ( | double | p, |
double | x | ||
) |
This function returns a generalized logarithmic function
This function is included in this library of special functions because the power law expression diverges as
double SpecialFunctions::gln2 | ( | double | p, |
double | x1, | ||
double | x2 | ||
) |
This function returns the difference between two values of the generalized logarithmic function
double SpecialFunctions::incompleteGamma | ( | double | a, |
double | x | ||
) |
This function returns the (regularized) incomplete gamma function
The implementation is adapted from the Numerical Recipes book.
double SpecialFunctions::LambertW | ( | double | z | ) |
This function is the Lambert
For real
has two real solutions, one smaller than and one greater than LambertW
or in Mathematica on the command ProductLog
. The adopted implementation for the function
double SpecialFunctions::LambertW1 | ( | double | z | ) |
This function is the Lambert
For real
has two real solutions, one smaller than and one greater than LambertW
or in Mathematica on the command ProductLog
. The adopted implementation for the function
double SpecialFunctions::lngamma | ( | double | a | ) |
This function returns the logarithm of the Gamma function, i.e.
double SpecialFunctions::lnmean | ( | double | x1, |
double | x2 | ||
) |
This function returns the logarithmic mean
The function is invariant for swapping of it arguments, and it can be proven that the logarithmic mean lies between the geometric mean and the arithmetic mean,
where the equality realizes for
The function is implemented here because the quotient becomes numerically unstable when
double SpecialFunctions::lnmean | ( | double | x1, |
double | x2, | ||
double | lnx1, | ||
double | lnx2 | ||
) |
This function returns the logarithmic mean of two values as described for the two-argument lnmean() function in this class, given also the natural logarithm of these two values. In cases where these logarithms are available at the call site anyway, this function is more efficient than its two-argument equivalent.
double SpecialFunctions::rc | ( | double | x, |
double | y | ||
) |
This function returns Carlson's degenerate elliptic integral
Here
double SpecialFunctions::rd | ( | double | x, |
double | y, | ||
double | z | ||
) |
This function returns Carlson's elliptic integral
The first two arguments
double SpecialFunctions::rf | ( | double | x, |
double | y, | ||
double | z | ||
) |
This function returns Carlson's elliptic integral
The three arguments
double SpecialFunctions::rj | ( | double | x, |
double | y, | ||
double | z, | ||
double | p | ||
) |
This function returns Carlson's elliptic integral
The first three arguments