\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U\mathsf{fma}\left(2, \left(J \cdot \cos \left(0.5 \cdot K\right)\right) \cdot \ell, U\right)double code(double J, double l, double K, double U) {
return (((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U);
}
double code(double J, double l, double K, double U) {
return fma(2.0, ((J * cos((0.5 * K))) * l), U);
}



Bits error versus J



Bits error versus l



Bits error versus K



Bits error versus U
Results
Initial program 17.1
Simplified17.1
Taylor expanded around 0 0.6
Taylor expanded around inf 0.6
Simplified0.6
rmApplied associate-*r*0.6
Final simplification0.6
herbie shell --seed 2020053 +o rules:numerics
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2))) U))