Average Error: 34.5 → 25.9
Time: 45.5s
Precision: binary64
Cost: 51532
\[\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 := \ell \cdot \frac{\ell}{Om}\\ t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_3 := n \cdot t_2\\ t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + t_3 \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t_4 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, t_1, t_3 \cdot \left(U - U*\right)\right)\right)}\\ \mathbf{elif}\;t_4 \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\sqrt{t_4}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;\sqrt{t - \mathsf{fma}\left(2, t_1, t_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)} \cdot \sqrt{2 \cdot \left(n \cdot U\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\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 (* l (/ l Om)))
        (t_2 (pow (/ l Om) 2.0))
        (t_3 (* n t_2))
        (t_4
         (*
          (* (* 2.0 n) U)
          (+ (+ t (* (/ (* l l) Om) -2.0)) (* t_3 (- U* U))))))
   (if (<= t_4 0.0)
     (* (sqrt (* 2.0 n)) (sqrt (* U (- t (fma 2.0 t_1 (* t_3 (- U U*)))))))
     (if (<= t_4 5e+293)
       (sqrt t_4)
       (if (<= t_4 INFINITY)
         (*
          (sqrt (- t (fma 2.0 t_1 (* t_2 (* n (- U U*))))))
          (sqrt (* 2.0 (* n U))))
         (sqrt
          (fma 2.0 (* n (* U t)) (* -4.0 (/ (* (* U l) (* n l)) Om)))))))))
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 = l * (l / Om);
	double t_2 = pow((l / Om), 2.0);
	double t_3 = n * t_2;
	double t_4 = ((2.0 * n) * U) * ((t + (((l * l) / Om) * -2.0)) + (t_3 * (U_42_ - U)));
	double tmp;
	if (t_4 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma(2.0, t_1, (t_3 * (U - U_42_))))));
	} else if (t_4 <= 5e+293) {
		tmp = sqrt(t_4);
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = sqrt((t - fma(2.0, t_1, (t_2 * (n * (U - U_42_)))))) * sqrt((2.0 * (n * U)));
	} else {
		tmp = sqrt(fma(2.0, (n * (U * t)), (-4.0 * (((U * l) * (n * l)) / Om))));
	}
	return tmp;
}
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))))
end
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l * Float64(l / Om))
	t_2 = Float64(l / Om) ^ 2.0
	t_3 = Float64(n * t_2)
	t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t + Float64(Float64(Float64(l * l) / Om) * -2.0)) + Float64(t_3 * Float64(U_42_ - U))))
	tmp = 0.0
	if (t_4 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(2.0, t_1, Float64(t_3 * Float64(U - U_42_)))))));
	elseif (t_4 <= 5e+293)
		tmp = sqrt(t_4);
	elseif (t_4 <= Inf)
		tmp = Float64(sqrt(Float64(t - fma(2.0, t_1, Float64(t_2 * Float64(n * Float64(U - U_42_)))))) * sqrt(Float64(2.0 * Float64(n * U))));
	else
		tmp = sqrt(fma(2.0, Float64(n * Float64(U * t)), Float64(-4.0 * Float64(Float64(Float64(U * l) * Float64(n * l)) / Om))));
	end
	return tmp
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(n * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t + N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(2.0 * t$95$1 + N[(t$95$3 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5e+293], N[Sqrt[t$95$4], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[Sqrt[N[(t - N[(2.0 * t$95$1 + N[(t$95$2 * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(N[(N[(U * l), $MachinePrecision] * N[(n * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]
\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 := \ell \cdot \frac{\ell}{Om}\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := n \cdot t_2\\
t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + t_3 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, t_1, t_3 \cdot \left(U - U*\right)\right)\right)}\\

\mathbf{elif}\;t_4 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\sqrt{t_4}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t - \mathsf{fma}\left(2, t_1, t_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)} \cdot \sqrt{2 \cdot \left(n \cdot U\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. 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.0

    1. Initial program 57.4

      \[\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. Applied egg-rr41.5

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

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

      [Start]41.5

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

      associate-*r* [=>]41.8

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

      *-commutative [<=]41.8

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

      *-commutative [=>]41.8

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

    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*)))) < 5.00000000000000033e293

    1. Initial program 1.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)} \]

    if 5.00000000000000033e293 < (*.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*)))) < +inf.0

    1. Initial program 62.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. Applied egg-rr50.7

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

    if +inf.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. 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. Simplified60.2

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

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

      associate-*l* [=>]64.0

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

      associate--l- [=>]64.0

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

      sub-neg [=>]64.0

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

      sub-neg [<=]64.0

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

      cancel-sign-sub [<=]64.0

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

      cancel-sign-sub [=>]64.0

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

      associate-/l* [=>]60.1

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

      associate-*l* [=>]60.2

      \[ \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \left(2 \cdot \frac{\ell}{\frac{Om}{\ell}} + \color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)\right)} \]
    3. Taylor expanded in Om around inf 58.5

      \[\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}}} \]
    4. Simplified48.1

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

      [Start]58.5

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

      fma-def [=>]58.5

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

      *-commutative [=>]58.5

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

      associate-/l* [=>]58.6

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

      associate-/r/ [=>]57.4

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

      unpow2 [=>]57.4

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

      associate-*l* [=>]48.1

      \[ \sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \left(\frac{n}{Om} \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot U\right)\right)}\right)\right)} \]
    5. Applied egg-rr39.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right) \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}\\ \mathbf{elif}\;\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right) \leq 5 \cdot 10^{+293}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{elif}\;\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right) \leq \infty:\\ \;\;\;\;\sqrt{t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, {\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(n \cdot \left(U - U*\right)\right)\right)} \cdot \sqrt{2 \cdot \left(n \cdot U\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]

Alternatives

Alternative 1
Error27.9
Cost51404
\[\begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot t_1\right) \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t_2 \leq 4 \cdot 10^{-304}:\\ \;\;\;\;{\left(e^{0.16666666666666666 \cdot \left(\log \left(\left(U \cdot t\right) \cdot -2\right) - \log \left(\frac{-1}{n}\right)\right)}\right)}^{3}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+241}:\\ \;\;\;\;\sqrt{t_2}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(t_1, n \cdot \left(U* - U\right), \mathsf{fma}\left(\ell \cdot \frac{\ell}{Om}, -2, t\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 2
Error26.8
Cost51404
\[\begin{array}{l} t_1 := \ell \cdot \frac{\ell}{Om}\\ t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_3 := n \cdot t_2\\ t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + t_3 \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t_4 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, t_1, t_3 \cdot \left(U - U*\right)\right)\right)}\\ \mathbf{elif}\;t_4 \leq 2 \cdot 10^{+241}:\\ \;\;\;\;\sqrt{t_4}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(t_2, n \cdot \left(U* - U\right), \mathsf{fma}\left(t_1, -2, t\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 3
Error27.0
Cost38540
\[\begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot t_1\right) \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t_2 \leq 4 \cdot 10^{-304}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \left(-2 \cdot \frac{\ell}{\frac{Om}{\ell}} + n \cdot \left(t_1 \cdot \left(U* - U\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\sqrt{t_2}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\ell \cdot \left(\sqrt{2} \cdot \sqrt{\left(n \cdot U\right) \cdot \left(\frac{U* - U}{Om} \cdot \frac{n}{Om} + \frac{-2}{Om}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 4
Error27.9
Cost38540
\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t_1 \leq 4 \cdot 10^{-304}:\\ \;\;\;\;{\left({\left(U \cdot \left(t \cdot -2\right)\right)}^{0.16666666666666666} \cdot {\left(\frac{-1}{n}\right)}^{-0.16666666666666666}\right)}^{3}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\sqrt{t_1}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\ell \cdot \left(\sqrt{2} \cdot \sqrt{\left(n \cdot U\right) \cdot \left(\frac{U* - U}{Om} \cdot \frac{n}{Om} + \frac{-2}{Om}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 5
Error27.9
Cost38540
\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + \frac{\ell \cdot \ell}{Om} \cdot -2\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t_1 \leq 4 \cdot 10^{-304}:\\ \;\;\;\;{\left(e^{0.16666666666666666 \cdot \left(\log \left(\left(U \cdot t\right) \cdot -2\right) - \log \left(\frac{-1}{n}\right)\right)}\right)}^{3}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\sqrt{t_1}\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\ell \cdot \left(\sqrt{2} \cdot \sqrt{\left(n \cdot U\right) \cdot \left(\frac{U* - U}{Om} \cdot \frac{n}{Om} + \frac{-2}{Om}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 6
Error31.2
Cost14672
\[\begin{array}{l} t_1 := \sqrt{\left(n \cdot U\right) \cdot \left(\frac{U* - U}{Om} \cdot \frac{n}{Om} + \frac{-2}{Om}\right)}\\ \mathbf{if}\;\ell \leq -2.35 \cdot 10^{+136}:\\ \;\;\;\;t_1 \cdot \left(\ell \cdot \left(-\sqrt{2}\right)\right)\\ \mathbf{elif}\;\ell \leq -3.1 \cdot 10^{-157}:\\ \;\;\;\;\sqrt{\left(U \cdot \left(\left(2 \cdot \frac{\ell}{\frac{Om}{\ell}} + n \cdot \left(\frac{\ell \cdot \ell}{Om} \cdot \frac{U - U*}{Om}\right)\right) - t\right)\right) \cdot \left(n \cdot -2\right)}\\ \mathbf{elif}\;\ell \leq 3.5 \cdot 10^{+193}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ \mathbf{elif}\;\ell \leq 9.4 \cdot 10^{+238}:\\ \;\;\;\;\ell \cdot \left(\sqrt{2} \cdot t_1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 7
Error31.1
Cost14672
\[\begin{array}{l} t_1 := \sqrt{\left(n \cdot U\right) \cdot \left(\frac{U* - U}{Om} \cdot \frac{n}{Om} + \frac{-2}{Om}\right)}\\ \mathbf{if}\;\ell \leq -4.8 \cdot 10^{+80}:\\ \;\;\;\;t_1 \cdot \left(\ell \cdot \left(-\sqrt{2}\right)\right)\\ \mathbf{elif}\;\ell \leq -1.05 \cdot 10^{-155}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\mathsf{fma}\left(\ell \cdot \frac{\ell}{Om}, -2, t\right) + \frac{n}{\frac{\frac{Om}{\ell}}{\ell} \cdot \frac{Om}{U*}}\right)\right)}\\ \mathbf{elif}\;\ell \leq 10^{+190}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ \mathbf{elif}\;\ell \leq 9.4 \cdot 10^{+238}:\\ \;\;\;\;\ell \cdot \left(\sqrt{2} \cdot t_1\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\mathsf{fma}\left(2, n \cdot \left(U \cdot t\right), -4 \cdot \frac{\left(U \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om}\right)}\\ \end{array} \]
Alternative 8
Error33.5
Cost14224
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ t_2 := \sqrt{\left(U \cdot \left(\left(2 \cdot \frac{\ell}{\frac{Om}{\ell}} + n \cdot \left(\frac{\ell \cdot \ell}{Om} \cdot \frac{U - U*}{Om}\right)\right) - t\right)\right) \cdot \left(n \cdot -2\right)}\\ \mathbf{if}\;Om \leq -1.8 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq -1.65 \cdot 10^{+22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;Om \leq -4.6 \cdot 10^{-280}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq 1.25 \cdot 10^{-183}:\\ \;\;\;\;\sqrt{U \cdot \left(U* - U\right)} \cdot \left(\left(n \cdot \ell\right) \cdot \frac{-\sqrt{2}}{Om}\right)\\ \mathbf{elif}\;Om \leq 2 \cdot 10^{-100}:\\ \;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(\ell \cdot \frac{2 \cdot \ell}{Om} - t\right)\right)\right)}\\ \mathbf{elif}\;Om \leq 6.6 \cdot 10^{+45}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error33.5
Cost14224
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ t_2 := \sqrt{\left(U \cdot \left(\left(2 \cdot \frac{\ell}{\frac{Om}{\ell}} + n \cdot \left(\frac{\ell \cdot \ell}{Om} \cdot \frac{U - U*}{Om}\right)\right) - t\right)\right) \cdot \left(n \cdot -2\right)}\\ \mathbf{if}\;Om \leq -7.2 \cdot 10^{+103}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq -5 \cdot 10^{+22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;Om \leq -8.5 \cdot 10^{-254}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq 9.2 \cdot 10^{-179}:\\ \;\;\;\;\sqrt{U \cdot \left(U* - U\right)} \cdot \frac{-\sqrt{2}}{\frac{Om}{n \cdot \ell}}\\ \mathbf{elif}\;Om \leq 3.5 \cdot 10^{-102}:\\ \;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(\ell \cdot \frac{2 \cdot \ell}{Om} - t\right)\right)\right)}\\ \mathbf{elif}\;Om \leq 8.4 \cdot 10^{+45}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error33.9
Cost14224
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ t_2 := \sqrt{\left(U \cdot \left(\left(2 \cdot \frac{\ell}{\frac{Om}{\ell}} + n \cdot \left(\frac{\ell \cdot \ell}{Om} \cdot \frac{U - U*}{Om}\right)\right) - t\right)\right) \cdot \left(n \cdot -2\right)}\\ \mathbf{if}\;Om \leq -3.3 \cdot 10^{+103}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq -2.05 \cdot 10^{+24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;Om \leq -4.4 \cdot 10^{-119}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq 2.9 \cdot 10^{-183}:\\ \;\;\;\;\frac{\sqrt{U \cdot \left(U* - U\right)} \cdot \left(\left(n \cdot \ell\right) \cdot \left(-\sqrt{2}\right)\right)}{Om}\\ \mathbf{elif}\;Om \leq 9 \cdot 10^{-100}:\\ \;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(\ell \cdot \frac{2 \cdot \ell}{Om} - t\right)\right)\right)}\\ \mathbf{elif}\;Om \leq 1.2 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error33.5
Cost9049
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ t_2 := \sqrt{\left(U \cdot \left(\left(2 \cdot \frac{\ell}{\frac{Om}{\ell}} + n \cdot \left(\frac{\ell \cdot \ell}{Om} \cdot \frac{U - U*}{Om}\right)\right) - t\right)\right) \cdot \left(n \cdot -2\right)}\\ \mathbf{if}\;Om \leq -2.65 \cdot 10^{+104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq -5.5 \cdot 10^{+23}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;Om \leq -2 \cdot 10^{-255}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;Om \leq 1.2 \cdot 10^{-183}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(n \cdot \left(\left(U* - U\right) \cdot \left(\frac{\ell}{Om} \cdot \frac{\ell}{\frac{Om}{U}}\right)\right)\right)\right)}\\ \mathbf{elif}\;Om \leq 4.6 \cdot 10^{-101} \lor \neg \left(Om \leq 5.4 \cdot 10^{+45}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error33.1
Cost7881
\[\begin{array}{l} \mathbf{if}\;Om \leq -5.5 \cdot 10^{-255} \lor \neg \left(Om \leq 1.12 \cdot 10^{-183}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(n \cdot \left(\left(U* - U\right) \cdot \left(\frac{\ell}{Om} \cdot \frac{\ell}{\frac{Om}{U}}\right)\right)\right)\right)}\\ \end{array} \]
Alternative 13
Error33.8
Cost7881
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.3 \cdot 10^{-15} \lor \neg \left(\ell \leq -6.6 \cdot 10^{-63}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-2 \cdot \left(\frac{\left(n \cdot \ell\right) \cdot \left(n \cdot \ell\right)}{Om} \cdot \frac{U \cdot \left(U - U*\right)}{Om}\right)}\\ \end{array} \]
Alternative 14
Error33.8
Cost7753
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.3 \cdot 10^{-15} \lor \neg \left(\ell \leq -6 \cdot 10^{-63}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(n \cdot \left(\left(\ell \cdot \frac{\ell}{Om}\right) \cdot \frac{U \cdot U*}{Om}\right)\right)\right)}\\ \end{array} \]
Alternative 15
Error33.7
Cost7753
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.3 \cdot 10^{-15} \lor \neg \left(\ell \leq -6.6 \cdot 10^{-63}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{n}{Om} \cdot \frac{\ell \cdot \left(\ell \cdot \left(U \cdot U*\right)\right)}{Om}\right)}\\ \end{array} \]
Alternative 16
Error39.0
Cost7497
\[\begin{array}{l} \mathbf{if}\;\ell \leq -7 \cdot 10^{+27} \lor \neg \left(\ell \leq 5.5 \cdot 10^{+146}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(-2 \cdot \left(\frac{n}{Om} \cdot \left(\ell \cdot \left(U \cdot \ell\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array} \]
Alternative 17
Error36.2
Cost7497
\[\begin{array}{l} \mathbf{if}\;\ell \leq -5.8 \cdot 10^{+25} \lor \neg \left(\ell \leq 8 \cdot 10^{+83}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(\frac{\ell}{Om} \cdot \left(n \cdot \ell\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array} \]
Alternative 18
Error34.0
Cost7492
\[\begin{array}{l} \mathbf{if}\;\ell \leq -7.8 \cdot 10^{+138}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(\frac{\ell}{Om} \cdot \left(n \cdot \ell\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(\ell \cdot \frac{2 \cdot \ell}{Om} - t\right)\right)\right)}\\ \end{array} \]
Alternative 19
Error34.0
Cost7492
\[\begin{array}{l} \mathbf{if}\;\ell \leq -6.8 \cdot 10^{+138}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(\frac{\ell}{Om} \cdot \left(n \cdot \ell\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t + \frac{\ell}{Om \cdot \frac{-0.5}{\ell}}\right)\right)\right)}\\ \end{array} \]
Alternative 20
Error32.9
Cost7488
\[\sqrt{2 \cdot \left(U \cdot \left(n \cdot t + \ell \cdot \left(n \cdot \frac{\frac{\ell}{Om}}{-0.5}\right)\right)\right)} \]
Alternative 21
Error40.4
Cost6848
\[\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \]

Error

Reproduce

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