erf(3f) - [FORTRAN:INTRINSIC:MATHEMATICS] Error function
erf(x) computes the error function of X, defined as $$ \text{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0**x e**{-t**2} dt. $$
result = erf(x)
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 : real_kinds, & & real32, real64, real128 implicit none real(kind=real64) :: x = 0.17_real64 x = erf(x) end program demo_erf
[[Fortran 2008]] and later
[[Elemental procedure|Elemental function]]
erf (3) | March 11, 2021 |