\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\frac{1}{2} \cdot \mathsf{fma}\left({x}^{3}, 1.6666666666666665, \mathsf{fma}\left(2, \log 1, 2 \cdot x\right) - 1 \cdot \frac{{x}^{3}}{{1}^{2}}\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(((double) pow(x, 3.0)), 1.6666666666666665, ((double) (((double) fma(2.0, ((double) log(1.0)), ((double) (2.0 * x)))) - ((double) (1.0 * ((double) (((double) pow(x, 3.0)) / ((double) pow(1.0, 2.0))))))))))));
}



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
Final simplification0.3
herbie shell --seed 2020123 +o rules:numerics
(FPCore (x)
:name "Hyperbolic arc-(co)tangent"
:precision binary64
(* (/ 1 2) (log (/ (+ 1 x) (- 1 x)))))