63 const double x = r /
S;
64 constexpr double two_over_sqrtpi = 1.1283791670955126;
68 const double x2 = x * x;
69 const double s1 = two_over_sqrtpi /
S;
71 (1.0 + x2 * (-1.0 / 3.0 +
72 x2 * (1.0 / 10.0 + x2 * (-1.0 / 42.0 + x2 / 216.0))));
73 const double s3 = s1 / (
S *
S);
74 B1 = s3 * (2.0 / 3.0 +
76 x2 * (1.0 / 7.0 + x2 * (-1.0 / 27.0 + x2 / 132.0))));
77 const double s5 = s3 / (
S *
S);
78 B2 = s5 * (4.0 / 5.0 +
80 x2 * (2.0 / 9.0 + x2 * (-2.0 / 33.0 + x2 / 78.0))));
83 const double g = std::exp(-x * x);
85 const double r2 = r * r;
86 B1 = (
B0 - two_over_sqrtpi * g /
S) / r2;
87 B2 = (3.0 *
B1 - 2.0 * two_over_sqrtpi * g / (
S *
S *
S)) / r2;