erf(x): Erro

Função Erro.

Declaration

Sintaxe

retval = erf(x)
elemental real function erf(x)

Argumentos

x the input value must be of type real.

Valores de retorno

The return value is of type real and of the same kind as of the input parameter x.

Descrição

erf(x) computes the error function of x. The result lies in the range:

\(-1 \leq erf (x) \leq 1\)

It is calculated using:

\(\frac{2}{\sqrt\pi}\int_0^xe^{-t^2}dt\)

Tipos

Supported argument types is real.

interface erf
    module procedure serf, derf
end interface

contains

elemental real(sp) function serf(x)
real(sp), intent(in) :: x
end function

elemental real(dp) function derf(x)
real(dp), intent(in) :: x
end function

Exemplos

program intrinsics_erf
	print *, erf(0.5)
end program

Resultado:

0.520499877

Veja Também

erfc.