Why the error function is so similar to the hyperbolic tangent? If you plot the functions
$$\text{erf}(x)=\frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2}\mathrm{d}t$$
and
$$\frac{2}{\sqrt{\pi}}\tanh(x)=\frac{2}{\sqrt{\pi}}\frac{e^x-e^{-x}}{e^x+e^{-x}},$$
they look very similar and their numeric values are almost the same and a big part of their domain.
Is there a deep reason for this?
 A: Many things have already to told in comments.
Concerning Taylor series, we have $$\text{erf}(x)=\frac{2 x}{\sqrt{\pi }}-\frac{2 x^3}{3 \sqrt{\pi }}+\frac{x^5}{5 \sqrt{\pi
   }}-\frac{x^7}{21 \sqrt{\pi }}+\frac{x^9}{108 \sqrt{\pi }}+O\left(x^{10}\right)$$
$$\frac{2}{\sqrt{\pi}}\tanh(x)=\frac{2 x}{\sqrt{\pi }}-\frac{2 x^3}{3 \sqrt{\pi }}+\frac{4 x^5}{15 \sqrt{\pi
   }}-\frac{34 x^7}{315 \sqrt{\pi }}+\frac{124 x^9}{2835 \sqrt{\pi
   }}+O\left(x^{10}\right)$$
$$\text{erf}(x)-\frac{2}{\sqrt{\pi}}\tanh(x)=-\frac{x^5}{15 \sqrt{\pi }}+\frac{19 x^7}{315 \sqrt{\pi }}-\frac{391 x^9}{11340
   \sqrt{\pi }}+O\left(x^{10}\right)$$ On the other hand, $$\lim_{x\to\infty}\text{erf}(x)=1$$ while $$\lim_{x\to\infty}\frac{2}{\sqrt{\pi}}\tanh(x)=\frac{2}{\sqrt{\pi }}$$ On another hand $$2\frac{ \left(\frac{2 \tanh (x)}{\sqrt{\pi
   }}-\text{erf}(x)\right)}{\text{erf}(x)+\frac{2 \tanh (x)}{\sqrt{\pi }}}<0.01$$ if $x<0.809$.
So, a already said in comments, the functions are "close" to eachother over a quite limited range.
