#include <cmath>
Go to the source code of this file.
|
| template<class T > |
| T | erf (const T &rhs) |
| |
| template<class T > |
| T | erf_0_ (int n, const T &rhs) |
| |
| template<class T > |
| T | erfc (const T &rhs) |
| |
◆ erf()
Error function. \begin{displaymath} \textrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int^x_0 e^{-t^2} dt \end{displaymath}
- Author
- T. Glebe
T erf_0_(int n, const T &rhs)
Definition: Erf.hh:33
◆ erf_0_()
template<class T >
| T erf_0_ |
( |
int |
n, |
|
|
const T & |
rhs |
|
) |
| |
erf_0_. Routine which does the basic work.
- Author
- T. Glebe
36 static const T p10 = 3.6767877;
37 static const T q10 = 3.2584593;
38 static const T p11 = -.097970465;
39 static const T p2[5] = { 7.3738883,6.8650185,3.0317993,.56316962,4.3187787e-5 };
40 static const T q2[5] = { 7.3739609,15.184908,12.79553,5.3542168,1. };
41 static const T p30 = -.12436854;
42 static const T q30 = .44091706;
43 static const T p31 = -.096821036;
63 const T v =
fabs(rhs);
68 h = rhs * (p10 + p11 * v2) / (q10 + v2);
74 for (i = 3; i >= 0; --i) {
79 hc = exp(-v2) * ap / aq;
85 hc = exp(-v2) * (y * (p30 + p31 * y) / (q30 + y) + .56418958) / v;
Expr< UnaryOp< Fabs< T >, Expr< A, T, D >, T >, T, D > fabs(const Expr< A, T, D > &rhs)
Definition: UnaryOperators.hh:96
◆ erfc()
Error function. \begin{displaymath} \textrm{erfc}(x) = \frac{2}{\sqrt{\pi}} \int^\infty_x e^{-t^2} dt \end{displaymath}
- Author
- T. Glebe