Skip to main content

erfc

erfc (num [, accuracy ])​

The erfc function returns the complementary error function of num (erfc(x) = 1 - erf(x)). Optionally, accuracy can be used to specify the desired fractional accuracy.

In complex expressions the complementary error function is

erfc⁡(z)=1−erf⁡(z)=1−2zπ 1F1(12;32;−z2),\displaystyle \operatorname{erfc}(z)=1-\operatorname{erf}(z)=1-\frac{2 z}{\sqrt{\pi}} \space{_1} F_{1}\left(\frac{1}{2} ; \frac{3}{2} ;-z^{2}\right),

where

1F1(12;32;−z2)\displaystyle { }_{1} F_{1}\left(\frac{1}{2} ; \frac{3}{2} ;-z^{2}\right)

is the confluent hypergeometric function of the first kind HyperG1F1. In this case the accuracy parameter is ignored.

Details​

The accuracy parameter specifies the fractional accuracy that you desire. That is, if you set accuracy to 1e-7, that means that you wish that the absolute value of (factual-freturned)/factual be less than 10-7.

For backwards compatibility, in the absence of accuracy an alternate calculation method is used that achieves fractional accuracy better than 2x10-7.

If accuracy is present, erfc can achieve fractional accuracy better than 2x10-16 for num up to 1. From num = 1 to 10 fractional accuracy is better than 2x10-15.

Higher accuracy takes somewhat longer to calculate. With accuracy set to 1e-16 erfc takes about 50% more time than with accuracy set to 1e-7.

See Also​

erf, erfcw, erfcx, inverseErfc, dawson