erf function
- double x
Return the error function of x.
x: double
Returns
- y : double
2 / sqrt(pi) * integral from 0 to x of exp(-t^2) dt
References
- "scipy.special.erf". https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.erf.html. Retrieved 2026-10-13.
- W. J. Cody, "Rational Chebyshev approximations for the error function", Mathematics of Computation 23 (1969), 631-637.
- "CALERF". https://www.netlib.org/specfun/erf. Retrieved 2026-10-13.
Examples
print(erf(0.5));
/* output:
0.5204998778130465
*/
Implementation
double erf(double x) => _calerf(x, _Kind.erf);