g01ea returns a one or two tail probability for the standard Normal distribution.

Syntax

C#
public static double g01ea(
	string tail,
	double x,
	out int ifail
)
Visual Basic
Public Shared Function g01ea ( _
	tail As String, _
	x As Double, _
	<OutAttribute> ByRef ifail As Integer _
) As Double
Visual C++
public:
static double g01ea(
	String^ tail, 
	double x, 
	[OutAttribute] int% ifail
)
F#
static member g01ea : 
        tail : string * 
        x : float * 
        ifail : int byref -> float 

Parameters

tail
Type: System..::..String
On entry: indicates which tail the returned probability should represent.
tail="L"
The lower tail probability is returned, i.e., PXx.
tail="U"
The upper tail probability is returned, i.e., PXx.
tail="S"
The two tail (significance level) probability is returned, i.e., PXx+PX-x.
tail="C"
The two tail (confidence interval) probability is returned, i.e., PXx-PX-x.
Constraint: tail="L", "U", "S" or "C".
x
Type: System..::..Double
On entry: x, the value of the standard Normal variate.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Return Value

g01ea returns a one or two tail probability for the standard Normal distribution.

Description

The lower tail probability for the standard Normal distribution, PXx is defined by:
PXx=-xZXdX,
where
ZX=12πe-X2/2,-<X<.
The relationship
PXx=12erfc-x2
is used, where erfc is the complementary error function, and is computed using s15ad. For the upper tail probability the relationship PXx=PX-x 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
PXx-PX-x=erfx2,
is used, where erf is the error function, and is computed using s15ae.

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

Error Indicators and Warnings

Errors or warnings detected by the method:
If ifail0, then g01ea returns 0.0.
ifail=1
On entry,tail"L", "U", "S" or "C".
ifail=-9000
An error occured, see message report.

Accuracy

Accuracy is limited by machine precision. For detailed error analysis see s15ad and s15ae.

Parallelism and Performance

None.

Further Comments

None.

Example

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

Example program (C#): g01eae.cs

Example program data: g01eae.d

Example program results: g01eae.r

See Also