\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}
\frac{\frac{2 \cdot \sinh x}{\cosh x}}{2}
(FPCore (x) :precision binary64 (/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))
(FPCore (x) :precision binary64 (/ (/ (* 2.0 (sinh x)) (cosh x)) 2.0))
double code(double x) {
return (exp(x) - exp(-x)) / (exp(x) + exp(-x));
}
double code(double x) {
return ((2.0 * sinh(x)) / cosh(x)) / 2.0;
}



Bits error versus x
Results
Initial program 58.1
rmApplied cosh-undef_binary6458.1
Applied sinh-undef_binary641.3
Applied times-frac_binary641.3
Applied associate-*l/_binary641.3
Simplified1.3
Final simplification1.3
herbie shell --seed 2021211
(FPCore (x)
:name "Hyperbolic tangent"
:precision binary64
(/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))