Trying to compute erfcx(x)? [duplicate]

This question already has an answer here:

The function erfcx(x) = exp(x^2)erfc(x) is sometimes provided in numerical packages to avoid numerical underflow for large values of x. But Mathematica does not provide a native implementation of this function.

Any suggestions as to what can I use to compute $$\exp(x^2)\mathrm{erfc}(x)$$ accurately for large values of $$x$$?

Edit: I just realized this is a duplicate of Numerical underflow for a scaled error function, which contains very detailed answers. So I'm closing this one.

marked as duplicate by becko, Community♦Jul 18 at 19:07

• Underflow rather than Overflow? – mikado Jul 18 at 18:01
• What do you consider large values of $x$? N[Exp[x^2] Erfc[x] /. x -> 1000000, 500] works fine. – JimB Jul 18 at 18:01
• you can also use 2 HermiteH[-1, x]/Sqrt[Pi]. – AccidentalFourierTransform Jul 18 at 18:07
• @JimB - extreme precision isn't necessary. Even low arbitrary-precision works fine, e.g., N[Exp[x^2] Erfc[x] /. x -> 1000000, 15] – Bob Hanlon Jul 18 at 18:18
• Do those numerical packages just use the approximation $\frac{1}{\sqrt{\pi } x}$ for $x>10^6$ ? – JimB Jul 18 at 18:18

Using the approximation $$\frac{1}{\sqrt{\pi } x}$$ when $$x>5*10^6$$: