ERF(3) - [MATHEMATICS] Error function
result = erf(x)
elemental real(kind=KIND) function erf(x)real(kind=KIND),intent(in) :: x
o X is of type real o The result is of the same type and kind as X.
ERF(3) computes the error function of X, defined as
$$ \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-T^2} dt. $$
o X : The type shall be real.
The return value is of type real, of the same kind as X and lies in the range -1 <= ERF(x) <= 1 .
Sample program:
program demo_erf use, intrinsic :: iso_fortran_env, only : real32, real64, real128 implicit none real(kind=real64) :: x = 0.17_real64 write(*,*)x, erf(x) end program demo_erfResults:
> 0.17000000000000001 0.18999246120180879
Fortran 2008
ERFC(3), ERF_SCALED(3)
Fortran intrinsic descriptions
o Wikipedia:error function
Nemo Release 3.1 | erf (3fortran) | November 02, 2024 |