32 double kSqrt2 = 1.4142135623730950488016887242097;
33 double kPi = 3.14159265358979323846;
34 double kEulerGamma = 0.577215664901532860606512090082402431042;
79 double sum, factorial = 1,
n = 1;
80 double term = 1, x_factor = x * x * x * x * 0.0625;
85 factorial = 4 *
n *
n * (2 *
n - 1) * (2 *
n - 1);
86 term *= (-1) / factorial * x_factor;
94 double alpha = x / kSqrt2 - kPi / 8;
96 value *=
exp(x / kSqrt2) /
sqrt(2 * kPi * x);
138 double sum, factorial = 1,
n = 1;
139 double term = x * x * 0.25, x_factor = term * term;
144 factorial = 4 *
n *
n * (2 *
n + 1) * (2 *
n + 1);
145 term *= (-1) / factorial * x_factor;
153 double alpha = x / kSqrt2 - kPi / 8;
155 value *=
exp(x / kSqrt2) /
sqrt(2 * kPi * x);
202 double term = 1, x_factor = x * x * x * x * 0.0625;
203 double factorial = 1, harmonic = 0,
n = 1, sum;
205 if(x < 0) delta =
kPi;
210 factorial = 4 *
n *
n * (2 *
n - 1) * (2 *
n - 1);
211 term *= (-1) / factorial * x_factor;
212 harmonic += 1 / (2 * n - 1 ) + 1 / (2 * n);
213 sum += term * harmonic;
220 double beta = x / kSqrt2 + kPi / 8;
222 value *=
sqrt(kPi / (2 * x)) *
exp(- x / kSqrt2);
269 double term = x * x * 0.25, x_factor = term * term;
270 double factorial = 1, harmonic = 1,
n = 1, sum;
272 if(x < 0) delta =
kPi;
277 factorial = 4 *
n *
n * (2 *
n + 1) * (2 *
n + 1);
278 term *= (-1) / factorial * x_factor;
279 harmonic += 1 / (2 *
n) + 1 / (2 * n + 1);
280 sum += term * harmonic;
287 double beta = x / kSqrt2 + kPi / 8;
289 value *=
sqrt(kPi / (2 * x)) *
exp(- x / kSqrt2);
321 double sum, factorial = 1,
n = 1;
322 double term = - x * x * x * 0.0625, x_factor = - term *
x;
327 factorial = 4 *
n * (
n + 1) * (2 *
n + 1) * (2 *
n + 1);
328 term *= (-1) / factorial * x_factor;
336 else return (
M(x) *
sin(
Theta(x) - kPi / 4));
366 double sum, factorial = 1,
n = 1;
367 double term = x * 0.5, x_factor = x * x * x * x * 0.0625;
372 factorial = 4 *
n *
n * (2 *
n - 1) * (2 *
n + 1);
373 term *= (-1) * x_factor / factorial;
381 else return (
M(x) *
cos(
Theta(x) - kPi / 4));
411 double term = - x * x * x * 0.0625, x_factor = - term *
x;
412 double factorial = 1, harmonic = 1.5,
n = 1, sum;
414 if(x < 0) delta =
kPi;
419 factorial = 4 *
n * (
n + 1) * (2 *
n + 1) * (2 *
n + 1);
420 term *= (-1) / factorial * x_factor;
421 harmonic += 1 / (2 *
n + 1 ) + 1 / (2 *
n + 2);
422 sum += term * harmonic;
429 else return N(x) *
sin(
Phi(x) - kPi / 4);
459 double term = 0.5 *
x, x_factor = x * x * x * x * 0.0625;
460 double factorial = 1, harmonic = 1,
n = 1, sum;
462 if(x < 0) delta =
kPi;
467 factorial = 4 *
n *
n * (2 *
n - 1) * (2 *
n + 1);
468 term *= (-1) / factorial * x_factor;
469 harmonic += 1 / (2 *
n) + 1 / (2 * n + 1);
470 sum += term * harmonic;
477 else return N(x) *
cos(
Phi(x) - kPi / 4);
492 double prod = 1, x_factor = 8 *
x, factorial = 1,
n = 2;
494 sum = kSqrt2 / (16 *
x);
498 prod *= (2 *
n - 1) * (2 *
n - 1);
500 term = prod / (factorial * x_factor) *
cos(0.25 *
n * kPi);
521 double prod = 1, x_factor = 8 *
x, factorial = 1,
n = 2;
523 sum = kSqrt2 / (16 *
x);
527 prod *= (2 *
n - 1) * (2 *
n - 1);
529 term = (prod / (factorial * x_factor)) *
cos(0.25 *
n * kPi);
552 double prod = 1, x_factor = 8 *
x, factorial = 1,
n = 2;
554 sum = kSqrt2 / (16 *
x);
558 prod *= (2 *
n - 1) * (2 *
n - 1);
560 term = prod / (factorial * x_factor) *
sin(0.25 *
n * kPi);
579 double prod = 1, x_factor = 8 *
x, factorial = 1,
n = 2;
581 sum = kSqrt2 / (16 *
x);
585 prod *= (2 *
n - 1) * (2 *
n - 1);
587 term = prod / (factorial * x_factor) *
sin(0.25 *
n * kPi);
607 double value = 1 + 1 / (8 * kSqrt2 *
x) + 1 / (256 * x * x) - 399 / (6144 * kSqrt2 * x * x *
x);
608 value *=
exp(x / kSqrt2) /
sqrt(2 * kPi * x);
623 double value = x / kSqrt2 - kPi / 8;
624 value -= 1 / (8 * kSqrt2 *
x) + 1 / (16 * x * x) + 25 / (384 * kSqrt2 * x * x *
x);
639 double value = 1 - 1 / (8 * kSqrt2 *
x) + 1 / (256 * x * x) + 399 / (6144 * kSqrt2 * x * x *
x);
640 value *=
exp(- x / kSqrt2) *
sqrt(kPi / (2 * x));
655 double value = - x / kSqrt2 - kPi / 8;
656 value += 1 / (8 * kSqrt2 *
x) - 1 / (16 * x * x) + 25 / (384 * kSqrt2 * x * x *
x);
static double Ber(double x)
where x is real, and is the zeroth-order Bessel function of the first kind.
Namespace for new ROOT classes and functions.
static double DBei(double x)
Calculates the first derivative of Bei(x).
static const double kSqrt2
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
double beta(double x, double y)
Calculates the beta function.
static double F1(double x)
Utility function appearing in the calculations of the Kelvin functions Bei(x) and Ber(x) (and their d...
static double G1(double x)
Utility function appearing in the calculations of the Kelvin functions Bei(x) and Ber(x) (and their d...
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
static double Kei(double x)
where x is real, and is the zeroth-order modified Bessel function of the second kind...
static double DKer(double x)
Calculates the first derivative of Ker(x).
static double M(double x)
Utility function appearing in the asymptotic expansions of DBer(x) and DBei(x).
static double Bei(double x)
where x is real, and is the zeroth-order Bessel function of the first kind.
static double Theta(double x)
Utility function appearing in the asymptotic expansions of DBer(x) and DBei(x).
Namespace for new Math classes and functions.
static double G2(double x)
Utility function appearing in the calculations of the Kelvin functions Kei(x) and Ker(x) (and their d...
static double DBer(double x)
Calculates the first derivative of Ber(x).
static double Phi(double x)
Utility function appearing in the asymptotic expansions of DKer(x) and DKei(x).
static double Ker(double x)
where x is real, and is the zeroth-order modified Bessel function of the second kind...
static double DKei(double x)
Calculates the first derivative of Kei(x).
static double F2(double x)
Utility function appearing in the calculations of the Kelvin functions Kei(x) and Ker(x) (and their d...
static double N(double x)
Utility function appearing in the asymptotic expansions of DKer(x) and DKei(x).