\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 -8.69621448261073 \cdot 10^{-275}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + n \cdot \frac{\ell \cdot \left(U* - U\right)}{Om}\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 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot U} \cdot \sqrt{t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + n \cdot \left(\frac{\ell}{Om} \cdot \left(U* - U\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 8.855689318758691 \cdot 10^{+287}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\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(\ell \cdot -2 + \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\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)} \cdot \left(\ell \cdot \sqrt{2}\right) + 0.5 \cdot \left(\frac{t \cdot \sqrt{2}}{\ell} \cdot \sqrt{\frac{n \cdot U}{\frac{n \cdot U*}{{Om}^{2}} - \left(\frac{n \cdot U}{{Om}^{2}} + 2 \cdot \frac{1}{Om}\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*))))
-8.69621448261073e-275)
(sqrt
(*
(* (* 2.0 n) U)
(+ t (* (/ l Om) (+ (* l -2.0) (* n (/ (* l (- U* U)) Om)))))))
(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) U))
(sqrt (+ t (* (/ l Om) (+ (* l -2.0) (* n (* (/ l Om) (- U* U))))))))
(if (<=
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))
8.855689318758691e+287)
(sqrt
(*
(* (* 2.0 n) U)
(+ t (* (/ l Om) (+ (* l -2.0) (* (- U* U) (* n (/ l Om))))))))
(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) (+ (* l -2.0) (* (- U* U) (* n (/ l Om))))))))
(+
(*
(sqrt
(*
n
(*
U
(-
(/ (* n U*) (pow Om 2.0))
(+ (/ (* n U) (pow Om 2.0)) (* 2.0 (/ 1.0 Om)))))))
(* l (sqrt 2.0)))
(*
0.5
(*
(/ (* t (sqrt 2.0)) l)
(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_)))) <= -8.69621448261073e-275) {
tmp = sqrt(((2.0 * n) * U) * (t + ((l / Om) * ((l * -2.0) + (n * ((l * (U_42_ - U)) / Om))))));
} else 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) * U) * sqrt(t + ((l / Om) * ((l * -2.0) + (n * ((l / Om) * (U_42_ - U))))));
} else if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 8.855689318758691e+287) {
tmp = sqrt(((2.0 * n) * U) * (t + ((l / Om) * ((l * -2.0) + ((U_42_ - U) * (n * (l / Om)))))));
} 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) * ((l * -2.0) + ((U_42_ - U) * (n * (l / Om))))));
} else {
tmp = (sqrt(n * (U * (((n * U_42_) / pow(Om, 2.0)) - (((n * U) / pow(Om, 2.0)) + (2.0 * (1.0 / Om)))))) * (l * sqrt(2.0))) + (0.5 * (((t * sqrt(2.0)) / l) * 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*)))) < -8.69621448261072967e-275Initial program 64.0
Simplified25.7
Taylor expanded around 0 30.6
Simplified27.1
if -8.69621448261072967e-275 < (*.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 55.8
Simplified55.6
rmApplied associate-*r*_binary64_35955.3
Simplified55.3
rmApplied sqrt-prod_binary64_43550.6
Simplified50.6
Simplified50.5
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*)))) < 8.8556893187586913e287Initial program 1.8
Simplified5.2
rmApplied associate-*r*_binary64_3591.3
if 8.8556893187586913e287 < (*.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 61.5
Simplified50.6
rmApplied associate-*r*_binary64_35950.3
Simplified50.3
rmApplied sqrt-prod_binary64_43549.0
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.4
rmApplied associate-*r*_binary64_35963.4
Simplified63.4
Taylor expanded around 0 63.5
Simplified63.4
Taylor expanded around inf 50.6
Final simplification27.9
herbie shell --seed 2021032
(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*))))))