Toniolo and Linder, Equation (13)

Percentage Accurate: 49.5% → 61.1%
Time: 28.2s
Alternatives: 19
Speedup: 1.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 19 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.5% 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: 61.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := n \cdot t\_1\\ t_4 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\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(U - U*, t\_3, \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} - \frac{n \cdot \left(U* - U\right)}{{Om}^{2}}\right)\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (pow (/ l Om) 2.0))
        (t_2 (* (* 2.0 n) U))
        (t_3 (* n t_1))
        (t_4 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* t_3 (- U* U)))))))
   (if (<= t_4 0.0)
     (*
      (sqrt (* 2.0 n))
      (sqrt (* U (- t (fma (- U U*) t_3 (/ (* 2.0 (pow l 2.0)) Om))))))
     (if (<= t_4 INFINITY)
       (sqrt (* t_2 (+ (+ t (* -2.0 (* l (/ l Om)))) (* n (* t_1 (- U* U))))))
       (sqrt
        (*
         -2.0
         (*
          U
          (*
           (pow l 2.0)
           (* n (- (* 2.0 (/ 1.0 Om)) (/ (* n (- U* U)) (pow Om 2.0))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = n * t_1;
	double t_4 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + (t_3 * (U_42_ - U)))));
	double tmp;
	if (t_4 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma((U - U_42_), t_3, ((2.0 * pow(l, 2.0)) / Om)))));
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = sqrt((-2.0 * (U * (pow(l, 2.0) * (n * ((2.0 * (1.0 / Om)) - ((n * (U_42_ - U)) / pow(Om, 2.0))))))));
	}
	return tmp;
}
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l / Om) ^ 2.0
	t_2 = Float64(Float64(2.0 * n) * U)
	t_3 = Float64(n * t_1)
	t_4 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + 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(Float64(U - U_42_), t_3, Float64(Float64(2.0 * (l ^ 2.0)) / Om))))));
	elseif (t_4 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) + Float64(n * Float64(t_1 * Float64(U_42_ - U))))));
	else
		tmp = sqrt(Float64(-2.0 * Float64(U * Float64((l ^ 2.0) * Float64(n * Float64(Float64(2.0 * Float64(1.0 / Om)) - Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0))))))));
	end
	return tmp
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(n * t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[(U$42$ - U), $MachinePrecision]), $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[(N[(U - U$42$), $MachinePrecision] * t$95$3 + N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(U * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(N[(2.0 * N[(1.0 / Om), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := n \cdot t\_1\\
t_4 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\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(U - U*, t\_3, \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}\\

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} - \frac{n \cdot \left(U* - U\right)}{{Om}^{2}}\right)\right)\right)\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 16.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. Simplified25.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod45.2%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define48.0%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, \frac{2 \cdot {\ell}^{2}}{Om}\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*))))) < +inf.0

    1. Initial program 59.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr28.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(t + \left(-2\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right)} + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      3. metadata-eval28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr67.6%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\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. Simplified10.5%

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

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

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

Alternative 2: 60.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - {\ell}^{2} \cdot \frac{2}{Om}\right)}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} - \frac{n \cdot \left(U* - U\right)}{{Om}^{2}}\right)\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (pow (/ l Om) 2.0))
        (t_2 (* (* 2.0 n) U))
        (t_3
         (sqrt
          (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U)))))))
   (if (<= t_3 0.0)
     (* (sqrt (* 2.0 n)) (sqrt (* U (- t (* (pow l 2.0) (/ 2.0 Om))))))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (+ t (* -2.0 (* l (/ l Om)))) (* n (* t_1 (- U* U))))))
       (sqrt
        (*
         -2.0
         (*
          U
          (*
           (pow l 2.0)
           (* n (- (* 2.0 (/ 1.0 Om)) (/ (* n (- U* U)) (pow Om 2.0))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - (pow(l, 2.0) * (2.0 / Om)))));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = sqrt((-2.0 * (U * (pow(l, 2.0) * (n * ((2.0 * (1.0 / Om)) - ((n * (U_42_ - U)) / pow(Om, 2.0))))))));
	}
	return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = Math.pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t - (Math.pow(l, 2.0) * (2.0 / Om)))));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = Math.sqrt((-2.0 * (U * (Math.pow(l, 2.0) * (n * ((2.0 * (1.0 / Om)) - ((n * (U_42_ - U)) / Math.pow(Om, 2.0))))))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = math.pow((l / Om), 2.0)
	t_2 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t - (math.pow(l, 2.0) * (2.0 / Om)))))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))))
	else:
		tmp = math.sqrt((-2.0 * (U * (math.pow(l, 2.0) * (n * ((2.0 * (1.0 / Om)) - ((n * (U_42_ - U)) / math.pow(Om, 2.0))))))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l / Om) ^ 2.0
	t_2 = Float64(Float64(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - Float64((l ^ 2.0) * Float64(2.0 / Om))))));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) + Float64(n * Float64(t_1 * Float64(U_42_ - U))))));
	else
		tmp = sqrt(Float64(-2.0 * Float64(U * Float64((l ^ 2.0) * Float64(n * Float64(Float64(2.0 * Float64(1.0 / Om)) - Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0))))))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l / Om) ^ 2.0;
	t_2 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - ((l ^ 2.0) * (2.0 / Om)))));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	else
		tmp = sqrt((-2.0 * (U * ((l ^ 2.0) * (n * ((2.0 * (1.0 / Om)) - ((n * (U_42_ - U)) / (Om ^ 2.0))))))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(U * N[(N[Power[l, 2.0], $MachinePrecision] * N[(n * N[(N[(2.0 * N[(1.0 / Om), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} - \frac{n \cdot \left(U* - U\right)}{{Om}^{2}}\right)\right)\right)\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 16.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. Simplified25.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod45.2%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define48.0%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative48.0%

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t - \color{blue}{\frac{2}{Om} \cdot {\ell}^{2}}\right)} \]
    10. Simplified45.3%

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\sqrt{U \cdot \left(t - \frac{2}{Om} \cdot {\ell}^{2}\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*))))) < +inf.0

    1. Initial program 59.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr28.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(t + \left(-2\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right)} + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      3. metadata-eval28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr67.6%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\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. Simplified10.5%

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

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

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

Alternative 3: 60.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - {\ell}^{2} \cdot \frac{2}{Om}\right)}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-2 \cdot \left(\left(U \cdot {\ell}^{2}\right) \cdot \left(n \cdot \left(\frac{2}{Om} + n \cdot \frac{U - U*}{{Om}^{2}}\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (pow (/ l Om) 2.0))
        (t_2 (* (* 2.0 n) U))
        (t_3
         (sqrt
          (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U)))))))
   (if (<= t_3 0.0)
     (* (sqrt (* 2.0 n)) (sqrt (* U (- t (* (pow l 2.0) (/ 2.0 Om))))))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (+ t (* -2.0 (* l (/ l Om)))) (* n (* t_1 (- U* U))))))
       (sqrt
        (*
         -2.0
         (*
          (* U (pow l 2.0))
          (* n (+ (/ 2.0 Om) (* n (/ (- U U*) (pow Om 2.0))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - (pow(l, 2.0) * (2.0 / Om)))));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = sqrt((-2.0 * ((U * pow(l, 2.0)) * (n * ((2.0 / Om) + (n * ((U - U_42_) / pow(Om, 2.0))))))));
	}
	return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = Math.pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t - (Math.pow(l, 2.0) * (2.0 / Om)))));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = Math.sqrt((-2.0 * ((U * Math.pow(l, 2.0)) * (n * ((2.0 / Om) + (n * ((U - U_42_) / Math.pow(Om, 2.0))))))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = math.pow((l / Om), 2.0)
	t_2 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t - (math.pow(l, 2.0) * (2.0 / Om)))))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))))
	else:
		tmp = math.sqrt((-2.0 * ((U * math.pow(l, 2.0)) * (n * ((2.0 / Om) + (n * ((U - U_42_) / math.pow(Om, 2.0))))))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l / Om) ^ 2.0
	t_2 = Float64(Float64(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - Float64((l ^ 2.0) * Float64(2.0 / Om))))));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) + Float64(n * Float64(t_1 * Float64(U_42_ - U))))));
	else
		tmp = sqrt(Float64(-2.0 * Float64(Float64(U * (l ^ 2.0)) * Float64(n * Float64(Float64(2.0 / Om) + Float64(n * Float64(Float64(U - U_42_) / (Om ^ 2.0))))))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l / Om) ^ 2.0;
	t_2 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - ((l ^ 2.0) * (2.0 / Om)))));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	else
		tmp = sqrt((-2.0 * ((U * (l ^ 2.0)) * (n * ((2.0 / Om) + (n * ((U - U_42_) / (Om ^ 2.0))))))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-2.0 * N[(N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(n * N[(N[(2.0 / Om), $MachinePrecision] + N[(n * N[(N[(U - U$42$), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{-2 \cdot \left(\left(U \cdot {\ell}^{2}\right) \cdot \left(n \cdot \left(\frac{2}{Om} + n \cdot \frac{U - U*}{{Om}^{2}}\right)\right)\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 16.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. Simplified25.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod45.2%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define48.0%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative48.0%

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t - \color{blue}{\frac{2}{Om} \cdot {\ell}^{2}}\right)} \]
    10. Simplified45.3%

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\sqrt{U \cdot \left(t - \frac{2}{Om} \cdot {\ell}^{2}\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*))))) < +inf.0

    1. Initial program 59.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr28.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(t + \left(-2\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right)} + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      3. metadata-eval28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr67.6%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\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. Simplified10.5%

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

      \[\leadsto \sqrt{\color{blue}{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. associate-*r*31.0%

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

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

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

        \[\leadsto \sqrt{-2 \cdot \left(\left(U \cdot {\ell}^{2}\right) \cdot \left(n \cdot \left(\frac{2}{Om} + \color{blue}{n \cdot \frac{U - U*}{{Om}^{2}}}\right)\right)\right)} \]
    6. Simplified28.8%

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

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

Alternative 4: 60.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - {\ell}^{2} \cdot \frac{2}{Om}\right)}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (pow (/ l Om) 2.0))
        (t_2 (* (* 2.0 n) U))
        (t_3
         (sqrt
          (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U)))))))
   (if (<= t_3 0.0)
     (* (sqrt (* 2.0 n)) (sqrt (* U (- t (* (pow l 2.0) (/ 2.0 Om))))))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (+ t (* -2.0 (* l (/ l Om)))) (* n (* t_1 (- U* U))))))
       (pow (* 2.0 (* (* n U) (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - (pow(l, 2.0) * (2.0 / Om)))));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = pow((2.0 * ((n * U) * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = Math.pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * (t - (Math.pow(l, 2.0) * (2.0 / Om)))));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = Math.pow((2.0 * ((n * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = math.pow((l / Om), 2.0)
	t_2 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * (t - (math.pow(l, 2.0) * (2.0 / Om)))))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))))
	else:
		tmp = math.pow((2.0 * ((n * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l / Om) ^ 2.0
	t_2 = Float64(Float64(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - Float64((l ^ 2.0) * Float64(2.0 / Om))))));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) + Float64(n * Float64(t_1 * Float64(U_42_ - U))))));
	else
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l / Om) ^ 2.0;
	t_2 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - ((l ^ 2.0) * (2.0 / Om)))));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	else
		tmp = (2.0 * ((n * U) * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\


\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 16.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. Simplified25.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod45.2%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define48.0%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative48.0%

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t - \color{blue}{\frac{2}{Om} \cdot {\ell}^{2}}\right)} \]
    10. Simplified45.3%

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\sqrt{U \cdot \left(t - \frac{2}{Om} \cdot {\ell}^{2}\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*))))) < +inf.0

    1. Initial program 59.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr28.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(t + \left(-2\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right)} + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      3. metadata-eval28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr67.6%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\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. Simplified10.5%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/228.1%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*27.1%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv27.1%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \color{blue}{\left(t + \left(-2\right) \cdot \frac{{\ell}^{2}}{Om}\right)}\right)\right)}^{0.5} \]
      4. metadata-eval27.1%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + \color{blue}{-2} \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5} \]
    6. Applied egg-rr27.1%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.7%

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

Alternative 5: 59.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (pow (/ l Om) 2.0))
        (t_2 (* (* 2.0 n) U))
        (t_3
         (sqrt
          (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U)))))))
   (if (<= t_3 0.0)
     (* (sqrt (* 2.0 n)) (sqrt (* U t)))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (+ t (* -2.0 (* l (/ l Om)))) (* n (* t_1 (- U* U))))))
       (pow (* 2.0 (* (* n U) (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = pow((2.0 * ((n * U) * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = Math.pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	} else {
		tmp = Math.pow((2.0 * ((n * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = math.pow((l / Om), 2.0)
	t_2 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))))
	else:
		tmp = math.pow((2.0 * ((n * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l / Om) ^ 2.0
	t_2 = Float64(Float64(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t)));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) + Float64(n * Float64(t_1 * Float64(U_42_ - U))))));
	else
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l / Om) ^ 2.0;
	t_2 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * (U_42_ - U))))));
	else
		tmp = (2.0 * ((n * U) * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot \left(U* - U\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\


\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 16.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. Simplified25.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod45.2%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define48.0%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative48.0%

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

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

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

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\sqrt{U \cdot t}} \]

    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 59.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr28.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(t + \left(-2\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right)} + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      3. metadata-eval28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr67.6%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\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. Simplified10.5%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/228.1%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*27.1%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv27.1%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \color{blue}{\left(t + \left(-2\right) \cdot \frac{{\ell}^{2}}{Om}\right)}\right)\right)}^{0.5} \]
      4. metadata-eval27.1%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + \color{blue}{-2} \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5} \]
    6. Applied egg-rr27.1%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.1%

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

Alternative 6: 59.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot U*\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (pow (/ l Om) 2.0))
        (t_2 (* (* 2.0 n) U))
        (t_3
         (sqrt
          (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* (* n t_1) (- U* U)))))))
   (if (<= t_3 0.0)
     (* (sqrt (* 2.0 n)) (sqrt (* U t)))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (+ t (* -2.0 (* l (/ l Om)))) (* n (* t_1 U*)))))
       (pow (* 2.0 (* (* n U) (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * U_42_)))));
	} else {
		tmp = pow((2.0 * ((n * U) * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = Math.pow((l / Om), 2.0);
	double t_2 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * U_42_)))));
	} else {
		tmp = Math.pow((2.0 * ((n * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = math.pow((l / Om), 2.0)
	t_2 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * U_42_)))))
	else:
		tmp = math.pow((2.0 * ((n * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l / Om) ^ 2.0
	t_2 = Float64(Float64(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(Float64(n * t_1) * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t)));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) + Float64(n * Float64(t_1 * U_42_)))));
	else
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l / Om) ^ 2.0;
	t_2 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + ((n * t_1) * (U_42_ - U)))));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t + (-2.0 * (l * (l / Om)))) + (n * (t_1 * U_42_)))));
	else
		tmp = (2.0 * ((n * U) * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(n * N[(t$95$1 * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + n \cdot \left(t\_1 \cdot U*\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\


\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 16.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. Simplified25.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod45.2%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define48.0%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/48.0%

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative48.0%

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

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

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

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\sqrt{U \cdot t}} \]

    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 59.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr28.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv28.0%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\color{blue}{\left(t + \left(-2\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right)} + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      3. metadata-eval28.0%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt67.5%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr67.6%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)}} \]
    7. Taylor expanded in U around 0 50.5%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \color{blue}{\left(-1 \cdot \frac{U* \cdot {\ell}^{2}}{{Om}^{2}}\right)}\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg50.5%

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

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left(-U* \cdot \frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)} \]
      5. times-frac67.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left(-U* \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)\right)} \]
      6. unpow267.5%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \color{blue}{\left(-U* \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\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. Simplified10.5%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/228.1%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*27.1%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv27.1%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \color{blue}{\left(t + \left(-2\right) \cdot \frac{{\ell}^{2}}{Om}\right)}\right)\right)}^{0.5} \]
      4. metadata-eval27.1%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + \color{blue}{-2} \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5} \]
    6. Applied egg-rr27.1%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification56.1%

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

Alternative 7: 51.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Om \leq -4 \cdot 10^{+91} \lor \neg \left(Om \leq 118000000\right):\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - n \cdot \left(U \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= Om -4e+91) (not (<= Om 118000000.0)))
   (sqrt
    (*
     (* (* 2.0 n) U)
     (- (+ t (* -2.0 (* l (/ l Om)))) (* n (* U (pow (/ l Om) 2.0))))))
   (pow (* 2.0 (* (* n U) (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -4e+91) || !(Om <= 118000000.0)) {
		tmp = sqrt((((2.0 * n) * U) * ((t + (-2.0 * (l * (l / Om)))) - (n * (U * pow((l / Om), 2.0))))));
	} else {
		tmp = pow((2.0 * ((n * U) * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
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
    real(8) :: tmp
    if ((om <= (-4d+91)) .or. (.not. (om <= 118000000.0d0))) then
        tmp = sqrt((((2.0d0 * n) * u) * ((t + ((-2.0d0) * (l * (l / om)))) - (n * (u * ((l / om) ** 2.0d0))))))
    else
        tmp = (2.0d0 * ((n * u) * (t + ((-2.0d0) * ((l ** 2.0d0) / om))))) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -4e+91) || !(Om <= 118000000.0)) {
		tmp = Math.sqrt((((2.0 * n) * U) * ((t + (-2.0 * (l * (l / Om)))) - (n * (U * Math.pow((l / Om), 2.0))))));
	} else {
		tmp = Math.pow((2.0 * ((n * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (Om <= -4e+91) or not (Om <= 118000000.0):
		tmp = math.sqrt((((2.0 * n) * U) * ((t + (-2.0 * (l * (l / Om)))) - (n * (U * math.pow((l / Om), 2.0))))))
	else:
		tmp = math.pow((2.0 * ((n * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((Om <= -4e+91) || !(Om <= 118000000.0))
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))) - Float64(n * Float64(U * (Float64(l / Om) ^ 2.0))))));
	else
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((Om <= -4e+91) || ~((Om <= 118000000.0)))
		tmp = sqrt((((2.0 * n) * U) * ((t + (-2.0 * (l * (l / Om)))) - (n * (U * ((l / Om) ^ 2.0))))));
	else
		tmp = (2.0 * ((n * U) * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[Om, -4e+91], N[Not[LessEqual[Om, 118000000.0]], $MachinePrecision]], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(n * N[(U * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -4 \cdot 10^{+91} \lor \neg \left(Om \leq 118000000\right):\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - n \cdot \left(U \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -4.00000000000000032e91 or 1.18e8 < Om

    1. Initial program 45.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. associate-*r/56.9%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      3. add-sqr-sqrt24.3%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Applied egg-rr24.3%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg24.3%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(\left(t - 2 \cdot \left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
      2. cancel-sign-sub-inv24.3%

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\sqrt{\ell} \cdot \sqrt{\ell}\right)\right)}\right) + \left(-\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)} \]
      5. add-sqr-sqrt56.9%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)\right)} \]
    6. Applied egg-rr56.9%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \color{blue}{\frac{U \cdot {\ell}^{2}}{{Om}^{2}}}\right)\right)} \]
    8. Step-by-step derivation
      1. associate-/l*39.8%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left(U \cdot \frac{\color{blue}{\ell \cdot \ell}}{{Om}^{2}}\right)\right)\right)} \]
      3. unpow239.8%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left(U \cdot \frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)} \]
      4. times-frac51.6%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) + \left(-n \cdot \left(U \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)\right)} \]
      5. unpow251.6%

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

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

    if -4.00000000000000032e91 < Om < 1.18e8

    1. Initial program 41.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. Simplified40.4%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/241.6%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*45.2%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv45.2%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \color{blue}{\left(t + \left(-2\right) \cdot \frac{{\ell}^{2}}{Om}\right)}\right)\right)}^{0.5} \]
      4. metadata-eval45.2%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + \color{blue}{-2} \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5} \]
    6. Applied egg-rr45.2%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -4 \cdot 10^{+91} \lor \neg \left(Om \leq 118000000\right):\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - n \cdot \left(U \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 54.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(n \cdot U\right)\\ \mathbf{if}\;t \leq 1.45 \cdot 10^{+182}:\\ \;\;\;\;\sqrt{t\_1 \cdot \left(t + \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right) - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t\_1} \cdot \sqrt{t}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (* 2.0 (* n U))))
   (if (<= t 1.45e+182)
     (sqrt
      (*
       t_1
       (+ t (- (* (* n (pow (/ l Om) 2.0)) (- U* U)) (* 2.0 (* l (/ l Om)))))))
     (* (sqrt t_1) (sqrt t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = 2.0 * (n * U);
	double tmp;
	if (t <= 1.45e+182) {
		tmp = sqrt((t_1 * (t + (((n * pow((l / Om), 2.0)) * (U_42_ - U)) - (2.0 * (l * (l / Om)))))));
	} else {
		tmp = sqrt(t_1) * sqrt(t);
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (n * u)
    if (t <= 1.45d+182) then
        tmp = sqrt((t_1 * (t + (((n * ((l / om) ** 2.0d0)) * (u_42 - u)) - (2.0d0 * (l * (l / om)))))))
    else
        tmp = sqrt(t_1) * sqrt(t)
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = 2.0 * (n * U);
	double tmp;
	if (t <= 1.45e+182) {
		tmp = Math.sqrt((t_1 * (t + (((n * Math.pow((l / Om), 2.0)) * (U_42_ - U)) - (2.0 * (l * (l / Om)))))));
	} else {
		tmp = Math.sqrt(t_1) * Math.sqrt(t);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = 2.0 * (n * U)
	tmp = 0
	if t <= 1.45e+182:
		tmp = math.sqrt((t_1 * (t + (((n * math.pow((l / Om), 2.0)) * (U_42_ - U)) - (2.0 * (l * (l / Om)))))))
	else:
		tmp = math.sqrt(t_1) * math.sqrt(t)
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(2.0 * Float64(n * U))
	tmp = 0.0
	if (t <= 1.45e+182)
		tmp = sqrt(Float64(t_1 * Float64(t + Float64(Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)) - Float64(2.0 * Float64(l * Float64(l / Om)))))));
	else
		tmp = Float64(sqrt(t_1) * sqrt(t));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = 2.0 * (n * U);
	tmp = 0.0;
	if (t <= 1.45e+182)
		tmp = sqrt((t_1 * (t + (((n * ((l / Om) ^ 2.0)) * (U_42_ - U)) - (2.0 * (l * (l / Om)))))));
	else
		tmp = sqrt(t_1) * sqrt(t);
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.45e+182], N[Sqrt[N[(t$95$1 * N[(t + N[(N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t$95$1], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(n \cdot U\right)\\
\mathbf{if}\;t \leq 1.45 \cdot 10^{+182}:\\
\;\;\;\;\sqrt{t\_1 \cdot \left(t + \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right) - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{t\_1} \cdot \sqrt{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.4499999999999999e182

    1. Initial program 45.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. Simplified52.2%

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

    if 1.4499999999999999e182 < t

    1. Initial program 30.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. Simplified37.1%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 37.2%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \color{blue}{\left(U \cdot t\right)}} \]
    5. Step-by-step derivation
      1. pow1/237.2%

        \[\leadsto \color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}} \]
      2. associate-*r*30.9%

        \[\leadsto {\color{blue}{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot t\right)}}^{0.5} \]
      3. unpow-prod-down58.5%

        \[\leadsto \color{blue}{{\left(\left(2 \cdot n\right) \cdot U\right)}^{0.5} \cdot {t}^{0.5}} \]
      4. pow1/258.5%

        \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot U}} \cdot {t}^{0.5} \]
      5. associate-*l*58.5%

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot U\right)}} \cdot {t}^{0.5} \]
      6. pow1/258.5%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot U\right)} \cdot \color{blue}{\sqrt{t}} \]
    6. Applied egg-rr58.5%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.45 \cdot 10^{+182}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right) - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 2.1 \cdot 10^{+183}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= t 2.1e+183)
   (pow (* 2.0 (* (* n U) (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5)
   (* (sqrt (* 2.0 (* n U))) (sqrt t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (t <= 2.1e+183) {
		tmp = pow((2.0 * ((n * U) * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
	} else {
		tmp = sqrt((2.0 * (n * U))) * sqrt(t);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (t <= 2.1d+183) then
        tmp = (2.0d0 * ((n * u) * (t + ((-2.0d0) * ((l ** 2.0d0) / om))))) ** 0.5d0
    else
        tmp = sqrt((2.0d0 * (n * u))) * sqrt(t)
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (t <= 2.1e+183) {
		tmp = Math.pow((2.0 * ((n * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
	} else {
		tmp = Math.sqrt((2.0 * (n * U))) * Math.sqrt(t);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if t <= 2.1e+183:
		tmp = math.pow((2.0 * ((n * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5)
	else:
		tmp = math.sqrt((2.0 * (n * U))) * math.sqrt(t)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (t <= 2.1e+183)
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5;
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(n * U))) * sqrt(t));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (t <= 2.1e+183)
		tmp = (2.0 * ((n * U) * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5;
	else
		tmp = sqrt((2.0 * (n * U))) * sqrt(t);
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 2.1e+183], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.1 \cdot 10^{+183}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.1e183

    1. Initial program 45.1%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified50.1%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/244.3%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*44.9%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv44.9%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \color{blue}{\left(t + \left(-2\right) \cdot \frac{{\ell}^{2}}{Om}\right)}\right)\right)}^{0.5} \]
      4. metadata-eval44.9%

        \[\leadsto {\left(2 \cdot \left(\left(U \cdot n\right) \cdot \left(t + \color{blue}{-2} \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5} \]
    6. Applied egg-rr44.9%

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

    if 2.1e183 < t

    1. Initial program 31.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. Simplified38.5%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 38.2%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \color{blue}{\left(U \cdot t\right)}} \]
    5. Step-by-step derivation
      1. pow1/238.2%

        \[\leadsto \color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}} \]
      2. associate-*r*31.7%

        \[\leadsto {\color{blue}{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot t\right)}}^{0.5} \]
      3. unpow-prod-down60.3%

        \[\leadsto \color{blue}{{\left(\left(2 \cdot n\right) \cdot U\right)}^{0.5} \cdot {t}^{0.5}} \]
      4. pow1/260.3%

        \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot U}} \cdot {t}^{0.5} \]
      5. associate-*l*60.3%

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot U\right)}} \cdot {t}^{0.5} \]
      6. pow1/260.3%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot U\right)} \cdot \color{blue}{\sqrt{t}} \]
    6. Applied egg-rr60.3%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.1 \cdot 10^{+183}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 43.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq 2.9 \cdot 10^{+75}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= n 2.9e+75)
   (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om)))))))
   (* (sqrt (* 2.0 n)) (sqrt (* U t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= 2.9e+75) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (n <= 2.9d+75) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l * l) / om)))))))
    else
        tmp = sqrt((2.0d0 * n)) * sqrt((u * t))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= 2.9e+75) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if n <= 2.9e+75:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))))
	else:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (n <= 2.9e+75)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))));
	else
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t)));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (n <= 2.9e+75)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	else
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 2.9e+75], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq 2.9 \cdot 10^{+75}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 2.8999999999999998e75

    1. Initial program 43.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. Simplified47.8%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. unpow239.5%

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
    6. Applied egg-rr39.5%

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

    if 2.8999999999999998e75 < n

    1. Initial program 44.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. Simplified54.0%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. sqrt-prod69.6%

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \left(\color{blue}{\left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)} + 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \]
      6. fma-define65.1%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \color{blue}{\mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\right)} \]
      7. associate-*r/58.2%

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

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

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

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

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

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

      \[\leadsto \sqrt{n \cdot 2} \cdot \color{blue}{\sqrt{U \cdot t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq 2.9 \cdot 10^{+75}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 45.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 1.55 \cdot 10^{+183}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= t 1.55e+183)
   (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om)))))))
   (* (sqrt (* 2.0 (* n U))) (sqrt t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (t <= 1.55e+183) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = sqrt((2.0 * (n * U))) * sqrt(t);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (t <= 1.55d+183) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l * l) / om)))))))
    else
        tmp = sqrt((2.0d0 * (n * u))) * sqrt(t)
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (t <= 1.55e+183) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = Math.sqrt((2.0 * (n * U))) * Math.sqrt(t);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if t <= 1.55e+183:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))))
	else:
		tmp = math.sqrt((2.0 * (n * U))) * math.sqrt(t)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (t <= 1.55e+183)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(n * U))) * sqrt(t));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (t <= 1.55e+183)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	else
		tmp = sqrt((2.0 * (n * U))) * sqrt(t);
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 1.55e+183], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.55 \cdot 10^{+183}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.5499999999999999e183

    1. Initial program 45.1%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified50.1%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. unpow239.3%

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
    6. Applied egg-rr39.3%

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

    if 1.5499999999999999e183 < t

    1. Initial program 31.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. Simplified38.5%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 38.2%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \color{blue}{\left(U \cdot t\right)}} \]
    5. Step-by-step derivation
      1. pow1/238.2%

        \[\leadsto \color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}} \]
      2. associate-*r*31.7%

        \[\leadsto {\color{blue}{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot t\right)}}^{0.5} \]
      3. unpow-prod-down60.3%

        \[\leadsto \color{blue}{{\left(\left(2 \cdot n\right) \cdot U\right)}^{0.5} \cdot {t}^{0.5}} \]
      4. pow1/260.3%

        \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot U}} \cdot {t}^{0.5} \]
      5. associate-*l*60.3%

        \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot U\right)}} \cdot {t}^{0.5} \]
      6. pow1/260.3%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot U\right)} \cdot \color{blue}{\sqrt{t}} \]
    6. Applied egg-rr60.3%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 44.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;U \leq 1.26 \cdot 10^{+159}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= U 1.26e+159)
   (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om)))))))
   (* (sqrt (* 2.0 U)) (sqrt (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= 1.26e+159) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = sqrt((2.0 * U)) * sqrt((n * t));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (u <= 1.26d+159) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l * l) / om)))))))
    else
        tmp = sqrt((2.0d0 * u)) * sqrt((n * t))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= 1.26e+159) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * t));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= 1.26e+159:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))))
	else:
		tmp = math.sqrt((2.0 * U)) * math.sqrt((n * t))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= 1.26e+159)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))));
	else
		tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t)));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= 1.26e+159)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	else
		tmp = sqrt((2.0 * U)) * sqrt((n * t));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, 1.26e+159], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;U \leq 1.26 \cdot 10^{+159}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < 1.2599999999999999e159

    1. Initial program 44.1%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified49.7%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. unpow238.8%

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
    6. Applied egg-rr38.8%

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

    if 1.2599999999999999e159 < U

    1. Initial program 36.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. Simplified36.9%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 36.4%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/236.4%

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}} \]
      2. associate-*r*36.4%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}}^{0.5} \]
      3. unpow-prod-down68.6%

        \[\leadsto \color{blue}{{\left(2 \cdot U\right)}^{0.5} \cdot {\left(n \cdot t\right)}^{0.5}} \]
      4. pow1/268.6%

        \[\leadsto {\left(2 \cdot U\right)}^{0.5} \cdot \color{blue}{\sqrt{n \cdot t}} \]
    6. Applied egg-rr68.6%

      \[\leadsto \color{blue}{{\left(2 \cdot U\right)}^{0.5} \cdot \sqrt{n \cdot t}} \]
    7. Step-by-step derivation
      1. unpow1/268.6%

        \[\leadsto \color{blue}{\sqrt{2 \cdot U}} \cdot \sqrt{n \cdot t} \]
    8. Simplified68.6%

      \[\leadsto \color{blue}{\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 44.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq 3.5 \cdot 10^{+76}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right|}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= n 3.5e+76)
   (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om)))))))
   (sqrt (fabs (* 2.0 (* t (* n U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= 3.5e+76) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = sqrt(fabs((2.0 * (t * (n * U)))));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (n <= 3.5d+76) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l * l) / om)))))))
    else
        tmp = sqrt(abs((2.0d0 * (t * (n * u)))))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= 3.5e+76) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	} else {
		tmp = Math.sqrt(Math.abs((2.0 * (t * (n * U)))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if n <= 3.5e+76:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))))
	else:
		tmp = math.sqrt(math.fabs((2.0 * (t * (n * U)))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (n <= 3.5e+76)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))));
	else
		tmp = sqrt(abs(Float64(2.0 * Float64(t * Float64(n * U)))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (n <= 3.5e+76)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
	else
		tmp = sqrt(abs((2.0 * (t * (n * U)))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, 3.5e+76], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[Abs[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;n \leq 3.5 \cdot 10^{+76}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right|}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 3.5e76

    1. Initial program 43.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. Simplified47.8%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. unpow239.5%

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
    6. Applied egg-rr39.5%

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

    if 3.5e76 < n

    1. Initial program 44.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. Simplified54.0%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 40.1%

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \color{blue}{\left(U \cdot t\right)}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt40.1%

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)} \cdot \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}}} \]
      2. pow1/240.1%

        \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}} \cdot \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}} \]
      3. pow1/242.4%

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5} \cdot \color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}}} \]
      4. pow-prod-down38.5%

        \[\leadsto \sqrt{\color{blue}{{\left(\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right) \cdot \left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)\right)}^{0.5}}} \]
      5. pow238.5%

        \[\leadsto \sqrt{{\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{2}\right)}}^{0.5}} \]
      6. associate-*l*38.5%

        \[\leadsto \sqrt{{\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{2}\right)}^{0.5}} \]
    6. Applied egg-rr38.5%

      \[\leadsto \sqrt{\color{blue}{{\left({\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{2}\right)}^{0.5}}} \]
    7. Step-by-step derivation
      1. unpow1/238.5%

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right) \cdot \left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}} \]
      3. rem-sqrt-square43.1%

        \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right|}} \]
      4. associate-*r*45.5%

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

      \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(\left(n \cdot U\right) \cdot t\right)\right|}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq 3.5 \cdot 10^{+76}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 43.8% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (* l l) Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
}
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 * (u * (n * (t - (2.0d0 * ((l * l) / om)))))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om)))))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l * l) / Om)))))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 43.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. Simplified48.8%

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

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
  5. Step-by-step derivation
    1. unpow238.8%

      \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
  6. Applied egg-rr38.8%

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

Alternative 15: 37.6% accurate, 2.1× speedup?

\[\begin{array}{l} \\ {\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5} \end{array} \]
(FPCore (n U t l Om U*) :precision binary64 (pow (* 2.0 (* U (* n t))) 0.5))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return pow((2.0 * (U * (n * t))), 0.5);
}
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 = (2.0d0 * (u * (n * t))) ** 0.5d0
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.pow((2.0 * (U * (n * t))), 0.5);
}
def code(n, U, t, l, Om, U_42_):
	return math.pow((2.0 * (U * (n * t))), 0.5)
function code(n, U, t, l, Om, U_42_)
	return Float64(2.0 * Float64(U * Float64(n * t))) ^ 0.5
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = (2.0 * (U * (n * t))) ^ 0.5;
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}

\\
{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 43.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. Simplified48.8%

    \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 33.0%

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  5. Step-by-step derivation
    1. pow1/234.6%

      \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}} \]
  6. Applied egg-rr34.6%

    \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}} \]
  7. Add Preprocessing

Alternative 16: 35.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \end{array} \]
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) t)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((((2.0 * n) * U) * t));
}
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))
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));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((((2.0 * n) * U) * t))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(Float64(2.0 * n) * U) * t))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((((2.0 * n) * U) * t));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}
\end{array}
Derivation
  1. Initial program 43.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. associate-*r/49.8%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    3. add-sqr-sqrt21.5%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\left(\frac{\ell}{Om} \cdot \sqrt{\ell}\right) \cdot \sqrt{\ell}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
  4. Applied egg-rr21.5%

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

    \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
  6. Add Preprocessing

Alternative 17: 35.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)} \end{array} \]
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* t (* n U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (t * (n * U))));
}
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 * (t * (n * u))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((2.0 * (t * (n * U))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (t * (n * U))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(t * Float64(n * U))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (t * (n * U))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}
\end{array}
Derivation
  1. Initial program 43.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. Simplified48.8%

    \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 33.0%

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

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
  6. Simplified33.3%

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(\left(U \cdot n\right) \cdot t\right)}} \]
  7. Final simplification33.3%

    \[\leadsto \sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)} \]
  8. Add Preprocessing

Alternative 18: 35.6% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \end{array} \]
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (U * (n * t))));
}
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 * (u * (n * t))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((2.0 * (U * (n * t))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (U * (n * t))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(n * t))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (U * (n * t))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 43.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. Simplified48.8%

    \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 33.0%

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  5. Add Preprocessing

Alternative 19: 4.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \sqrt{-2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \end{array} \]
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* -2.0 (* U (* n t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((-2.0 * (U * (n * t))));
}
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) * (u * (n * t))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((-2.0 * (U * (n * t))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((-2.0 * (U * (n * t))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(-2.0 * Float64(U * Float64(n * t))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((-2.0 * (U * (n * t))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(-2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{-2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 43.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. Simplified48.8%

    \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
  3. Add Preprocessing
  4. Taylor expanded in t around inf 33.0%

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  5. Step-by-step derivation
    1. add-sqr-sqrt33.0%

      \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
    2. pow1/233.0%

      \[\leadsto \sqrt{\color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. pow1/234.6%

      \[\leadsto \sqrt{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5} \cdot \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}}} \]
    4. pow-prod-down29.3%

      \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right) \cdot \left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)\right)}^{0.5}}} \]
    5. pow229.3%

      \[\leadsto \sqrt{{\color{blue}{\left({\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{2}\right)}}^{0.5}} \]
  6. Applied egg-rr29.3%

    \[\leadsto \sqrt{\color{blue}{{\left({\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{2}\right)}^{0.5}}} \]
  7. Step-by-step derivation
    1. unpow1/229.3%

      \[\leadsto \sqrt{\color{blue}{\sqrt{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{2}}}} \]
  8. Simplified29.3%

    \[\leadsto \sqrt{\color{blue}{\sqrt{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{2}}}} \]
  9. Taylor expanded in U around -inf 5.1%

    \[\leadsto \sqrt{\color{blue}{-2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  10. Add Preprocessing

Reproduce

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