\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}
\mathbf{if}\;J \leq -1.012694507951569 \cdot 10^{-303} \lor \neg \left(J \leq 1.6576375658546962 \cdot 10^{-196}\right):\\
\;\;\;\;\left(J \cdot -2\right) \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \sqrt{1 + {\left(\frac{U}{\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot 2\right)}\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(J \cdot -2\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(0.5 \cdot \frac{U}{J \cdot \cos \left(K \cdot 0.5\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
(if (or (<= J -1.012694507951569e-303) (not (<= J 1.6576375658546962e-196)))
(*
(* J -2.0)
(*
(cos (/ K 2.0))
(sqrt (+ 1.0 (pow (/ U (* (cos (/ K 2.0)) (* J 2.0))) 2.0)))))
(* (* (* J -2.0) (cos (/ K 2.0))) (* 0.5 (/ U (* J (cos (* K 0.5))))))))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 tmp;
if ((J <= -1.012694507951569e-303) || !(J <= 1.6576375658546962e-196)) {
tmp = (J * -2.0) * (cos(K / 2.0) * sqrt(1.0 + pow((U / (cos(K / 2.0) * (J * 2.0))), 2.0)));
} else {
tmp = ((J * -2.0) * cos(K / 2.0)) * (0.5 * (U / (J * cos(K * 0.5))));
}
return tmp;
}



Bits error versus J



Bits error versus K



Bits error versus U
Results
if J < -1.01269450795156895e-303 or 1.6576375658546962e-196 < J Initial program 15.4
rmApplied associate-*l*_binary6415.4
if -1.01269450795156895e-303 < J < 1.6576375658546962e-196Initial program 42.4
Taylor expanded around inf 47.4
Simplified47.4
Final simplification18.6
herbie shell --seed 2020224
(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)))))