\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}\mathsf{fma}\left(\frac{-1}{3}, {x}^{3}, \mathsf{fma}\left(\frac{2}{15}, {x}^{5}, x\right)\right)double f(double x) {
double r52286 = x;
double r52287 = exp(r52286);
double r52288 = -r52286;
double r52289 = exp(r52288);
double r52290 = r52287 - r52289;
double r52291 = r52287 + r52289;
double r52292 = r52290 / r52291;
return r52292;
}
double f(double x) {
double r52293 = -0.3333333333333333;
double r52294 = x;
double r52295 = 3.0;
double r52296 = pow(r52294, r52295);
double r52297 = 0.13333333333333333;
double r52298 = 5.0;
double r52299 = pow(r52294, r52298);
double r52300 = fma(r52297, r52299, r52294);
double r52301 = fma(r52293, r52296, r52300);
return r52301;
}



Bits error versus x
Initial program 58.2
rmApplied tanh-undef0.0
Taylor expanded around 0 1.7
Simplified1.7
Final simplification1.7
herbie shell --seed 2019305 +o rules:numerics
(FPCore (x)
:name "Hyperbolic tangent"
:precision binary64
(/ (- (exp x) (exp (- x))) (+ (exp x) (exp (- x)))))