Description
Add a scaled complementary error function:
erfcx(x) = exp(x^2) * erfc(x)
For small x this can use the current rational function approximations for erf or erfc and remove the scaling down by exp(-x^2). For large x this can use the continued fraction expansion of erfc and remove the scaling by e^-z:
z 1 erfc z = -------- e^-z^2 ----------------------------- sqrt(pi) z^2 + 1/2 ----------------------- 1 + 1 ------------------- z^2 + 3/2 ------------- 1 + 2 --------- z^2 + ...
At very large x the rational function cannot be evaluated as z^2 + 0.5 ~ z^2 and the following approximation can be used:
1 1 erfcx z = -------- * - sqrt(pi) z
This occurs at 2^26 or approximately 6.71e7.