\frac{e^{x} - e^{-x}}{2}\frac{\mathsf{fma}\left(\frac{1}{3}, {x}^{3}, \mathsf{fma}\left(\frac{1}{60}, {x}^{5}, 2 \cdot x\right)\right)}{2}double code(double x) {
return ((exp(x) - exp(-x)) / 2.0);
}
double code(double x) {
return (fma(0.3333333333333333, pow(x, 3.0), fma(0.016666666666666666, pow(x, 5.0), (2.0 * x))) / 2.0);
}



Bits error versus x
Results
Initial program 58.0
Taylor expanded around 0 0.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2020091 +o rules:numerics
(FPCore (x)
:name "Hyperbolic sine"
:precision binary64
(/ (- (exp x) (exp (- x))) 2))