\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}\;\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{2 \cdot n} \cdot \sqrt{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)}\\
\mathbf{elif}\;\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 3.977302096509122 \cdot 10^{+300}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \left(U* \cdot \left(n \cdot \frac{\ell}{Om}\right) - \left(n \cdot \frac{\ell}{Om}\right) \cdot \left(\sqrt[3]{U} \cdot \left(\sqrt[3]{U} \cdot \sqrt[3]{U}\right)\right)\right)\right)\right)}\\
\mathbf{elif}\;\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}:\\
\;\;\;\;-\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \left(\frac{n \cdot U}{{Om}^{2}} + 2 \cdot \frac{1}{Om}\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 (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
0.0)
(*
(sqrt (* 2.0 n))
(sqrt (* U (+ t (* (/ l Om) (+ (* n (* (/ l Om) (- U* U))) (* l -2.0)))))))
(if (<=
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))
3.977302096509122e+300)
(sqrt
(*
(* (* 2.0 n) U)
(+
t
(*
(/ l Om)
(+
(* l -2.0)
(-
(* U* (* n (/ l Om)))
(* (* n (/ l Om)) (* (cbrt U) (* (cbrt U) (cbrt U))))))))))
(if (<=
(*
(* (* 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))))))
(-
(*
(* l (sqrt 2.0))
(sqrt
(*
n
(*
U
(-
(/ (* n U*) (pow Om 2.0))
(+ (/ (* n U) (pow Om 2.0)) (* 2.0 (/ 1.0 Om)))))))))))))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 ((((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) * sqrt(U * (t + ((l / Om) * ((n * ((l / Om) * (U_42_ - U))) + (l * -2.0)))));
} else if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 3.977302096509122e+300) {
tmp = sqrt(((2.0 * n) * U) * (t + ((l / Om) * ((l * -2.0) + ((U_42_ * (n * (l / Om))) - ((n * (l / Om)) * (cbrt(U) * (cbrt(U) * cbrt(U)))))))));
} else if ((((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 = -((l * sqrt(2.0)) * sqrt(n * (U * (((n * U_42_) / pow(Om, 2.0)) - (((n * U) / pow(Om, 2.0)) + (2.0 * (1.0 / Om)))))));
}
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 (*.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 57.0
Simplified53.1
rmApplied associate-*r*_binary64_35951.6
Simplified51.6
rmApplied associate-*l*_binary64_36036.7
Simplified37.2
rmApplied sqrt-prod_binary64_43538.8
if 0.0 < (*.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*)))) < 3.97730209650912226e300Initial program 1.7
Simplified5.4
rmApplied associate-*r*_binary64_3591.3
Simplified1.3
rmApplied add-cube-cbrt_binary64_4541.3
Applied cancel-sign-sub-inv_binary64_3851.3
Applied distribute-lft-in_binary64_3681.3
if 3.97730209650912226e300 < (*.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 63.1
Simplified53.4
rmApplied associate-*r*_binary64_35953.3
Simplified53.3
rmApplied sqrt-prod_binary64_43549.7
Simplified49.7
Simplified49.8
if +inf.0 < (*.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
Simplified63.6
Taylor expanded around -inf 51.7
Final simplification26.4
herbie shell --seed 2021084
(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*))))))