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