Clicky

Fortran Wiki
erf

Description

erf(x) computes the error function of x, defined as

erf(x)=2π 0 xe t 2dt. \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 1erf(x)1-1 \leq erf (x) \leq 1 .

Example

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

category: intrinsics