Evaluates the inverse of the standard normal cumulative density function.

View versions (3)

Interface

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

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

This function evaluates the inverse of the standard normal cumulative density function: given a probability $p$ it returns the value $x$ such that $p = CDF_{stdnorm}(x)$ (see CDF).

The result is obtained from a rational (minimax) polynomial approximation - one for the central region $|p-0.5|\le 0.475$, another for the tails - and is then refined to full double-precision accuracy by a single iteration of Halley&#039;s rational method.

References

Jeremy Lea&#039;s C implementation of Peter Acklam&#039;s algorithm, found at: http://home.online.no/~pjacklam/notes/invnorm/impl/lea/lea.c

\graph p=0.01:0.99

Example 1

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

Output:

standard normal CDF inverse (0.6179114) = 0.3

Parameters

p
The target cumulative probability; must satisfy $0<p<1$.
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

p
Result