Toniolo and Linder, Equation (13)

Percentage Accurate: 49.2% → 64.3%
Time: 19.6s
Alternatives: 17
Speedup: 2.0×

Specification

?
\[\begin{array}{l} \\ \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)} \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*))))))
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_)))));
}
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
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 tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))));
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]
\begin{array}{l}

\\
\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)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 49.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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)} \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*))))))
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_)))));
}
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
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 tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))));
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]
\begin{array}{l}

\\
\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)}
\end{array}

Alternative 1: 64.3% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \frac{l\_m}{Om} \cdot \left(U* - U\right)\\ t_2 := U \cdot \left(2 \cdot n\right)\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{\left(t + \frac{t\_1 \cdot \left(n \cdot l\_m\right) - 2 \cdot \left(l\_m \cdot l\_m\right)}{Om}\right) \cdot \left(2 \cdot U\right)} \cdot \sqrt{n}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(t\_1, n \cdot \frac{l\_m}{Om}, \mathsf{fma}\left(l\_m \cdot -2, \frac{l\_m}{Om}, t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(n \cdot U\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot \left(l\_m \cdot \sqrt{2}\right)\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* (/ l_m Om) (- U* U)))
        (t_2 (* U (* 2.0 n)))
        (t_3
         (sqrt
          (*
           t_2
           (+
            (- t (* 2.0 (/ (* l_m l_m) Om)))
            (* (* n (pow (/ l_m Om) 2.0)) (- U* U)))))))
   (if (<= t_3 0.0)
     (*
      (sqrt
       (* (+ t (/ (- (* t_1 (* n l_m)) (* 2.0 (* l_m l_m))) Om)) (* 2.0 U)))
      (sqrt n))
     (if (<= t_3 INFINITY)
       (sqrt
        (* t_2 (fma t_1 (* n (/ l_m Om)) (fma (* l_m -2.0) (/ l_m Om) t))))
       (*
        (sqrt (* (* n U) (- (/ (* n (- U* U)) (* Om Om)) (/ 2.0 Om))))
        (* l_m (sqrt 2.0)))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = (l_m / Om) * (U_42_ - U);
	double t_2 = U * (2.0 * n);
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + ((n * pow((l_m / Om), 2.0)) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt(((t + (((t_1 * (n * l_m)) - (2.0 * (l_m * l_m))) / Om)) * (2.0 * U))) * sqrt(n);
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * fma(t_1, (n * (l_m / Om)), fma((l_m * -2.0), (l_m / Om), t))));
	} else {
		tmp = sqrt(((n * U) * (((n * (U_42_ - U)) / (Om * Om)) - (2.0 / Om)))) * (l_m * sqrt(2.0));
	}
	return tmp;
}
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(Float64(l_m / Om) * Float64(U_42_ - U))
	t_2 = Float64(U * Float64(2.0 * n))
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(Float64(t + Float64(Float64(Float64(t_1 * Float64(n * l_m)) - Float64(2.0 * Float64(l_m * l_m))) / Om)) * Float64(2.0 * U))) * sqrt(n));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * fma(t_1, Float64(n * Float64(l_m / Om)), fma(Float64(l_m * -2.0), Float64(l_m / Om), t))));
	else
		tmp = Float64(sqrt(Float64(Float64(n * U) * Float64(Float64(Float64(n * Float64(U_42_ - U)) / Float64(Om * Om)) - Float64(2.0 / Om)))) * Float64(l_m * sqrt(2.0)));
	end
	return tmp
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l$95$m / Om), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(N[(t + N[(N[(N[(t$95$1 * N[(n * l$95$m), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(t$95$1 * N[(n * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision] + N[(N[(l$95$m * -2.0), $MachinePrecision] * N[(l$95$m / Om), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := \frac{l\_m}{Om} \cdot \left(U* - U\right)\\
t_2 := U \cdot \left(2 \cdot n\right)\\
t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\left(t + \frac{t\_1 \cdot \left(n \cdot l\_m\right) - 2 \cdot \left(l\_m \cdot l\_m\right)}{Om}\right) \cdot \left(2 \cdot U\right)} \cdot \sqrt{n}\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(t\_1, n \cdot \frac{l\_m}{Om}, \mathsf{fma}\left(l\_m \cdot -2, \frac{l\_m}{Om}, t\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\left(n \cdot U\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot \left(l\_m \cdot \sqrt{2}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 0.0

    1. Initial program 5.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\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. sub-negN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(\mathsf{neg}\left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)\right)}} \]
      3. +-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)}\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(\color{blue}{{\left(\frac{\ell}{Om}\right)}^{2}} \cdot n\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      10. unpow2N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(\color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)} \cdot n\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      11. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      12. associate-*r*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      13. lower-fma.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)}} \]
      14. lower-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}}, \frac{\ell}{Om} \cdot n, t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)} \]
      15. lower-neg.f64N/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(\left(-\left(U - U*\right)\right) \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)}} \]
    5. Taylor expanded in U around 0

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(U* + -1 \cdot U\right)} \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < +inf.0

    1. Initial program 73.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\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. sub-negN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(\mathsf{neg}\left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)\right)}} \]
      3. +-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)}\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(\color{blue}{{\left(\frac{\ell}{Om}\right)}^{2}} \cdot n\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      10. unpow2N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(\color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)} \cdot n\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      11. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      12. associate-*r*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      13. lower-fma.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)}} \]
      14. lower-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}}, \frac{\ell}{Om} \cdot n, t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)} \]
      15. lower-neg.f64N/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(\left(-\left(U - U*\right)\right) \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)}} \]
    5. Taylor expanded in U around 0

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(U* + -1 \cdot U\right)} \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

    if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))))

    1. Initial program 0.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-sqrt.f64N/A

        \[\leadsto \color{blue}{\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. lift-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{\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)}} \]
      3. *-commutativeN/A

        \[\leadsto \sqrt{\color{blue}{\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) \cdot \left(\left(2 \cdot n\right) \cdot U\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \sqrt{\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) \cdot \color{blue}{\left(\left(2 \cdot n\right) \cdot U\right)}} \]
      5. associate-*r*N/A

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

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

        \[\leadsto \sqrt{\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) \cdot \left(2 \cdot n\right)} \cdot \color{blue}{{U}^{\frac{1}{2}}} \]
      8. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\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) \cdot \left(2 \cdot n\right)} \cdot {U}^{\frac{1}{2}}} \]
    4. Applied rewrites0.1%

      \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left(\frac{\ell \cdot \ell}{Om \cdot Om} \cdot n, -\left(U - U*\right), \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right) \cdot \left(2 \cdot n\right)} \cdot \sqrt{U}} \]
    5. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)} \]
      2. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)}} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      3. associate-*r*N/A

        \[\leadsto \sqrt{\color{blue}{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)}} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)}} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      5. lower-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{\left(U \cdot n\right)} \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      6. lower--.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \color{blue}{\left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)}} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      7. lower-/.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\color{blue}{\frac{n \cdot \left(U* - U\right)}{{Om}^{2}}} - 2 \cdot \frac{1}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{\color{blue}{n \cdot \left(U* - U\right)}}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      9. lower--.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \color{blue}{\left(U* - U\right)}}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      10. unpow2N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{\color{blue}{Om \cdot Om}} - 2 \cdot \frac{1}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      11. lower-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{\color{blue}{Om \cdot Om}} - 2 \cdot \frac{1}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      12. associate-*r/N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \color{blue}{\frac{2 \cdot 1}{Om}}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      13. metadata-evalN/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \frac{\color{blue}{2}}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      14. lower-/.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \color{blue}{\frac{2}{Om}}\right)} \cdot \left(\ell \cdot \sqrt{2}\right) \]
      15. lower-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot \color{blue}{\left(\ell \cdot \sqrt{2}\right)} \]
    7. Applied rewrites60.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt{\left(U \cdot \left(2 \cdot n\right)\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)} \leq 0:\\ \;\;\;\;\sqrt{\left(t + \frac{\left(\frac{\ell}{Om} \cdot \left(U* - U\right)\right) \cdot \left(n \cdot \ell\right) - 2 \cdot \left(\ell \cdot \ell\right)}{Om}\right) \cdot \left(2 \cdot U\right)} \cdot \sqrt{n}\\ \mathbf{elif}\;\sqrt{\left(U \cdot \left(2 \cdot n\right)\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)} \leq \infty:\\ \;\;\;\;\sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot \mathsf{fma}\left(\frac{\ell}{Om} \cdot \left(U* - U\right), n \cdot \frac{\ell}{Om}, \mathsf{fma}\left(\ell \cdot -2, \frac{\ell}{Om}, t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(n \cdot U\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om \cdot Om} - \frac{2}{Om}\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 60.1% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \frac{l\_m \cdot l\_m}{Om}\\ t_2 := U \cdot \left(2 \cdot n\right)\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) + \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(-2, t\_1, t\right)\right)\right)}\\ \mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+153}:\\ \;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(l\_m \cdot l\_m, \frac{-2}{Om}, t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{Om \cdot Om}, \frac{-2}{Om}\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (/ (* l_m l_m) Om))
        (t_2 (* U (* 2.0 n)))
        (t_3
         (sqrt
          (*
           t_2
           (+ (- t (* 2.0 t_1)) (* (* n (pow (/ l_m Om) 2.0)) (- U* U)))))))
   (if (<= t_3 0.0)
     (sqrt (* 2.0 (* U (* n (fma -2.0 t_1 t)))))
     (if (<= t_3 4e+153)
       (sqrt (* t_2 (fma (* l_m l_m) (/ -2.0 Om) t)))
       (*
        (* l_m (sqrt 2.0))
        (sqrt (* (* n U) (fma n (/ (- U* U) (* Om Om)) (/ -2.0 Om)))))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = (l_m * l_m) / Om;
	double t_2 = U * (2.0 * n);
	double t_3 = sqrt((t_2 * ((t - (2.0 * t_1)) + ((n * pow((l_m / Om), 2.0)) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((2.0 * (U * (n * fma(-2.0, t_1, t)))));
	} else if (t_3 <= 4e+153) {
		tmp = sqrt((t_2 * fma((l_m * l_m), (-2.0 / Om), t)));
	} else {
		tmp = (l_m * sqrt(2.0)) * sqrt(((n * U) * fma(n, ((U_42_ - U) / (Om * Om)), (-2.0 / Om))));
	}
	return tmp;
}
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(Float64(l_m * l_m) / Om)
	t_2 = Float64(U * Float64(2.0 * n))
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) + Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * fma(-2.0, t_1, t)))));
	elseif (t_3 <= 4e+153)
		tmp = sqrt(Float64(t_2 * fma(Float64(l_m * l_m), Float64(-2.0 / Om), t)));
	else
		tmp = Float64(Float64(l_m * sqrt(2.0)) * sqrt(Float64(Float64(n * U) * fma(n, Float64(Float64(U_42_ - U) / Float64(Om * Om)), Float64(-2.0 / Om)))));
	end
	return tmp
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 4e+153], N[Sqrt[N[(t$95$2 * N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(-2.0 / Om), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(n * N[(N[(U$42$ - U), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] + N[(-2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := \frac{l\_m \cdot l\_m}{Om}\\
t_2 := U \cdot \left(2 \cdot n\right)\\
t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) + \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(-2, t\_1, t\right)\right)\right)}\\

\mathbf{elif}\;t\_3 \leq 4 \cdot 10^{+153}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(l\_m \cdot l\_m, \frac{-2}{Om}, t\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{Om \cdot Om}, \frac{-2}{Om}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 0.0

    1. Initial program 11.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. Add Preprocessing
    3. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}} \]
      2. lower-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot U\right)} \cdot \left(n \cdot t\right)} \]
      4. lower-*.f6434.8

        \[\leadsto \sqrt{\left(2 \cdot U\right) \cdot \color{blue}{\left(n \cdot t\right)}} \]
    5. Applied rewrites34.8%

      \[\leadsto \sqrt{\color{blue}{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}} \]
    6. Taylor expanded in n around 0

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \color{blue}{\left(t + \left(\mathsf{neg}\left(2\right)\right) \cdot \frac{{\ell}^{2}}{Om}\right)}\right)\right)} \]
      2. metadata-evalN/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t + \color{blue}{-2} \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
      4. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
      5. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)} \]
      6. +-commutativeN/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \color{blue}{\left(-2 \cdot \frac{{\ell}^{2}}{Om} + t\right)}\right)\right)} \]
      7. lower-fma.f64N/A

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

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

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

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(-2, \frac{\color{blue}{\ell \cdot \ell}}{Om}, t\right)\right)\right)} \]
    8. Applied rewrites38.5%

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 4e153

    1. Initial program 97.3%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(-2 \cdot \frac{{\ell}^{2}}{Om} + t\right)}} \]
      2. associate-*r/N/A

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\frac{\color{blue}{{\ell}^{2} \cdot -2}}{Om} + t\right)} \]
      4. associate-/l*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{{\ell}^{2} \cdot \frac{-2}{Om}} + t\right)} \]
      5. lower-fma.f64N/A

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

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

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

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

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

    if 4e153 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))))

    1. Initial program 20.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\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. sub-negN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(\mathsf{neg}\left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)\right)}} \]
      3. +-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(\mathsf{neg}\left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}} \]
      4. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)}\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      6. distribute-lft-neg-inN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      9. lift-pow.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(\color{blue}{{\left(\frac{\ell}{Om}\right)}^{2}} \cdot n\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      10. unpow2N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \left(\color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)} \cdot n\right) + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      11. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      12. associate-*r*N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}\right) \cdot \left(\frac{\ell}{Om} \cdot n\right)} + \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)} \]
      13. lower-fma.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)}} \]
      14. lower-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\left(U - U*\right)\right)\right) \cdot \frac{\ell}{Om}}, \frac{\ell}{Om} \cdot n, t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)} \]
      15. lower-neg.f64N/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(\left(-\left(U - U*\right)\right) \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)}} \]
    5. Taylor expanded in U around 0

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(U* + -1 \cdot U\right)} \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \mathsf{fma}\left(\color{blue}{\left(U* - U\right)} \cdot \frac{\ell}{Om}, \frac{\ell}{Om} \cdot n, \mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right)\right)} \]
    8. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\ell \cdot \sqrt{2}\right)} \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)} \]
      4. lower-sqrt.f64N/A

        \[\leadsto \left(\ell \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)\right)}} \]
      6. associate-*r*N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\left(U \cdot n\right) \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)}} \]
      8. *-commutativeN/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\left(n \cdot U\right)} \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)} \]
      9. lower-*.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\color{blue}{\left(n \cdot U\right)} \cdot \left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} - 2 \cdot \frac{1}{Om}\right)} \]
      10. sub-negN/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \color{blue}{\left(\frac{n \cdot \left(U* - U\right)}{{Om}^{2}} + \left(\mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)\right)}} \]
      11. associate-/l*N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \left(\color{blue}{n \cdot \frac{U* - U}{{Om}^{2}}} + \left(\mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \color{blue}{\mathsf{fma}\left(n, \frac{U* - U}{{Om}^{2}}, \mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)}} \]
      13. lower-/.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \color{blue}{\frac{U* - U}{{Om}^{2}}}, \mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)} \]
      14. lower--.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{\color{blue}{U* - U}}{{Om}^{2}}, \mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)} \]
      15. unpow2N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{\color{blue}{Om \cdot Om}}, \mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)} \]
      16. lower-*.f64N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{\color{blue}{Om \cdot Om}}, \mathsf{neg}\left(2 \cdot \frac{1}{Om}\right)\right)} \]
      17. associate-*r/N/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{Om \cdot Om}, \mathsf{neg}\left(\color{blue}{\frac{2 \cdot 1}{Om}}\right)\right)} \]
      18. metadata-evalN/A

        \[\leadsto \left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{Om \cdot Om}, \mathsf{neg}\left(\frac{\color{blue}{2}}{Om}\right)\right)} \]
    10. Applied rewrites44.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt{\left(U \cdot \left(2 \cdot n\right)\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)} \leq 0:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right)\right)\right)}\\ \mathbf{elif}\;\sqrt{\left(U \cdot \left(2 \cdot n\right)\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)} \leq 4 \cdot 10^{+153}:\\ \;\;\;\;\sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot \mathsf{fma}\left(\ell \cdot \ell, \frac{-2}{Om}, t\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\left(n \cdot U\right) \cdot \mathsf{fma}\left(n, \frac{U* - U}{Om \cdot Om}, \frac{-2}{Om}\right)}\\ \end{array} \]
  5. Add Preprocessing

Reproduce

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