\frac{1}{2} \cdot \log \left(\frac{1 + x}{1 - x}\right)\frac{1}{2} \cdot \left(2 \cdot x + \left({x}^{3} \cdot 0.66666666666666663 + {x}^{5} \cdot 0.40000000000000002\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) (((double) (2.0 * x)) + ((double) (((double) (((double) pow(x, 3.0)) * 0.6666666666666666)) + ((double) (((double) pow(x, 5.0)) * 0.4))))))));
}



Bits error versus x
Results
Initial program 58.6
rmApplied log-div58.6
Taylor expanded around 0 0.2
Simplified0.2
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020184
(FPCore (x)
:name "Hyperbolic arc-(co)tangent"
:precision binary64
(* (/ 1.0 2.0) (log (/ (+ 1.0 x) (- 1.0 x)))))