\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 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - t_1\right)\\
t_4 := t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, t_1\right)\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\sqrt{n \cdot \left(2 \cdot \left(t \cdot U\right) - 4 \cdot \frac{{\ell}^{2} \cdot U}{Om}\right)}\\
\mathbf{elif}\;t_3 \leq 4.707788325681701 \cdot 10^{+300}:\\
\;\;\;\;\sqrt{t_2 \cdot t_4}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_2} \cdot \sqrt{t_4}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(n \cdot \left(2 \cdot \left(U \cdot t\right) - 4 \cdot \frac{\left(\ell \cdot \ell\right) \cdot U}{Om}\right)\right)}^{0.25}\right)}^{2}\\
\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 (* (* n (pow (/ l Om) 2.0)) (- U U*)))
(t_2 (* (* 2.0 n) U))
(t_3 (* t_2 (- (- t (* 2.0 (/ (* l l) Om))) t_1)))
(t_4 (- t (fma 2.0 (* l (/ l Om)) t_1))))
(if (<= t_3 0.0)
(sqrt (* n (- (* 2.0 (* t U)) (* 4.0 (/ (* (pow l 2.0) U) Om)))))
(if (<= t_3 4.707788325681701e+300)
(sqrt (* t_2 t_4))
(if (<= t_3 INFINITY)
(* (sqrt t_2) (sqrt t_4))
(pow
(pow (* n (- (* 2.0 (* U t)) (* 4.0 (/ (* (* l l) U) Om)))) 0.25)
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 = (n * pow((l / Om), 2.0)) * (U - U_42_);
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * ((l * l) / Om))) - t_1);
double t_4 = t - fma(2.0, (l * (l / Om)), t_1);
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt((n * ((2.0 * (t * U)) - (4.0 * ((pow(l, 2.0) * U) / Om)))));
} else if (t_3 <= 4.707788325681701e+300) {
tmp = sqrt((t_2 * t_4));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt(t_2) * sqrt(t_4);
} else {
tmp = pow(pow((n * ((2.0 * (U * t)) - (4.0 * (((l * l) * U) / Om)))), 0.25), 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.0Initial program 57.6
Simplified57.6
Taylor expanded in n around 0 42.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*)))) < 4.7077883256817012e300Initial program 1.6
Simplified1.6
Applied egg-rr1.6
if 4.7077883256817012e300 < (*.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.2
Simplified63.2
Applied egg-rr53.8
Applied egg-rr49.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
Simplified64.0
Applied egg-rr64.0
Taylor expanded in n around 0 59.2
Simplified59.2
Final simplification27.8
herbie shell --seed 2022127
(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*))))))