erf

Evaluates the real error function erf(x).

Synopsis

#include <imsl.h>

float imsl_f_erf (float x)

The type double procedure is imsl_d_erf.

Required Arguments

float x (Input)
Point at which the error function is to be evaluated.

Return Value

The value of the error function erf(x).

Description

The error function erf(x) is defined to be

 

All values of x are legal.

 

Figure 1,  Plot of erf(x)

Example

Evaluate the error function at x = 12.

 

#include <imsl.h>

#include <stdio.h>

 

int main()

{

float x = 0.5;

float ans;

 

ans = imsl_f_erf(x);

printf("erf(%f) = %f\n", x, ans);

}

Output

 

erf(0.500000) = 0.520500