nag_erf (s15aec) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_erf (s15aec)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_erf (s15aec) returns the value of the error function, erfx .

2  Specification

#include <nag.h>
#include <nags.h>
double  nag_erf (double x)

3  Description

nag_erf (s15aec) evaluates
erfx = 2 π 0 x e - t 2 dt .
The approximation is based on Chebyshev expansions.

4  References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications

5  Arguments

1:     xdoubleInput
On entry: the argument x  of the function.

6  Error Indicators and Warnings

None.

7  Accuracy

On a machine with approximately 11 significant figures the function agrees with available tables to 10 figures and consistency checking with nag_erfc (s15adc) of the relation erfx + erfcx = 1.0  shows errors in at worst the 11th figure.

8  Further Comments

None.

9  Example

The following program reads values of the argument x  from a file, evaluates the function at each value of x  and prints the results.

9.1  Program Text

Program Text (s15aece.c)

9.2  Program Data

Program Data (s15aece.d)

9.3  Program Results

Program Results (s15aece.r)


nag_erf (s15aec) (PDF version)
s Chapter Contents
s Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012