\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 3.486260874876501 \cdot 10^{-161}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right) + \ell \cdot -2\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(\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{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \left(\ell \cdot -2 + \ell \cdot \frac{n \cdot \left(U* - U\right)}{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 (<=
(sqrt
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
3.486260874876501e-161)
(*
(sqrt (* 2.0 n))
(sqrt (* U (+ t (* (/ l Om) (+ (* (/ l Om) (* n (- 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*)))))
INFINITY)
(sqrt
(*
(* (* 2.0 n) U)
(+ t (* (/ l Om) (+ (* l -2.0) (* (- U* U) (* n (/ l Om))))))))
(sqrt
(*
(* 2.0 n)
(* U (+ t (* (/ l Om) (+ (* l -2.0) (* l (/ (* n (- U* U)) 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 (sqrt(((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 3.486260874876501e-161) {
tmp = sqrt(2.0 * n) * sqrt(U * (t + ((l / Om) * (((l / Om) * (n * (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_)))) <= ((double) INFINITY)) {
tmp = sqrt(((2.0 * n) * U) * (t + ((l / Om) * ((l * -2.0) + ((U_42_ - U) * (n * (l / Om)))))));
} else {
tmp = sqrt((2.0 * n) * (U * (t + ((l / Om) * ((l * -2.0) + (l * ((n * (U_42_ - U)) / 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
| Alternative 1 | |
|---|---|
| Error | 29.3 |
| Cost | 8642 |
| Alternative 2 | |
|---|---|
| Error | 29.3 |
| Cost | 8328 |
| Alternative 3 | |
|---|---|
| Error | 29.4 |
| Cost | 8200 |
| Alternative 4 | |
|---|---|
| Error | 30.4 |
| Cost | 8200 |
| Alternative 5 | |
|---|---|
| Error | 35.1 |
| Cost | 8065 |
| Alternative 6 | |
|---|---|
| Error | 32.4 |
| Cost | 7688 |
| Alternative 7 | |
|---|---|
| Error | 35.1 |
| Cost | 7688 |
| Alternative 8 | |
|---|---|
| Error | 39.9 |
| Cost | 7308 |
| Alternative 9 | |
|---|---|
| Error | 40.3 |
| Cost | 6848 |
| Alternative 10 | |
|---|---|
| Error | 60.1 |
| Cost | 64 |

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*))))) < 3.486260874876501e-161Initial program 56.5
Simplified56.5
rmApplied associate-*l*_binary64_36038.6
rmApplied sqrt-prod_binary64_43538.4
Simplified38.4
if 3.486260874876501e-161 < (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 24.2
Simplified22.5
rmApplied associate-*r*_binary64_35920.1
Simplified20.1
Simplified20.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
Simplified58.0
rmApplied associate-*l*_binary64_36052.6
rmApplied div-inv_binary64_41652.6
Applied associate-*l*_binary64_36052.6
Simplified52.6
Simplified52.6
Final simplification27.4
herbie shell --seed 2021044
(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*))))))