Probability distributions
Normal cumulative distribution function
prob.normal-cdfAlso called normal cdf, gaussian cdf, phi, norm cdf
Probability that a normal variable with mean μ and standard deviation σ is at most x, written with the error function.
Notation
the point at which the density is evaluated
x ∈ ℝ
mean (location)
μ ∈ ℝ
standard deviation (scale)
σ > 0
Result: the probability, in [0, 1]
scalar
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
≈ 0.5
Given
Result
≈ 0.841344746069
Given
Result
≈ 0.308537538726
Common mistakes
Omits the √2 in the error function's argument
erf is the CDF of a normal with variance ½, so the standardized value must be divided by √2.
Fix: Use erf((x − μ)/(σ√2)).
Treats σ as the variance
The code uses its σ argument where σ2 belongs.
Fix: Pass the standard deviation.
Sources
NIST/SEMATECH e-Handbook, §1.3.6.6.1
NIST/SEMATECH e-Handbook of Statistical Methods. https://www.itl.nist.gov/div898/handbook/ Last updated 2022-04-27. doi:10.18434/M32189
DLMF, eq. 7.2.1
NIST Digital Library of Mathematical Functions. https://dlmf.nist.gov/ Release 1.2.8 of 2026-09-15. F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, B. V. Saunders, H. S. Cohl, and M. A. McClain, eds.