Average Error: 34.5 → 27.2
Time: 27.6s
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 := \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{2}{Om} + \frac{n \cdot U}{Om \cdot Om}\right)\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\ \mathbf{if}\;\ell \leq -1.1876160319292441 \cdot 10^{+196}:\\ \;\;\;\;-t_1\\ \mathbf{else}:\\ \;\;\;\;\begin{array}{l} t_2 := t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\\ t_3 := \sqrt{\left(U \cdot t_2\right) \cdot \left(n \cdot 2\right)}\\ \mathbf{if}\;\ell \leq -3.387802041795301 \cdot 10^{-151}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq 2.3617478322101554 \cdot 10^{-92}:\\ \;\;\;\;\sqrt{t_2 \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\ \mathbf{elif}\;\ell \leq 9.104156765318614 \cdot 10^{+156}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array}\\ \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 := \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{2}{Om} + \frac{n \cdot U}{Om \cdot Om}\right)\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\
\mathbf{if}\;\ell \leq -1.1876160319292441 \cdot 10^{+196}:\\
\;\;\;\;-t_1\\

\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \left(n \cdot \frac{\ell}{Om}\right)\right)\\
t_3 := \sqrt{\left(U \cdot t_2\right) \cdot \left(n \cdot 2\right)}\\
\mathbf{if}\;\ell \leq -3.387802041795301 \cdot 10^{-151}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;\ell \leq 2.3617478322101554 \cdot 10^{-92}:\\
\;\;\;\;\sqrt{t_2 \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\

\mathbf{elif}\;\ell \leq 9.104156765318614 \cdot 10^{+156}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\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
         (*
          (sqrt
           (*
            n
            (*
             U
             (- (/ (* n U*) (* Om Om)) (+ (/ 2.0 Om) (/ (* n U) (* Om Om)))))))
          (* l (sqrt 2.0)))))
   (if (<= l -1.1876160319292441e+196)
     (- t_1)
     (let* ((t_2 (+ t (* (/ l Om) (fma l -2.0 (* (- U* U) (* n (/ l Om)))))))
            (t_3 (sqrt (* (* U t_2) (* n 2.0)))))
       (if (<= l -3.387802041795301e-151)
         t_3
         (if (<= l 2.3617478322101554e-92)
           (sqrt (* t_2 (* U (* n 2.0))))
           (if (<= l 9.104156765318614e+156) t_3 t_1)))))))
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 = sqrt(n * (U * (((n * U_42_) / (Om * Om)) - ((2.0 / Om) + ((n * U) / (Om * Om)))))) * (l * sqrt(2.0));
	double tmp;
	if (l <= -1.1876160319292441e+196) {
		tmp = -t_1;
	} else {
		double t_2 = t + ((l / Om) * fma(l, -2.0, ((U_42_ - U) * (n * (l / Om)))));
		double t_3 = sqrt((U * t_2) * (n * 2.0));
		double tmp_1;
		if (l <= -3.387802041795301e-151) {
			tmp_1 = t_3;
		} else if (l <= 2.3617478322101554e-92) {
			tmp_1 = sqrt(t_2 * (U * (n * 2.0)));
		} else if (l <= 9.104156765318614e+156) {
			tmp_1 = t_3;
		} else {
			tmp_1 = t_1;
		}
		tmp = tmp_1;
	}
	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 4 regimes
  2. if l < -1.18761603192924412e196

    1. Initial program 64.0

      \[\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. Simplified52.3

      \[\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. Taylor expanded in l around -inf 32.7

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{n \cdot \left(\left(\frac{n \cdot U*}{{Om}^{2}} - \left(2 \cdot \frac{1}{Om} + \frac{n \cdot U}{{Om}^{2}}\right)\right) \cdot U\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\right)} \]
    4. Simplified32.7

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

    if -1.18761603192924412e196 < l < -3.38780204179530115e-151 or 2.36174783221015537e-92 < l < 9.1041567653186144e156

    1. Initial program 32.6

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

      \[\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*_binary6427.6

      \[\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 *-commutative_binary6427.6

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

    if -3.38780204179530115e-151 < l < 2.36174783221015537e-92

    1. Initial program 25.6

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

    if 9.1041567653186144e156 < l

    1. Initial program 64.0

      \[\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. Simplified50.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. Taylor expanded in l around inf 34.0

      \[\leadsto \color{blue}{\sqrt{n \cdot \left(\left(\frac{n \cdot U*}{{Om}^{2}} - \left(2 \cdot \frac{1}{Om} + \frac{n \cdot U}{{Om}^{2}}\right)\right) \cdot U\right)} \cdot \left(\ell \cdot \sqrt{2}\right)} \]
    4. Simplified34.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.1876160319292441 \cdot 10^{+196}:\\ \;\;\;\;-\sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{2}{Om} + \frac{n \cdot U}{Om \cdot Om}\right)\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\ \mathbf{elif}\;\ell \leq -3.387802041795301 \cdot 10^{-151}:\\ \;\;\;\;\sqrt{\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) \cdot \left(n \cdot 2\right)}\\ \mathbf{elif}\;\ell \leq 2.3617478322101554 \cdot 10^{-92}:\\ \;\;\;\;\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(U \cdot \left(n \cdot 2\right)\right)}\\ \mathbf{elif}\;\ell \leq 9.104156765318614 \cdot 10^{+156}:\\ \;\;\;\;\sqrt{\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) \cdot \left(n \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{Om \cdot Om} - \left(\frac{2}{Om} + \frac{n \cdot U}{Om \cdot Om}\right)\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\ \end{array} \]

Reproduce

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