Manual Reference Pages  - erf (3fortran)

NAME

ERF(3) - [MATHEMATICS] Error function

SYNOPSIS

result = erf(x)

         elemental real(kind=KIND) function erf(x)

real(kind=KIND),intent(in) :: x

CHARACTERISTICS

o X is of type real
o The result is of the same type and kind as X.

DESCRIPTION

ERF(3) computes the error function of X, defined as

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

OPTIONS

o X : The type shall be real.

RESULT

The return value is of type real, of the same kind as X and lies in the range -1 <= ERF(x) <= 1 .

EXAMPLES

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
        write(*,*)x, erf(x)
    end program demo_erf

Results:

         0.17000000000000001       0.18999246120180879

STANDARD

Fortran 2008

SEE ALSO

ERFC(3), ERF_SCALED(3)

RESOURCES

o Wikipedia:error function
fortran-lang intrinsic descriptions


Nemo Release 3.1 erf (3fortran) April 28, 2024
Generated by manServer 1.08 from ad596477-7dca-40e9-9cb6-bf3b248ab028 using man macros.