Evaluates the standard normal cumulative density function.

View versions (3)

Interface

#include <codecogs/statistics/distributions/continuous/stdnormal/cdf.h>

using namespace Statistics::Distributions::Continuous::Stdnormal;

This function evaluates the standard normal cumulative density function, which is the area under the Gaussian probability density function, integrated over the range $[-\infty, x]$:

$$CDF_{stdnorm}(x) = \frac{1}{\sqrt{2 \pi}} \int_{-\infty}^x e^{-t^2/2} \: dt = \frac{1}{2}(1+erf(z))$$
(1)

where $z=x/\sqrt 2$ and erf is the error function computed using errorFn.

This function has the following form: \graph x=-4:4

Example 1

#include <iostream>
#include <codecogs/statistics/distributions/continuous/stdnormal/cdf.h>
using namespace std;
int main()
{
  cout << "standard normal CDF (0.3) = ";
  cout << Statistics::Distributions::Continuous::Stdnormal::CDF(0.3) << endl;
  return 0;
}

Output:

standard normal CDF (0.3) = 0.617911

Parameters

x
The upper limit on the integral

References

http://mathworld.wolfram.com/StandardNormalDistribution.html

GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

x
Result