Complementary error function tail bound (source code)

= Complementary error function tail bound
{title2=$\frac{e^{-x^2}}{\sqrt\pi(x+1/(2x))}<\operatorname{erfc}(x)<\frac{e^{-x^2}}{\sqrt\pi x}$}

For every real $x>0$,
$$
\frac{e^{-x^2}}{\sqrt\pi(x+1/(2x))}<\operatorname{erfc}(x)<\frac{e^{-x^2}}{\sqrt\pi x}.
$$
For a short proof, put $I(x)=\int_x^\infty e^{-t^2}\,dt$. <Integration by parts> gives
$$
I(x)=\frac{e^{-x^2}}{2x}-\frac12\int_x^\infty\frac{e^{-t^2}}{t^2}\,dt.
$$
The last <integral> is positive and strictly smaller than $I(x)/x^2$. Using these two inequalities gives the upper and lower bounds after multiplication by $2/\sqrt\pi$. Dividing both bounds by $e^{-x^2}/(\sqrt\pi x)$ also proves the leading <asymptotic equivalence> by the <squeeze theorem>. For small positive $x$, the bounds remain true but can be loose; they are especially useful when the <Gaussian integral> tail is already small.