Average Error: 35.2 → 26.0
Time: 23.9s
Precision: binary64
\[\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)\\ \mathbf{if}\;n \leq -3.3237963005013 \cdot 10^{-310} \lor \neg \left(n \leq 7.784525183033184 \cdot 10^{-158}\right) \land n \leq 3.838171893007447 \cdot 10^{+113}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\frac{\ell}{Om} \cdot \left(U \cdot t_1\right) + U \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, t_1, t\right)}\\ \end{array} \]
\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)\\
\mathbf{if}\;n \leq -3.3237963005013 \cdot 10^{-310} \lor \neg \left(n \leq 7.784525183033184 \cdot 10^{-158}\right) \land n \leq 3.838171893007447 \cdot 10^{+113}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\frac{\ell}{Om} \cdot \left(U \cdot t_1\right) + U \cdot t\right)\right)}\\

\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))))))
   (if (or (<= n -3.3237963005013e-310)
           (and (not (<= n 7.784525183033184e-158))
                (<= n 3.838171893007447e+113)))
     (sqrt (* 2.0 (* n (+ (* (/ l Om) (* U t_1)) (* U t)))))
     (* (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 tmp;
	if ((n <= -3.3237963005013e-310) || (!(n <= 7.784525183033184e-158) && (n <= 3.838171893007447e+113))) {
		tmp = sqrt(2.0 * (n * (((l / Om) * (U * t_1)) + (U * t))));
	} else {
		tmp = sqrt(n * 2.0) * sqrt(U * fma((l / Om), t_1, t));
	}
	return tmp;
}

Error

Bits error versus n

Bits error versus U

Bits error versus t

Bits error versus l

Bits error versus Om

Bits error versus U*

Derivation

  1. Split input into 2 regimes
  2. if n < -3.32379630050132e-310 or 7.78452518303318418e-158 < n < 3.8381718930074469e113

    1. Initial program 33.9

      \[\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)} \]
    2. Simplified29.9

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}} \]
    3. Applied associate-*l*_binary6429.5

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}} \]
    4. Applied associate-*l*_binary6429.6

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)\right)}} \]
    5. Simplified29.6

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(n \cdot \left(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)\right)\right)}} \]
    6. Applied fma-udef_binary6429.6

      \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(U \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right) + t\right)}\right)\right)} \]
    7. Applied distribute-rgt-in_binary6429.6

      \[\leadsto \sqrt{2 \cdot \left(n \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right) \cdot U + t \cdot U\right)}\right)} \]
    8. Applied associate-*l*_binary6427.0

      \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(\color{blue}{\frac{\ell}{Om} \cdot \left(\mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right) \cdot U\right)} + t \cdot U\right)\right)} \]

    if -3.32379630050132e-310 < n < 7.78452518303318418e-158 or 3.8381718930074469e113 < n

    1. Initial program 39.1

      \[\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)} \]
    2. Simplified35.5

      \[\leadsto \color{blue}{\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}} \]
    3. Applied associate-*l*_binary6435.1

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)\right)}} \]
    4. Applied sqrt-prod_binary6423.3

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)}} \]
    5. Simplified23.3

      \[\leadsto \color{blue}{\sqrt{n \cdot 2}} \cdot \sqrt{U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right)} \]
    6. Simplified23.3

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\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)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification26.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3.3237963005013 \cdot 10^{-310} \lor \neg \left(n \leq 7.784525183033184 \cdot 10^{-158}\right) \land n \leq 3.838171893007447 \cdot 10^{+113}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\frac{\ell}{Om} \cdot \left(U \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\right) + U \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot 2} \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)}\\ \end{array} \]

Reproduce

herbie shell --seed 2021313 
(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*))))))