#
Fortran Wiki

erf

## Description

`erf(x)`

computes the error function of `x`

, defined as

$\text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} dt.$

## Standard

Fortran 2008 and later

## Class

Elemental function

## Syntax

`result = erf(x)`

## Arguments

`x`

- The type shall be `real`

.

## Return value

The return value is of type `real`

, of the same kind as `x`

and lies in the range $-1 \leq erf (x) \leq 1$.

## Example

```
program test_erf
real(8) :: x = 0.17_8
x = erf(x)
end program test_erf
```

Revised on June 2, 2009 17:17:59
by

Jason Blevins
(152.3.10.27)
(586 characters / 0.0 pages)