\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\begin{array}{l}
t_0 := \cos \left(0.5 \cdot K\right) \cdot J\\
0.3333333333333333 \cdot \left({\ell}^{3} \cdot t_0\right) + \left(2 \cdot \left(\ell \cdot t_0\right) + U\right)
\end{array}
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
(FPCore (J l K U) :precision binary64 (let* ((t_0 (* (cos (* 0.5 K)) J))) (+ (* 0.3333333333333333 (* (pow l 3.0) t_0)) (+ (* 2.0 (* l t_0)) U))))
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) {
double t_0 = cos((0.5 * K)) * J;
return (0.3333333333333333 * (pow(l, 3.0) * t_0)) + ((2.0 * (l * t_0)) + U);
}



Bits error versus J



Bits error versus l



Bits error versus K



Bits error versus U
Results
Initial program 17.7
Simplified17.7
Taylor expanded in l around 0 0.4
Final simplification0.4
herbie shell --seed 2022125
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))