Manual Reference Pages  - erfc (3fortran)

NAME

ERFC(3) - [MATHEMATICS] Complementary error function

SYNOPSIS

result = erfc(x)

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

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

CHARACTERISTICS

o X is of type real and any valid kind
o KIND is any value valid for type real
o the result has the same characteristics as X

DESCRIPTION

ERFC(3) computes the complementary error function of X. Simply put this is equivalent to 1 - ERF(X), but ERFC is provided because of the extreme loss of relative accuracy if ERF(X) is called for large X and the result is subtracted from 1.

ERFC(X) is defined as

$$ \text{erfc}(x) = 1 - \text{erf}(x) = 1 - \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2} dt. $$

OPTIONS

o X : The type shall be real.

RESULT

The return value is of type real and of the same kind as X. It lies in the range

0 <= erfc(x) <= 2.

and is a processor-dependent approximation to the complementary error function of X ( 1-ERF(X) ).

EXAMPLES

Sample program:

    program demo_erfc
    use, intrinsic :: iso_fortran_env, only : real32, real64, real128
    implicit none
    real(kind=real64) :: x = 0.17_real64
       write(*,’(*(g0))’)’X=’,x, ’ ERFC(X)=’,erfc(x)
       write(*,’(*(g0))’)’equivalently 1-ERF(X)=’,1-erf(x)
    end program demo_erfc

Results:

     > X=.1700000000000000 ERFC(X)=.8100075387981912
     > equivalently 1-ERF(X)=.8100075387981912

STANDARD

Fortran 2008

SEE ALSO

ERF(3) ERF_SCALED(3)

RESOURCES

o Wikipedia:error function
Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 erfc (3fortran) November 02, 2024
Generated by manServer 1.08 from dc073998-4130-4fec-a82a-f9204289d622 using man macros.