\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}
t_1 := \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right), t\right)}\\
t_2 := \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)\\
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq 1.4439201053307875 \cdot 10^{+304}:\\
\;\;\;\;\sqrt{t_2}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_3 := \frac{n \cdot U*}{{Om}^{2}} - \left(2 \cdot \frac{1}{Om} + \frac{n \cdot U}{{Om}^{2}}\right)\\
0.5 \cdot \left(\sqrt{\frac{n \cdot U}{t_3}} \cdot \frac{t \cdot \sqrt{2}}{\ell}\right) + \sqrt{n \cdot \left(U \cdot t_3\right)} \cdot \left(\ell \cdot \sqrt{2}\right)
\end{array}\\
\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
(let* ((t_1
(*
(sqrt (* 2.0 n))
(sqrt
(* U (fma (/ l Om) (fma l -2.0 (* (- U* U) (* n (/ l Om)))) t)))))
(t_2
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_2 0.0)
t_1
(if (<= t_2 1.4439201053307875e+304)
(sqrt t_2)
(if (<= t_2 INFINITY)
t_1
(let* ((t_3
(-
(/ (* n U*) (pow Om 2.0))
(+ (* 2.0 (/ 1.0 Om)) (/ (* n U) (pow Om 2.0))))))
(+
(* 0.5 (* (sqrt (/ (* n U) t_3)) (/ (* t (sqrt 2.0)) l)))
(* (sqrt (* n (* U t_3))) (* l (sqrt 2.0))))))))))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 t_1 = sqrt(2.0 * n) * sqrt(U * fma((l / Om), fma(l, -2.0, ((U_42_ - U) * (n * (l / Om)))), t));
double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 1.4439201053307875e+304) {
tmp = sqrt(t_2);
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
double t_3 = ((n * U_42_) / pow(Om, 2.0)) - ((2.0 * (1.0 / Om)) + ((n * U) / pow(Om, 2.0)));
tmp = (0.5 * (sqrt((n * U) / t_3) * ((t * sqrt(2.0)) / l))) + (sqrt(n * (U * t_3)) * (l * sqrt(2.0)));
}
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*
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.0 or 1.44392010533078749e304 < (*.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 60.8
Simplified51.9
Applied associate-*l*_binary6445.8
Applied sqrt-prod_binary6447.2
Simplified47.2
Simplified47.2
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*)))) < 1.44392010533078749e304Initial program 1.9
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 in l around inf 51.4
Final simplification27.1
herbie shell --seed 2022020
(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*))))))