BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Special functions

Description

Special mathematical functions. The naming and numbering of the functions is taken from Matt Austern, (Draft) Technical Report on Standard Library Extensions, N1687=04-0127, September 10, 2004

Author
Created by Andras Zsenei on Mon Nov 8 2004

Special Functions from MathCore

double ROOT::Math::erf (double x)
 
double ROOT::Math::erfc (double x)
 
double ROOT::Math::tgamma (double x)
 
double ROOT::Math::lgamma (double x)
 
double ROOT::Math::inc_gamma (double a, double x)
 
double ROOT::Math::inc_gamma_c (double a, double x)
 
double ROOT::Math::beta (double x, double y)
 
double ROOT::Math::inc_beta (double x, double a, double b)
 
double ROOT::Math::sinint (double x)
 
double ROOT::Math::cosint (double x)
 

Function Documentation

◆ beta()

double ROOT::Math::beta ( double  x,
double  y 
)

Calculates the beta function.

\[ B(x,y) = \frac{\Gamma(x) \Gamma(y)}{\Gamma(x+y)} \]

for x>0 and y>0. For detailed description see Mathworld.

◆ cosint()

double ROOT::Math::cosint ( double  x)

Calculates the real part of the cosine integral Re(Ci).

For x<0, the imaginary part is \pi i and has to be added by the user, for x>0 the imaginary part of Ci(x) is 0.

\[ Ci(x) = - \int_{x}^{\infty} \frac{\cos t}{t} dt = \gamma + \ln x + \int_{0}^{x} \frac{\cos t - 1}{t} dt\]

For detailed description see Mathworld. The implementation used is that of CERNLIB, based on Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York l969) 325-326.

◆ erf()

double ROOT::Math::erf ( double  x)

Error function encountered in integrating the normal distribution.

\[ erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2} dt \]

For detailed description see Mathworld. The implementation used is that of GSL. This function is provided only for convenience, in case your standard C++ implementation does not support it. If it does, please use these standard version!

◆ erfc()

double ROOT::Math::erfc ( double  x)

Complementary error function.

\[ erfc(x) = 1 - erf(x) = \frac{2}{\sqrt{\pi}} \int_{x}^{\infty} e^{-t^2} dt \]

For detailed description see Mathworld. The implementation used is that of Cephes from S. Moshier.

◆ inc_beta()

double ROOT::Math::inc_beta ( double  x,
double  a,
double  b 
)

Calculates the normalized (regularized) incomplete beta function.

\[ B(x, a, b ) = \frac{ \int_{0}^{x} u^{a-1} (1-u)^{b-1} du } { B(a,b) } \]

for 0<=x<=1, a>0, and b>0. For detailed description see Mathworld. The implementation used is that of Cephes from S. Moshier.

◆ inc_gamma()

double ROOT::Math::inc_gamma ( double  a,
double  x 
)

Calculates the normalized (regularized) lower incomplete gamma function (lower integral)

\[ P(a, x) = \frac{ 1} {\Gamma(a) } \int_{0}^{x} t^{a-1} e^{-t} dt \]

For a detailed description see Mathworld. The implementation used is that of Cephes from S. Moshier. In this implementation both a and x must be positive. If a is negative 1.0 is returned for every x. This is correct only if a is negative integer. For a>0 and x<0 0 is returned (this is correct only for a>0 and x=0).

◆ inc_gamma_c()

double ROOT::Math::inc_gamma_c ( double  a,
double  x 
)

Calculates the normalized (regularized) upper incomplete gamma function (upper integral)

\[ Q(a, x) = \frac{ 1} {\Gamma(a) } \int_{x}^{\infty} t^{a-1} e^{-t} dt \]

For a detailed description see Mathworld. The implementation used is that of Cephes from S. Moshier. In this implementation both a and x must be positive. If a is negative, 0 is returned for every x. This is correct only if a is negative integer. For a>0 and x<0 1 is returned (this is correct only for a>0 and x=0).

◆ lgamma()

double ROOT::Math::lgamma ( double  x)

Calculates the logarithm of the gamma function

The implementation used is that of Cephes from S. Moshier.

◆ sinint()

double ROOT::Math::sinint ( double  x)

Calculates the sine integral.

\[ Si(x) = - \int_{0}^{x} \frac{\sin t}{t} dt \]

For detailed description see Mathworld. The implementation used is that of CERNLIB, based on Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York l969) 325-326.

◆ tgamma()

double ROOT::Math::tgamma ( double  x)

The gamma function is defined to be the extension of the factorial to real numbers.

\[ \Gamma(x) = \int_{0}^{\infty} t^{x-1} e^{-t} dt \]

For detailed description see Mathworld. The implementation used is that of Cephes from S. Moshier.