erfcx
erfcx (num)
The erfcx function returns the scaled complementary error function of num:
f(x) = exp(x2)*erfc(x)
Details
This implementation is for real numbers only. If you need complex input and output, use:
erfcx = Faddeeva(ix)
This method has poorer accuracy for negative X and a more limited region of numerical validity than this real implementation.
Computing erfcx using the mathematical definition has a very limited range in which it is accurate, or even valid.
References
Our implementation comes from this post:
The code in that post is based on this paper:
M. M. Shepherd and J. G. Laframboise, "Chebyshev Approximation of (1 + 2 x) exp(x2) erfc x in 0 ≤ x < ∞.", Mathematics of Computation, Volume 36, No. 153, January 1981, pp. 249-253