g01 Chapter Contents
g01 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_prob_normal (g01eac)

## 1  Purpose

nag_prob_normal (g01eac) returns a one or two tail probability for the standard Normal distribution.

## 2  Specification

 #include #include
 double nag_prob_normal (Nag_TailProbability tail, double x, NagError *fail)

## 3  Description

The lower tail probability for the standard Normal distribution, $P\left(X\le x\right)$ is defined by:
 $PX≤x=∫-∞xZXdX,$
where
 $ZX=12π e-X2/2, -∞
The relationship
 $PX≤x=12erfc-x2$
is used, where erfc is the complementary error function, and is computed using nag_erfc (s15adc). For the upper tail probability the relationship $P\left(X\ge x\right)=P\left(X\le -x\right)$ is used and for the two tail significance level probability twice the probability obtained from the absolute value of $x$ is returned.
When the two tail confidence probability is required the relationship
 $PX≤x-PX≤-x=erfx2 ,$
is used, where erf is the error function, and is computed using nag_erf (s15aec).

## 4  References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth

## 5  Arguments

1:     tailNag_TailProbabilityInput
On entry: indicates which tail the returned probability should represent.
${\mathbf{tail}}=\mathrm{Nag_LowerTail}$
The lower tail probability is returned, i.e., $P\left(X\le x\right)$.
${\mathbf{tail}}=\mathrm{Nag_UpperTail}$
The upper tail probability is returned, i.e., $P\left(X\ge x\right)$.
${\mathbf{tail}}=\mathrm{Nag_TwoTailSignif}$
The two tail (significance level) probability is returned, i.e., $P\left(X\ge \left|x\right|\right)+P\left(X\le -\left|x\right|\right)$.
${\mathbf{tail}}=\mathrm{Nag_TwoTailConfid}$
The two tail (confidence interval) probability is returned, i.e., $P\left(X\le \left|x\right|\right)-P\left(X\le -\left|x\right|\right)$.
Constraint: ${\mathbf{tail}}=\mathrm{Nag_LowerTail}$, $\mathrm{Nag_UpperTail}$, $\mathrm{Nag_TwoTailSignif}$ or $\mathrm{Nag_TwoTailConfid}$.
2:     xdoubleInput
On entry: $x$, the value of the standard Normal variate.
3:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

## 7  Accuracy

Accuracy is limited by machine precision. For detailed error analysis see nag_erfc (s15adc) and nag_erf (s15aec).

None.

## 9  Example

Four values of tail and x are input and the probabilities calculated and printed.

### 9.1  Program Text

Program Text (g01eace.c)

### 9.2  Program Data

Program Data (g01eace.d)

### 9.3  Program Results

Program Results (g01eace.r)