\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\begin{array}{l}
\mathbf{if}\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(n \cdot \left(\frac{\ell}{Om} \cdot \left(U* - U\right)\right) + \ell \cdot -2\right)\right)\right)}\\
\mathbf{elif}\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq 1.992415001715832 \cdot 10^{+147}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t + \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}\\
\mathbf{elif}\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot U} \cdot \sqrt{t + \frac{\ell}{Om} \cdot \left(n \cdot \left(\frac{\ell}{Om} \cdot \left(U* - U\right)\right) + \ell \cdot -2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right) + \left(2 \cdot n\right) \cdot \left(\left(\sqrt[3]{U} \cdot \sqrt[3]{U}\right) \cdot \left(\left(n \cdot \left(\frac{\ell}{Om} \cdot \left(U* - U\right)\right) + \ell \cdot -2\right) \cdot \left(\frac{\ell}{Om} \cdot \sqrt[3]{U}\right)\right)\right)}\\
\end{array}(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
0.0)
(sqrt
(*
(* 2.0 n)
(* U (+ t (* (/ l Om) (+ (* n (* (/ l Om) (- U* U))) (* l -2.0)))))))
(if (<=
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
1.992415001715832e+147)
(sqrt
(+
(* (* (* 2.0 n) U) t)
(*
(* (* 2.0 n) U)
(* (/ l Om) (+ (* l -2.0) (* (- U* U) (* n (/ l Om))))))))
(if (<=
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
INFINITY)
(*
(sqrt (* (* 2.0 n) U))
(sqrt (+ t (* (/ l Om) (+ (* n (* (/ l Om) (- U* U))) (* l -2.0))))))
(sqrt
(+
(* 2.0 (* t (* n U)))
(*
(* 2.0 n)
(*
(* (cbrt U) (cbrt U))
(*
(+ (* n (* (/ l Om) (- U* U))) (* l -2.0))
(* (/ l Om) (cbrt U)))))))))))double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt(((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_))));
}
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (sqrt(((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 0.0) {
tmp = sqrt((2.0 * n) * (U * (t + ((l / Om) * ((n * ((l / Om) * (U_42_ - U))) + (l * -2.0))))));
} else if (sqrt(((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 1.992415001715832e+147) {
tmp = sqrt((((2.0 * n) * U) * t) + (((2.0 * n) * U) * ((l / Om) * ((l * -2.0) + ((U_42_ - U) * (n * (l / Om)))))));
} else if (sqrt(((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= ((double) INFINITY)) {
tmp = sqrt((2.0 * n) * U) * sqrt(t + ((l / Om) * ((n * ((l / Om) * (U_42_ - U))) + (l * -2.0))));
} else {
tmp = sqrt((2.0 * (t * (n * U))) + ((2.0 * n) * ((cbrt(U) * cbrt(U)) * (((n * ((l / Om) * (U_42_ - U))) + (l * -2.0)) * ((l / Om) * cbrt(U))))));
}
return tmp;
}



Bits error versus n



Bits error versus U



Bits error versus t



Bits error versus l



Bits error versus Om



Bits error versus U*
Results
if (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 0.0Initial program 56.2
Simplified56.2
rmApplied associate-*r*_binary64_35956.1
Simplified56.1
rmApplied associate-*l*_binary64_36038.1
Simplified38.9
rmApplied *-commutative_binary64_35038.9
if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 1.99241500171583206e147Initial program 1.9
Simplified5.5
rmApplied associate-*r*_binary64_3591.4
Simplified1.4
rmApplied distribute-lft-in_binary64_3681.4
if 1.99241500171583206e147 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0Initial program 62.7
Simplified52.2
rmApplied associate-*r*_binary64_35952.0
Simplified52.0
rmApplied sqrt-prod_binary64_43548.8
Simplified48.8
Simplified49.1
if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) Initial program 64.0
Simplified59.3
rmApplied associate-*r*_binary64_35958.0
Simplified58.0
rmApplied associate-*l*_binary64_36052.6
Simplified52.8
rmApplied distribute-rgt-in_binary64_36952.8
Applied distribute-rgt-in_binary64_36952.8
Simplified53.7
Simplified53.7
rmApplied add-cube-cbrt_binary64_45453.8
Applied associate-*l*_binary64_36053.8
Simplified49.9
Final simplification26.0
herbie shell --seed 2021075
(FPCore (n U t l Om U*)
:name "Toniolo and Linder, Equation (13)"
:precision binary64
(sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))