\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 := \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\\
t_2 := \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot t_1\right)}\\
\mathbf{if}\;n \leq -7.76442369845317 \cdot 10^{-134}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;n \leq -1.1801343746820894 \cdot 10^{-287}:\\
\;\;\;\;\sqrt{U \cdot \mathsf{fma}\left(-4, \frac{n \cdot \left(\ell \cdot \ell\right)}{Om}, 2 \cdot \left(n \cdot t\right)\right)}\\
\mathbf{elif}\;n \leq 1.8895719119205843 \cdot 10^{-298}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, t_1, t\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
(let* ((t_1 (fma l -2.0 (* (- U* U) (* n (/ l Om)))))
(t_2 (sqrt (* (* (* n 2.0) U) (+ t (* (/ l Om) t_1))))))
(if (<= n -7.76442369845317e-134)
t_2
(if (<= n -1.1801343746820894e-287)
(sqrt (* U (fma -4.0 (/ (* n (* l l)) Om) (* 2.0 (* n t)))))
(if (<= n 1.8895719119205843e-298)
t_2
(* (sqrt (* n 2.0)) (sqrt (* U (fma (/ l Om) t_1 t)))))))))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 = fma(l, -2.0, ((U_42_ - U) * (n * (l / Om))));
double t_2 = sqrt((((n * 2.0) * U) * (t + ((l / Om) * t_1))));
double tmp;
if (n <= -7.76442369845317e-134) {
tmp = t_2;
} else if (n <= -1.1801343746820894e-287) {
tmp = sqrt((U * fma(-4.0, ((n * (l * l)) / Om), (2.0 * (n * t)))));
} else if (n <= 1.8895719119205843e-298) {
tmp = t_2;
} else {
tmp = sqrt((n * 2.0)) * sqrt((U * fma((l / Om), t_1, t)));
}
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 n < -7.76442369845316991e-134 or -1.1801343746820894e-287 < n < 1.8895719119205843e-298Initial program 32.4
Simplified28.5
if -7.76442369845316991e-134 < n < -1.1801343746820894e-287Initial program 39.0
Simplified34.7
Taylor expanded in n around 0 39.0
Taylor expanded in t around 0 38.8
Simplified34.1
if 1.8895719119205843e-298 < n Initial program 34.6
Simplified31.2
Applied egg-rr23.8
Final simplification27.1
herbie shell --seed 2022125
(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*))))))