Average Error: 34.3 → 27.1
Time: 46.1s
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)\\ t_2 := t + \frac{\ell}{Om} \cdot t_1\\ \mathbf{if}\;n \leq -9.254387380680668 \cdot 10^{-304}:\\ \;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot t_2\right)}\\ \mathbf{elif}\;n \leq 1.4305959469237383 \cdot 10^{-147} \lor \neg \left(n \leq 1.2885585308675987 \cdot 10^{-44}\right):\\ \;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, t_1, t\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t_2 \cdot \left(\left(n \cdot 2\right) \cdot U\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)\\
t_2 := t + \frac{\ell}{Om} \cdot t_1\\
\mathbf{if}\;n \leq -9.254387380680668 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot t_2\right)}\\

\mathbf{elif}\;n \leq 1.4305959469237383 \cdot 10^{-147} \lor \neg \left(n \leq 1.2885585308675987 \cdot 10^{-44}\right):\\
\;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, t_1, t\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(n \cdot 2\right) \cdot U\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 (+ t (* (/ l Om) t_1))))
   (if (<= n -9.254387380680668e-304)
     (sqrt (* (* n 2.0) (* U t_2)))
     (if (or (<= n 1.4305959469237383e-147)
             (not (<= n 1.2885585308675987e-44)))
       (* (sqrt (* n 2.0)) (sqrt (* U (fma (/ l Om) t_1 t))))
       (sqrt (* t_2 (* (* n 2.0) U)))))))
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 = t + ((l / Om) * t_1);
	double tmp;
	if (n <= -9.254387380680668e-304) {
		tmp = sqrt((n * 2.0) * (U * t_2));
	} else if ((n <= 1.4305959469237383e-147) || !(n <= 1.2885585308675987e-44)) {
		tmp = sqrt(n * 2.0) * sqrt(U * fma((l / Om), t_1, t));
	} else {
		tmp = sqrt(t_2 * ((n * 2.0) * U));
	}
	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 3 regimes
  2. if n < -9.25438738068066798e-304

    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*_binary6430.0

      \[\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 *-un-lft-identity_binary6430.0

      \[\leadsto \sqrt{\color{blue}{1 \cdot \left(\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)\right)}} \]

    if -9.25438738068066798e-304 < n < 1.4305959469237383e-147 or 1.2885585308675987e-44 < n

    1. Initial program 35.2

      \[\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. Simplified31.4

      \[\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*_binary6431.0

      \[\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.4

      \[\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.4

      \[\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.4

      \[\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)}} \]

    if 1.4305959469237383e-147 < n < 1.2885585308675987e-44

    1. Initial program 33.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. Simplified28.1

      \[\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 *-commutative_binary6428.1

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \color{blue}{\left(n \cdot \frac{\ell}{Om}\right) \cdot \left(U* - U\right)}\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification27.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -9.254387380680668 \cdot 10^{-304}:\\ \;\;\;\;\sqrt{\left(n \cdot 2\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)}\\ \mathbf{elif}\;n \leq 1.4305959469237383 \cdot 10^{-147} \lor \neg \left(n \leq 1.2885585308675987 \cdot 10^{-44}\right):\\ \;\;\;\;\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)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\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) \cdot \left(\left(n \cdot 2\right) \cdot U\right)}\\ \end{array} \]

Reproduce

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