Computes the normal distribution cumulative distribution function (CDF).
The normal (or Gaussian, or bell-shaped) distribution is
defined as:
normalDist(x) = 1/√ π $(INTEGRAL -$(INFINITY), x) exp( - t2/2) dt
= 0.5 + 0.5 * erf(x/sqrt(2))
= 0.5 * erfc(- x/sqrt(2))
To maintain accuracy at high values of x, use
normalCDF(x) = 1 - normalCDF(-x).
Accuracy:
Within a few bits of machine resolution over the entire
range.
References:
http://www.netlib.org/cephes/ldoubdoc.html,
G. Marsaglia, "Evaluating the Normal Distribution",
Journal of Statistical Software <b>11</b>, (July 2004).
Computes the normal distribution cumulative distribution function (CDF). The normal (or Gaussian, or bell-shaped) distribution is defined as: normalDist(x) = 1/√ π $(INTEGRAL -$(INFINITY), x) exp( - t2/2) dt = 0.5 + 0.5 * erf(x/sqrt(2)) = 0.5 * erfc(- x/sqrt(2)) To maintain accuracy at high values of x, use normalCDF(x) = 1 - normalCDF(-x). Accuracy: Within a few bits of machine resolution over the entire range. References: http://www.netlib.org/cephes/ldoubdoc.html, G. Marsaglia, "Evaluating the Normal Distribution", Journal of Statistical Software <b>11</b>, (July 2004).