pub fn erf(x: f64) -> f64Expand description
The error function $\operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} e^{-t^{2}}, dt$: its Maclaurin series $\frac{2}{\sqrt{\pi}} \sum_{k} \frac{(-1)^{k} x^{2k+1}}{k!,(2k+1)}$ for $|x| < 2$ (relative error about $10^{-15}$, small arguments included), $1 - \operatorname{erfc}(x)$ beyond (absolute error about $10^{-16}$). Odd.
§Examples
use comnum_math::erf;
assert!((erf(1e-4) / 1.128_379_163_334_248_7e-4 - 1.0).abs() < 1e-14);
assert!((erf(0.9) - 0.796_908_212_422_831_9).abs() < 1e-15);