Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
SpecFuncMathCore.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Authors: Andras Zsenei & Lorenzo Moneta 06/2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 , LCG ROOT MathLib Team *
7  * *
8  * *
9  **********************************************************************/
10 
11 
12 
13 /**
14 
15 Special mathematical functions.
16 The naming and numbering of the functions is taken from
17 <A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1687.pdf">
18 Matt Austern,
19 (Draft) Technical Report on Standard Library Extensions,
20 N1687=04-0127, September 10, 2004</A>
21 
22 @author Created by Andras Zsenei on Mon Nov 8 2004
23 
24 @defgroup SpecFunc Special functions
25 @ingroup MathCore
26 @ingroup MathMore
27 
28 */
29 
30 #ifndef ROOT_Math_SpecFuncMathCore
31 #define ROOT_Math_SpecFuncMathCore
32 
33 
34 namespace ROOT {
35 namespace Math {
36 
37 
38  /** @name Special Functions from MathCore */
39 
40 
41  /**
42 
43  Error function encountered in integrating the normal distribution.
44 
45  \f[ erf(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^2} dt \f]
46 
47  For detailed description see
48  <A HREF="http://mathworld.wolfram.com/Erf.html">
49  Mathworld</A>.
50  The implementation used is that of
51  <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_7.html#SEC102">GSL</A>.
52  This function is provided only for convenience,
53  in case your standard C++ implementation does not support
54  it. If it does, please use these standard version!
55 
56  @ingroup SpecFunc
57 
58  */
59  // (26.x.21.1) error function
60 
61  double erf(double x);
62 
63 
64 
65  /**
66 
67  Complementary error function.
68 
69  \f[ erfc(x) = 1 - erf(x) = \frac{2}{\sqrt{\pi}} \int_{x}^{\infty} e^{-t^2} dt \f]
70 
71  For detailed description see <A HREF="http://mathworld.wolfram.com/Erfc.html"> Mathworld</A>.
72  The implementation used is that of <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
73 
74  @ingroup SpecFunc
75 
76  */
77  // (26.x.21.2) complementary error function
78 
79  double erfc(double x);
80 
81 
82  /**
83 
84  The gamma function is defined to be the extension of the
85  factorial to real numbers.
86 
87  \f[ \Gamma(x) = \int_{0}^{\infty} t^{x-1} e^{-t} dt \f]
88 
89  For detailed description see
90  <A HREF="http://mathworld.wolfram.com/GammaFunction.html">
91  Mathworld</A>.
92  The implementation used is that of <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
93 
94  @ingroup SpecFunc
95 
96  */
97  // (26.x.18) gamma function
98 
99  double tgamma(double x);
100 
101 
102  /**
103 
104  Calculates the logarithm of the gamma function
105 
106  The implementation used is that of <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
107  @ingroup SpecFunc
108 
109  */
110  double lgamma(double x);
111 
112 
113  /**
114  Calculates the normalized (regularized) lower incomplete gamma function (lower integral)
115 
116  \f[ P(a, x) = \frac{ 1} {\Gamma(a) } \int_{0}^{x} t^{a-1} e^{-t} dt \f]
117 
118 
119  For a detailed description see
120  <A HREF="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
121  Mathworld</A>.
122  The implementation used is that of <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
123  In this implementation both a and x must be positive. If a is negative 1.0 is returned for every x.
124  This is correct only if a is negative integer.
125  For a>0 and x<0 0 is returned (this is correct only for a>0 and x=0).
126 
127  @ingroup SpecFunc
128  */
129  double inc_gamma(double a, double x );
130 
131  /**
132  Calculates the normalized (regularized) upper incomplete gamma function (upper integral)
133 
134  \f[ Q(a, x) = \frac{ 1} {\Gamma(a) } \int_{x}^{\infty} t^{a-1} e^{-t} dt \f]
135 
136 
137  For a detailed description see
138  <A HREF="http://mathworld.wolfram.com/RegularizedGammaFunction.html">
139  Mathworld</A>.
140  The implementation used is that of <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
141  In this implementation both a and x must be positive. If a is negative, 0 is returned for every x.
142  This is correct only if a is negative integer.
143  For a>0 and x<0 1 is returned (this is correct only for a>0 and x=0).
144 
145  @ingroup SpecFunc
146  */
147  double inc_gamma_c(double a, double x );
148 
149  /**
150 
151  Calculates the beta function.
152 
153  \f[ B(x,y) = \frac{\Gamma(x) \Gamma(y)}{\Gamma(x+y)} \f]
154 
155  for x>0 and y>0. For detailed description see
156  <A HREF="http://mathworld.wolfram.com/BetaDistribution.html">
157  Mathworld</A>.
158 
159  @ingroup SpecFunc
160 
161  */
162  // [5.2.1.3] beta function
163 
164  double beta(double x, double y);
165 
166 
167  /**
168 
169  Calculates the normalized (regularized) incomplete beta function.
170 
171  \f[ B(x, a, b ) = \frac{ \int_{0}^{x} u^{a-1} (1-u)^{b-1} du } { B(a,b) } \f]
172 
173  for 0<=x<=1, a>0, and b>0. For detailed description see
174  <A HREF="http://mathworld.wolfram.com/RegularizedBetaFunction.html">
175  Mathworld</A>.
176  The implementation used is that of <A HREF="http://www.netlib.org/cephes">Cephes</A> from S. Moshier.
177 
178  @ingroup SpecFunc
179 
180  */
181 
182  double inc_beta( double x, double a, double b);
183 
184 
185 
186 
187  /**
188 
189  Calculates the sine integral.
190 
191  \f[ Si(x) = - \int_{0}^{x} \frac{\sin t}{t} dt \f]
192 
193  For detailed description see
194  <A HREF="http://mathworld.wolfram.com/SineIntegral.html">
195  Mathworld</A>. The implementation used is that of
196  <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/c336/top.html">
197  CERNLIB</A>,
198  based on Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York l969) 325-326.
199 
200 
201  @ingroup SpecFunc
202 
203  */
204 
205  double sinint(double x);
206 
207 
208 
209 
210  /**
211 
212  Calculates the real part of the cosine integral Re(Ci).
213 
214  For x<0, the imaginary part is \pi i and has to be added by the user,
215  for x>0 the imaginary part of Ci(x) is 0.
216 
217  \f[ Ci(x) = - \int_{x}^{\infty} \frac{\cos t}{t} dt = \gamma + \ln x + \int_{0}^{x} \frac{\cos t - 1}{t} dt\f]
218 
219  For detailed description see
220  <A HREF="http://mathworld.wolfram.com/CosineIntegral.html">
221  Mathworld</A>. The implementation used is that of
222  <A HREF="https://cern-tex.web.cern.ch/cern-tex/shortwrupsdir/c336/top.html">
223  CERNLIB</A>,
224  based on Y.L. Luke, The special functions and their approximations, v.II, (Academic Press, New York l969) 325-326.
225 
226 
227  @ingroup SpecFunc
228 
229  */
230 
231  double cosint(double x);
232 
233 
234 
235 
236 } // namespace Math
237 } // namespace ROOT
238 
239 
240 #endif // ROOT_Math_SpecFuncMathCore