Learn R Programming

NORMT3 (version 1.0.4)

erfc: Complementary error function

Description

Computes the complementary error function of a (possibly) complex valued argument. This function is $$2/\sqrt{\pi} \int_{z}^{\infty} \exp^{-t^2} dt$$.

Usage

erfc(z)

Arguments

z

Argument of complementary error function

Value

The complementary error function of z

Details

Computes the complementary error function of a (possibly) complex valued argument. This function is $$2/\sqrt{\pi} \int_{z}^{\infty} \exp^{-t^2} dt$$

This function actually calls FORTRAN code (algorithm TOMS 680) which computes the Faddeeva's function and then with a slight modification obtains the erfc function of a complex-valued argument.

References

Poppe, G.P.M. and Wijers, C.M.J. (1990) More efficient computation of the complex error function. ACM Transactions on Mathematical Software, 16, 38--46.

See Also

erf

Examples

Run this code
# NOT RUN {
erfc(0)
#
# Should give 1
#
erfc(1)
#
# Should give 0.1572992+0i
#
erfc(complex(re=1, im=1))
#
# Should give -0.3161513-0.1904535i
#
# }

Run the code above in your browser using DataLab