Average Error: 34.5 → 28.1
Time: 33.4s
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 -4.4145538920199726 \cdot 10^{+216}:\\ \;\;\;\;-t_1\\ \mathbf{elif}\;\ell \leq -1.2256465787638794 \cdot 10^{-250}:\\ \;\;\;\;\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}\;\ell \leq 2.5567706821104412 \cdot 10^{-89}:\\ \;\;\;\;\sqrt{\left(U \cdot \left(n \cdot 2\right)\right) \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\left(U* - U\right) \cdot \left(\ell \cdot n\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 4.97448361765691 \cdot 10^{+49}:\\ \;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \frac{\ell \cdot n}{Om}\right), t\right)\right)}\\ \mathbf{elif}\;\ell \leq 3.9495739243810636 \cdot 10^{+123}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) - 4 \cdot \frac{n \cdot \left(U \cdot {\ell}^{2}\right)}{Om}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 -4.4145538920199726 \cdot 10^{+216}:\\
\;\;\;\;-t_1\\

\mathbf{elif}\;\ell \leq -1.2256465787638794 \cdot 10^{-250}:\\
\;\;\;\;\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}\;\ell \leq 2.5567706821104412 \cdot 10^{-89}:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n \cdot 2\right)\right) \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\left(U* - U\right) \cdot \left(\ell \cdot n\right)}{Om}\right)\right)}\\

\mathbf{elif}\;\ell \leq 4.97448361765691 \cdot 10^{+49}:\\
\;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \frac{\ell \cdot n}{Om}\right), t\right)\right)}\\

\mathbf{elif}\;\ell \leq 3.9495739243810636 \cdot 10^{+123}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) - 4 \cdot \frac{n \cdot \left(U \cdot {\ell}^{2}\right)}{Om}}\\

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


\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 -4.4145538920199726e+216)
     (- t_1)
     (if (<= l -1.2256465787638794e-250)
       (sqrt
        (*
         (* n 2.0)
         (* U (+ t (* (/ l Om) (fma l -2.0 (* (- U* U) (* n (/ l Om)))))))))
       (if (<= l 2.5567706821104412e-89)
         (sqrt
          (*
           (* U (* n 2.0))
           (+ t (* (/ l Om) (fma l -2.0 (/ (* (- U* U) (* l n)) Om))))))
         (if (<= l 4.97448361765691e+49)
           (sqrt
            (*
             (* n 2.0)
             (* U (fma (/ l Om) (fma l -2.0 (* (- U* U) (/ (* l n) Om))) t))))
           (if (<= l 3.9495739243810636e+123)
             (sqrt
              (- (* 2.0 (* n (* U t))) (* 4.0 (/ (* n (* U (pow l 2.0))) Om))))
             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 <= -4.4145538920199726e+216) {
		tmp = -t_1;
	} else if (l <= -1.2256465787638794e-250) {
		tmp = sqrt((n * 2.0) * (U * (t + ((l / Om) * fma(l, -2.0, ((U_42_ - U) * (n * (l / Om))))))));
	} else if (l <= 2.5567706821104412e-89) {
		tmp = sqrt((U * (n * 2.0)) * (t + ((l / Om) * fma(l, -2.0, (((U_42_ - U) * (l * n)) / Om)))));
	} else if (l <= 4.97448361765691e+49) {
		tmp = sqrt((n * 2.0) * (U * fma((l / Om), fma(l, -2.0, ((U_42_ - U) * ((l * n) / Om))), t)));
	} else if (l <= 3.9495739243810636e+123) {
		tmp = sqrt((2.0 * (n * (U * t))) - (4.0 * ((n * (U * pow(l, 2.0))) / Om)));
	} else {
		tmp = t_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 6 regimes
  2. if l < -4.4145538920199726e216

    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. Simplified56.7

      \[\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 31.5

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

      \[\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 -4.4145538920199726e216 < l < -1.22564657876387938e-250

    1. Initial program 31.8

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

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

    if -1.22564657876387938e-250 < l < 2.5567706821104412e-89

    1. Initial program 24.7

      \[\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.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 associate-*r/_binary6424.5

      \[\leadsto \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 \color{blue}{\frac{n \cdot \ell}{Om}}\right)\right)} \]
    4. Applied associate-*r/_binary6424.7

      \[\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}{\frac{\left(U* - U\right) \cdot \left(n \cdot \ell\right)}{Om}}\right)\right)} \]

    if 2.5567706821104412e-89 < l < 4.9744836176569097e49

    1. Initial program 31.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.8

      \[\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*_binary6426.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. Simplified26.8

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

    if 4.9744836176569097e49 < l < 3.94957392438106359e123

    1. Initial program 31.5

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

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

    if 3.94957392438106359e123 < l

    1. Initial program 58.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. Simplified46.6

      \[\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 36.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. Simplified36.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 6 regimes into one program.
  4. Final simplification28.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.4145538920199726 \cdot 10^{+216}:\\ \;\;\;\;-\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 -1.2256465787638794 \cdot 10^{-250}:\\ \;\;\;\;\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}\;\ell \leq 2.5567706821104412 \cdot 10^{-89}:\\ \;\;\;\;\sqrt{\left(U \cdot \left(n \cdot 2\right)\right) \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\left(U* - U\right) \cdot \left(\ell \cdot n\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 4.97448361765691 \cdot 10^{+49}:\\ \;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \mathsf{fma}\left(\frac{\ell}{Om}, \mathsf{fma}\left(\ell, -2, \left(U* - U\right) \cdot \frac{\ell \cdot n}{Om}\right), t\right)\right)}\\ \mathbf{elif}\;\ell \leq 3.9495739243810636 \cdot 10^{+123}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) - 4 \cdot \frac{n \cdot \left(U \cdot {\ell}^{2}\right)}{Om}}\\ \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 2022103 
(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*))))))