\left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\left(t_0 \cdot \left(-2 \cdot J\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{t_0 \cdot \left(2 \cdot J\right)}\right)
\end{array}
(FPCore (J K U) :precision binary64 (* (* (* -2.0 J) (cos (/ K 2.0))) (sqrt (+ 1.0 (pow (/ U (* (* 2.0 J) (cos (/ K 2.0)))) 2.0)))))
(FPCore (J K U) :precision binary64 (let* ((t_0 (cos (/ K 2.0)))) (* (* t_0 (* -2.0 J)) (hypot 1.0 (/ U (* t_0 (* 2.0 J)))))))
double code(double J, double K, double U) {
return ((-2.0 * J) * cos(K / 2.0)) * sqrt(1.0 + pow((U / ((2.0 * J) * cos(K / 2.0))), 2.0));
}
double code(double J, double K, double U) {
double t_0 = cos(K / 2.0);
return (t_0 * (-2.0 * J)) * hypot(1.0, (U / (t_0 * (2.0 * J))));
}



Bits error versus J



Bits error versus K



Bits error versus U
Results
Initial program 18.2
Simplified7.8
Applied *-commutative_binary647.8
Final simplification7.8
herbie shell --seed 2021357
(FPCore (J K U)
:name "Maksimov and Kolovsky, Equation (3)"
:precision binary64
(* (* (* -2.0 J) (cos (/ K 2.0))) (sqrt (+ 1.0 (pow (/ U (* (* 2.0 J) (cos (/ K 2.0)))) 2.0)))))