The inverse hyperbolic tangent function $\operatorname{atanh}$ is defined as:
$$\operatorname{atanh}(x) = \frac{1}{2}\log\left(\frac{1 + x}{1 - x}\right)$$
In computers using floating point arithmetic, as $x$ approaches $+1$ or $-1$, then either $1 + x$ or $1 - x$ involve calculating differences of numbers of similar magnitude. In real terms, this causes loss of precision and inaccurate results. For example, $x$ vs. $\operatorname{atanh}(\tanh(x))$ may differ significantly for $\lvert x \rvert > 3$.
Is there an alternate expression for $\operatorname{atanh}(x)$, say for $\lvert x \rvert > 0.995$, that can reduce the error?
You can use $$\tanh ^{-1}(1-\epsilon )=\frac{1}{2} \log \left(\frac{2-\epsilon }{\epsilon }\right)=-\frac 12 \log \left(\frac{\epsilon }{2}\right)-\sum_{n=1}^\infty\frac {\epsilon^n}{2^{n+1}\,n}$$ and use
$$\tanh ^{-1}(-1+\epsilon )=-\tanh ^{-1}(1-\epsilon )$$
The summation converges very fast and, for calculation purposes could be raplaced by some $[2p+1,2p]$ Padé approximant $P_n$ such as
$$P_1=\frac{\epsilon \left(\epsilon ^2-42 \epsilon +120\right)}{12 \left(3 \epsilon ^2-24 \epsilon +40\right)}$$ whose error is $\frac{\epsilon ^6}{76800}$
Edit
If you want to know $n$ such that $$\frac {\epsilon^n}{2^{n+1}\,n}\leq 10^{-k}$$ $$n=\left\lceil -\frac{1}{\log \left(\frac{\epsilon }{2}\right)}\,\,W\left(-\frac{10^k}{2}\,\, \log \left(\frac{\epsilon }{2}\right)\right)\right\rceil$$ where $W(.)$ is Lambert function.