\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\frac{1}{2} \cdot \mathsf{fma}\left(0.66666666666666652, {x}^{3}, \mathsf{fma}\left(2, \log 1, 2 \cdot x\right)\right)double code(double x) {
return ((double) (((double) (1.0 / 2.0)) * ((double) log(((double) (((double) (1.0 + x)) / ((double) (1.0 - x))))))));
}
double code(double x) {
return ((double) (((double) (1.0 / 2.0)) * ((double) fma(0.6666666666666665, ((double) pow(x, 3.0)), ((double) fma(2.0, ((double) log(1.0)), ((double) (2.0 * x))))))));
}



Bits error versus x
Results
Initial program 58.5
rmApplied flip3--58.5
Applied associate-/r/58.5
Applied log-prod58.5
Taylor expanded around 0 0.3
Simplified0.3
Taylor expanded around 0 0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2020121 +o rules:numerics
(FPCore (x)
:name "Hyperbolic arc-(co)tangent"
:precision binary64
(* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))