On this page
math.erf
Prev: math.dist | Up: math | Next: math.erfc
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.erf
Tags: #public #python3 #stdlib #math
Import
import math
from math import erf
Signature & Overview
math.erf(x, /)
Error function at x.
Usage
import math
assert math.isclose(math.erf(0.0), 0.0)
assert math.isclose(math.erf(1.0), 0.8427007929, rel_tol=1e-7)
Gotchas
- Gauss error function: Used to compute normal CDFs (
0.5 * (1 + math.erf(x / math.sqrt(2)))), thoughstatistics.NormalDist().cdf(x)is cleaner.
REPL Inspect
from math import erf
help(erf)
Linked from
Related notes
- tuts/python3/stdlib_module/math/dist Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/erfc Linked here; links to this page; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/math/acos Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/acosh Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asin Linked here; shared tags: #math, #stdlib
- tuts/python3/stdlib_module/math/asinh Linked here; shared tags: #math, #stdlib
- tuts/c/stdlib/math shared tags: #math, #stdlib
- tuts/c/stdlib/math/fabs shared tags: #math, #stdlib
- tuts/c/stdlib/math/floor shared tags: #math, #stdlib