Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:29:38

0001 // @(#)root/mathcore:$Id$
0002 // Authors: Andras Zsenei & Lorenzo Moneta   06/2005
0003 
0004 /**********************************************************************
0005  *                                                                    *
0006  * Copyright (c) 2005 , LCG ROOT MathLib Team                         *
0007  *                                                                    *
0008  *                                                                    *
0009  **********************************************************************/
0010 
0011 /**
0012 
0013 Special mathematical functions.
0014 The naming and numbering of the functions is taken from
0015 <A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1687.pdf">
0016 Matt Austern,
0017 (Draft) Technical Report on Standard Library Extensions,
0018 N1687=04-0127, September 10, 2004</A>
0019 
0020 @author Created by Andras Zsenei on Mon Nov 8 2004
0021 
0022 @defgroup SpecFunc Special functions
0023 @ingroup MathCore
0024 
0025 */
0026 
0027 #ifndef ROOT_Math_SpecFuncMathCore
0028 #define ROOT_Math_SpecFuncMathCore
0029 
0030 
0031 namespace ROOT {
0032 namespace Math {
0033 
0034 
0035    /** @name Special Functions from MathCore */
0036 
0037 
0038    /**
0039 
0040    Error function encountered in integrating the normal distribution.
0041 
0042    \f[ erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2} dt  \f]
0043 
0044    For detailed description see
0045    <A HREF="http://mathworld.wolfram.com/Erf.html">
0046    Mathworld</A>.
0047    The implementation used is that of
0048    <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_7.html#SEC102">GSL</A>.
0049    This function is provided only for convenience,
0050    in case your standard C++ implementation does not support
0051    it. If it does, please use these standard version!
0052 
0053    @ingroup SpecFunc
0054 
0055    */
0056    // (26.x.21.1) error function
0057 
0058    double erf(double x);
0059 
0060 
0061 
0062    /**
0063 
0064    Complementary error function.
0065 
0066    \f[ erfc(x) = 1 - erf(x) = \frac{2}{\sqrt{\pi}} \int_{x}^{\infty} e^{-t^2} dt  \f]
0067 
0068    For detailed description see <A HREF="http://mathworld.wolfram.com/Erfc.html"> Mathworld</A>.
0069    The implementation used is that of  <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
0070 
0071    @ingroup SpecFunc
0072 
0073    */
0074    // (26.x.21.2) complementary error function
0075 
0076    double erfc(double x);
0077 
0078 
0079    /**
0080 
0081    The gamma function is defined to be the extension of the
0082    factorial to real numbers.
0083 
0084    \f[ \Gamma(x) = \int_{0}^{\infty} t^{x-1} e^{-t} dt  \f]
0085 
0086    For detailed description see
0087    <A HREF="http://mathworld.wolfram.com/GammaFunction.html">
0088    Mathworld</A>.
0089    The implementation used is that of  <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
0090 
0091    @ingroup SpecFunc
0092 
0093    */
0094    // (26.x.18) gamma function
0095 
0096    double tgamma(double x);
0097 
0098 
0099    /**
0100 
0101    Calculates the logarithm of the gamma function
0102 
0103    The implementation used is that of  <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
0104    @ingroup SpecFunc
0105 
0106    */
0107    double lgamma(double x);
0108 
0109 
0110    /**
0111       Calculates the normalized (regularized) lower incomplete gamma function (lower integral)
0112 
0113       \f[ P(a, x) = \frac{ 1} {\Gamma(a) } \int_{0}^{x} t^{a-1} e^{-t} dt  \f]
0114 
0115 
0116       For a detailed description see
0117       <A HREF="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
0118       Mathworld</A>.
0119       The implementation used is that of  <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
0120       In this implementation both a and x must be positive. If a is negative 1.0 is returned for every x.
0121       This is correct only if a is negative integer.
0122       For a>0 and x<0  0 is returned (this is correct only for a>0 and x=0).
0123 
0124       @ingroup SpecFunc
0125    */
0126    double inc_gamma(double a, double x );
0127 
0128    /**
0129       Calculates the normalized (regularized) upper incomplete gamma function (upper integral)
0130 
0131       \f[ Q(a, x) = \frac{ 1} {\Gamma(a) } \int_{x}^{\infty} t^{a-1} e^{-t} dt  \f]
0132 
0133 
0134       For a detailed description see
0135       <A HREF="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
0136       Mathworld</A>.
0137       The implementation used is that of  <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
0138       In this implementation both a and x must be positive. If a is negative, 0 is returned for every x.
0139       This is correct only if a is negative integer.
0140       For a>0 and x<0  1 is returned (this is correct only for a>0 and x=0).
0141 
0142       @ingroup SpecFunc
0143    */
0144    double inc_gamma_c(double a, double x );
0145 
0146    /**
0147 
0148    Calculates the beta function.
0149 
0150    \f[ B(x,y) = \frac{\Gamma(x) \Gamma(y)}{\Gamma(x+y)} \f]
0151 
0152    for x>0 and y>0. For detailed description see
0153    <A HREF="http://mathworld.wolfram.com/BetaDistribution.html">
0154    Mathworld</A>.
0155 
0156    @ingroup SpecFunc
0157 
0158    */
0159    // [5.2.1.3] beta function
0160 
0161    double beta(double x, double y);
0162 
0163 
0164    /**
0165 
0166    Calculates the normalized (regularized) incomplete beta function.
0167 
0168    \f[ B(x, a, b ) =  \frac{ \int_{0}^{x} u^{a-1} (1-u)^{b-1} du } { B(a,b) } \f]
0169 
0170    for 0<=x<=1,  a>0,  and b>0. For detailed description see
0171    <A HREF="http://mathworld.wolfram.com/RegularizedBetaFunction.html">
0172    Mathworld</A>.
0173    The implementation used is that of  <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
0174 
0175    @ingroup SpecFunc
0176 
0177    */
0178 
0179    double inc_beta( double x, double a, double b);
0180 
0181 
0182 
0183 
0184   /**
0185 
0186   Calculates the sine integral.
0187 
0188   \f[ Si(x) = - \int_{0}^{x} \frac{\sin t}{t} dt \f]
0189 
0190   For detailed description see
0191   <A HREF="http://mathworld.wolfram.com/SineIntegral.html">
0192   Mathworld</A>. The implementation used is that of
0193   <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/c336/top.html">
0194   CERNLIB</A>,
0195   based on Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York l969) 325-326.
0196 
0197 
0198   @ingroup SpecFunc
0199 
0200   */
0201 
0202   double sinint(double x);
0203 
0204 
0205 
0206 
0207   /**
0208 
0209   Calculates the real part of the cosine integral Re(Ci).
0210 
0211   For x<0, the imaginary part is \f$\pi i\f$ and has to be added by the user,
0212   for x>0 the imaginary part of Ci(x) is 0.
0213 
0214   \f[ Ci(x) = - \int_{x}^{\infty} \frac{\cos t}{t} dt = \gamma + \ln x + \int_{0}^{x} \frac{\cos t - 1}{t} dt\f]
0215 
0216   For detailed description see
0217   <A HREF="http://mathworld.wolfram.com/CosineIntegral.html">
0218   Mathworld</A>. The implementation used is that of
0219   <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/c336/top.html">
0220   CERNLIB</A>,
0221   based on Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York l969) 325-326.
0222 
0223 
0224   @ingroup SpecFunc
0225 
0226   */
0227 
0228   double cosint(double x);
0229 
0230 
0231 
0232 
0233 } // namespace Math
0234 } // namespace ROOT
0235 
0236 
0237 #endif // ROOT_Math_SpecFuncMathCore