\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(2 \cdot n\right) \cdot U\\
t_2 := t_1 \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)\\
t_3 := t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\\
\mathbf{if}\;t_2 \leq 0:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t_3\right)}\\
\mathbf{elif}\;t_2 \leq 1.3834069064790994 \cdot 10^{+289}:\\
\;\;\;\;\sqrt{t_1 \cdot t_3}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_4 := \frac{n \cdot U*}{Om \cdot Om} - \left(\frac{2}{Om} + \frac{n \cdot U}{Om \cdot Om}\right)\\
-\mathsf{fma}\left(0.5, \sqrt{\frac{n \cdot U}{t_4}} \cdot \frac{t \cdot \sqrt{2}}{\ell}, \sqrt{n \cdot \left(U \cdot t_4\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\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 (* (* 2.0 n) U))
(t_2
(*
t_1
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))
(t_3 (+ t (* (/ l Om) (fma l -2.0 (* (- U* U) (* n (/ l Om))))))))
(if (<= t_2 0.0)
(sqrt (* (* 2.0 n) (* U t_3)))
(if (<= t_2 1.3834069064790994e+289)
(sqrt (* t_1 t_3))
(let* ((t_4
(-
(/ (* n U*) (* Om Om))
(+ (/ 2.0 Om) (/ (* n U) (* Om Om))))))
(-
(fma
0.5
(* (sqrt (/ (* n U) t_4)) (/ (* t (sqrt 2.0)) l))
(* (sqrt (* n (* U t_4))) (* 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 = (2.0 * n) * U;
double t_2 = t_1 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double t_3 = t + ((l / Om) * fma(l, -2.0, ((U_42_ - U) * (n * (l / Om)))));
double tmp;
if (t_2 <= 0.0) {
tmp = sqrt((2.0 * n) * (U * t_3));
} else if (t_2 <= 1.3834069064790994e+289) {
tmp = sqrt(t_1 * t_3);
} else {
double t_4 = ((n * U_42_) / (Om * Om)) - ((2.0 / Om) + ((n * U) / (Om * Om)));
tmp = -fma(0.5, (sqrt((n * U) / t_4) * ((t * sqrt(2.0)) / l)), (sqrt(n * (U * t_4)) * (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.0Initial program 57.4
Simplified51.6
Applied associate-*l*_binary6435.0
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.38340690647909936e289Initial program 1.6
Simplified1.3
Applied *-commutative_binary641.3
if 1.38340690647909936e289 < (*.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 62.4
Simplified55.2
Taylor expanded in l around -inf 55.6
Simplified55.6
Final simplification27.5
herbie shell --seed 2022024
(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*))))))