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