Toniolo and Linder, Equation (13)

Percentage Accurate: 50.1% → 65.5%
Time: 32.3s
Alternatives: 14
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 14 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: 50.1% 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: 65.5% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.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 7.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. Simplified30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.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 70.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. Simplified75.0%

      \[\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 +inf.0 < (*.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. Simplified4.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 62.0% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + {l\_m}^{2} \cdot \frac{U \cdot \left(n \cdot \frac{U* - U}{Om}\right) - 2 \cdot U}{Om}\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*))))) < 9.99999999999999989e-160

    1. Initial program 10.9%

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999989e-160 < (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 70.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. Simplified75.1%

      \[\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 +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.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 65.0% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.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 7.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. Simplified30.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.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 70.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. Simplified75.0%

      \[\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 +inf.0 < (*.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. Simplified4.2%

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

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

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

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

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

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

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

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

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

Alternative 4: 52.2% accurate, 0.9× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 2.2 \cdot 10^{-115}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\ \mathbf{elif}\;l\_m \leq 2 \cdot 10^{+157} \lor \neg \left(l\_m \leq 6.2 \cdot 10^{+196}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + {l\_m}^{2} \cdot \frac{U \cdot \left(n \cdot \frac{U* - U}{Om}\right) - 2 \cdot U}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \frac{l\_m \cdot \sqrt{U \cdot \left(n \cdot U*\right)}}{Om}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= l_m 2.2e-115)
   (sqrt (* 2.0 (* n (* U t))))
   (if (or (<= l_m 2e+157) (not (<= l_m 6.2e+196)))
     (sqrt
      (*
       2.0
       (*
        n
        (+
         (* U t)
         (* (pow l_m 2.0) (/ (- (* U (* n (/ (- U* U) Om))) (* 2.0 U)) Om))))))
     (* (sqrt (* 2.0 n)) (/ (* l_m (sqrt (* U (* n U*)))) Om)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (l_m <= 2.2e-115) {
		tmp = sqrt((2.0 * (n * (U * t))));
	} else if ((l_m <= 2e+157) || !(l_m <= 6.2e+196)) {
		tmp = sqrt((2.0 * (n * ((U * t) + (pow(l_m, 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))));
	} else {
		tmp = sqrt((2.0 * n)) * ((l_m * sqrt((U * (n * U_42_)))) / Om);
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (l_m <= 2.2d-115) then
        tmp = sqrt((2.0d0 * (n * (u * t))))
    else if ((l_m <= 2d+157) .or. (.not. (l_m <= 6.2d+196))) then
        tmp = sqrt((2.0d0 * (n * ((u * t) + ((l_m ** 2.0d0) * (((u * (n * ((u_42 - u) / om))) - (2.0d0 * u)) / om))))))
    else
        tmp = sqrt((2.0d0 * n)) * ((l_m * sqrt((u * (n * u_42)))) / om)
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (l_m <= 2.2e-115) {
		tmp = Math.sqrt((2.0 * (n * (U * t))));
	} else if ((l_m <= 2e+157) || !(l_m <= 6.2e+196)) {
		tmp = Math.sqrt((2.0 * (n * ((U * t) + (Math.pow(l_m, 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))));
	} else {
		tmp = Math.sqrt((2.0 * n)) * ((l_m * Math.sqrt((U * (n * U_42_)))) / Om);
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if l_m <= 2.2e-115:
		tmp = math.sqrt((2.0 * (n * (U * t))))
	elif (l_m <= 2e+157) or not (l_m <= 6.2e+196):
		tmp = math.sqrt((2.0 * (n * ((U * t) + (math.pow(l_m, 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))))
	else:
		tmp = math.sqrt((2.0 * n)) * ((l_m * math.sqrt((U * (n * U_42_)))) / Om)
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (l_m <= 2.2e-115)
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t))));
	elseif ((l_m <= 2e+157) || !(l_m <= 6.2e+196))
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(Float64(U * t) + Float64((l_m ^ 2.0) * Float64(Float64(Float64(U * Float64(n * Float64(Float64(U_42_ - U) / Om))) - Float64(2.0 * U)) / Om))))));
	else
		tmp = Float64(sqrt(Float64(2.0 * n)) * Float64(Float64(l_m * sqrt(Float64(U * Float64(n * U_42_)))) / Om));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0;
	if (l_m <= 2.2e-115)
		tmp = sqrt((2.0 * (n * (U * t))));
	elseif ((l_m <= 2e+157) || ~((l_m <= 6.2e+196)))
		tmp = sqrt((2.0 * (n * ((U * t) + ((l_m ^ 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))));
	else
		tmp = sqrt((2.0 * n)) * ((l_m * sqrt((U * (n * U_42_)))) / Om);
	end
	tmp_2 = tmp;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 2.2e-115], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 2e+157], N[Not[LessEqual[l$95$m, 6.2e+196]], $MachinePrecision]], N[Sqrt[N[(2.0 * N[(n * N[(N[(U * t), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(N[(U * N[(n * N[(N[(U$42$ - U), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[(N[(l$95$m * N[Sqrt[N[(U * N[(n * U$42$), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.2 \cdot 10^{-115}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\

\mathbf{elif}\;l\_m \leq 2 \cdot 10^{+157} \lor \neg \left(l\_m \leq 6.2 \cdot 10^{+196}\right):\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + {l\_m}^{2} \cdot \frac{U \cdot \left(n \cdot \frac{U* - U}{Om}\right) - 2 \cdot U}{Om}\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.1999999999999999e-115

    1. Initial program 55.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. Simplified57.0%

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

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

    if 2.1999999999999999e-115 < l < 1.99999999999999997e157 or 6.2000000000000002e196 < l

    1. Initial program 53.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. Simplified55.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999997e157 < l < 6.2000000000000002e196

    1. Initial program 10.9%

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

      \[\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-prod9.8%

        \[\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-undefine9.8%

        \[\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*9.8%

        \[\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. fma-define9.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.2 \cdot 10^{-115}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\ \mathbf{elif}\;\ell \leq 2 \cdot 10^{+157} \lor \neg \left(\ell \leq 6.2 \cdot 10^{+196}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + {\ell}^{2} \cdot \frac{U \cdot \left(n \cdot \frac{U* - U}{Om}\right) - 2 \cdot U}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \frac{\ell \cdot \sqrt{U \cdot \left(n \cdot U*\right)}}{Om}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 51.5% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 2.8 \cdot 10^{-195}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\ \mathbf{elif}\;l\_m \leq 10^{+46}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + \frac{{l\_m}^{2} \cdot \left(\frac{U \cdot \left(n \cdot \left(U* - U\right)\right)}{Om} - 2 \cdot U\right)}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + {l\_m}^{2} \cdot \frac{U \cdot \left(n \cdot \frac{U* - U}{Om}\right) - 2 \cdot U}{Om}\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= l_m 2.8e-195)
   (sqrt (fabs (* 2.0 (* U (* n t)))))
   (if (<= l_m 1e+46)
     (sqrt
      (*
       2.0
       (*
        n
        (+
         (* U t)
         (/ (* (pow l_m 2.0) (- (/ (* U (* n (- U* U))) Om) (* 2.0 U))) Om)))))
     (sqrt
      (*
       2.0
       (*
        n
        (+
         (* U t)
         (*
          (pow l_m 2.0)
          (/ (- (* U (* n (/ (- U* U) Om))) (* 2.0 U)) Om)))))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (l_m <= 2.8e-195) {
		tmp = sqrt(fabs((2.0 * (U * (n * t)))));
	} else if (l_m <= 1e+46) {
		tmp = sqrt((2.0 * (n * ((U * t) + ((pow(l_m, 2.0) * (((U * (n * (U_42_ - U))) / Om) - (2.0 * U))) / Om)))));
	} else {
		tmp = sqrt((2.0 * (n * ((U * t) + (pow(l_m, 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))));
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (l_m <= 2.8d-195) then
        tmp = sqrt(abs((2.0d0 * (u * (n * t)))))
    else if (l_m <= 1d+46) then
        tmp = sqrt((2.0d0 * (n * ((u * t) + (((l_m ** 2.0d0) * (((u * (n * (u_42 - u))) / om) - (2.0d0 * u))) / om)))))
    else
        tmp = sqrt((2.0d0 * (n * ((u * t) + ((l_m ** 2.0d0) * (((u * (n * ((u_42 - u) / om))) - (2.0d0 * u)) / om))))))
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (l_m <= 2.8e-195) {
		tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
	} else if (l_m <= 1e+46) {
		tmp = Math.sqrt((2.0 * (n * ((U * t) + ((Math.pow(l_m, 2.0) * (((U * (n * (U_42_ - U))) / Om) - (2.0 * U))) / Om)))));
	} else {
		tmp = Math.sqrt((2.0 * (n * ((U * t) + (Math.pow(l_m, 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if l_m <= 2.8e-195:
		tmp = math.sqrt(math.fabs((2.0 * (U * (n * t)))))
	elif l_m <= 1e+46:
		tmp = math.sqrt((2.0 * (n * ((U * t) + ((math.pow(l_m, 2.0) * (((U * (n * (U_42_ - U))) / Om) - (2.0 * U))) / Om)))))
	else:
		tmp = math.sqrt((2.0 * (n * ((U * t) + (math.pow(l_m, 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (l_m <= 2.8e-195)
		tmp = sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t)))));
	elseif (l_m <= 1e+46)
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(Float64(U * t) + Float64(Float64((l_m ^ 2.0) * Float64(Float64(Float64(U * Float64(n * Float64(U_42_ - U))) / Om) - Float64(2.0 * U))) / Om)))));
	else
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(Float64(U * t) + Float64((l_m ^ 2.0) * Float64(Float64(Float64(U * Float64(n * Float64(Float64(U_42_ - U) / Om))) - Float64(2.0 * U)) / Om))))));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0;
	if (l_m <= 2.8e-195)
		tmp = sqrt(abs((2.0 * (U * (n * t)))));
	elseif (l_m <= 1e+46)
		tmp = sqrt((2.0 * (n * ((U * t) + (((l_m ^ 2.0) * (((U * (n * (U_42_ - U))) / Om) - (2.0 * U))) / Om)))));
	else
		tmp = sqrt((2.0 * (n * ((U * t) + ((l_m ^ 2.0) * (((U * (n * ((U_42_ - U) / Om))) - (2.0 * U)) / Om))))));
	end
	tmp_2 = tmp;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[l$95$m, 2.8e-195], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1e+46], N[Sqrt[N[(2.0 * N[(n * N[(N[(U * t), $MachinePrecision] + N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(N[(U * N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] - N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(n * N[(N[(U * t), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(N[(N[(U * N[(n * N[(N[(U$42$ - U), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.8 \cdot 10^{-195}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\

\mathbf{elif}\;l\_m \leq 10^{+46}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t + \frac{{l\_m}^{2} \cdot \left(\frac{U \cdot \left(n \cdot \left(U* - U\right)\right)}{Om} - 2 \cdot U\right)}{Om}\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.80000000000000003e-195

    1. Initial program 54.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. add-sqr-sqrt43.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(\color{blue}{1.5 \cdot 0.3333333333333333} + 0.5\right)}} \]
      5. metadata-eval41.1%

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333 + \color{blue}{1.5 \cdot 0.3333333333333333}\right)}} \]
      6. pow-prod-up41.1%

        \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)} \cdot {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      7. pow-prod-down34.1%

        \[\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)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      8. pow234.1%

        \[\leadsto \sqrt{{\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{2}\right)}}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      9. associate-*l*34.1%

        \[\leadsto \sqrt{{\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{2}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      10. metadata-eval34.1%

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

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

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

        \[\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-square41.7%

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

        \[\leadsto \sqrt{\left|2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right|} \]
      5. *-commutative42.6%

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

        \[\leadsto \sqrt{\left|2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}\right|} \]
    11. Simplified44.1%

      \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}} \]

    if 2.80000000000000003e-195 < l < 9.9999999999999999e45

    1. Initial program 70.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. Simplified65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999999e45 < l

    1. Initial program 29.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. Simplified41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 44.9% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;n \leq -2.5 \cdot 10^{+206}:\\ \;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\ \mathbf{elif}\;n \leq 3950000:\\ \;\;\;\;\sqrt{U \cdot \left(-4 \cdot \frac{n \cdot {l\_m}^{2}}{Om} + 2 \cdot \left(n \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= n -2.5e+206)
   (pow (pow (* 2.0 (* t (* n U))) 3.0) 0.16666666666666666)
   (if (<= n 3950000.0)
     (sqrt (* U (+ (* -4.0 (/ (* n (pow l_m 2.0)) Om)) (* 2.0 (* n t)))))
     (* (sqrt (* 2.0 n)) (sqrt (* U t))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (n <= -2.5e+206) {
		tmp = pow(pow((2.0 * (t * (n * U))), 3.0), 0.16666666666666666);
	} else if (n <= 3950000.0) {
		tmp = sqrt((U * ((-4.0 * ((n * pow(l_m, 2.0)) / Om)) + (2.0 * (n * t)))));
	} else {
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (n <= (-2.5d+206)) then
        tmp = ((2.0d0 * (t * (n * u))) ** 3.0d0) ** 0.16666666666666666d0
    else if (n <= 3950000.0d0) then
        tmp = sqrt((u * (((-4.0d0) * ((n * (l_m ** 2.0d0)) / om)) + (2.0d0 * (n * t)))))
    else
        tmp = sqrt((2.0d0 * n)) * sqrt((u * t))
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (n <= -2.5e+206) {
		tmp = Math.pow(Math.pow((2.0 * (t * (n * U))), 3.0), 0.16666666666666666);
	} else if (n <= 3950000.0) {
		tmp = Math.sqrt((U * ((-4.0 * ((n * Math.pow(l_m, 2.0)) / Om)) + (2.0 * (n * t)))));
	} else {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if n <= -2.5e+206:
		tmp = math.pow(math.pow((2.0 * (t * (n * U))), 3.0), 0.16666666666666666)
	elif n <= 3950000.0:
		tmp = math.sqrt((U * ((-4.0 * ((n * math.pow(l_m, 2.0)) / Om)) + (2.0 * (n * t)))))
	else:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (n <= -2.5e+206)
		tmp = (Float64(2.0 * Float64(t * Float64(n * U))) ^ 3.0) ^ 0.16666666666666666;
	elseif (n <= 3950000.0)
		tmp = sqrt(Float64(U * Float64(Float64(-4.0 * Float64(Float64(n * (l_m ^ 2.0)) / Om)) + Float64(2.0 * Float64(n * t)))));
	else
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t)));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0;
	if (n <= -2.5e+206)
		tmp = ((2.0 * (t * (n * U))) ^ 3.0) ^ 0.16666666666666666;
	elseif (n <= 3950000.0)
		tmp = sqrt((U * ((-4.0 * ((n * (l_m ^ 2.0)) / Om)) + (2.0 * (n * t)))));
	else
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	end
	tmp_2 = tmp;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[n, -2.5e+206], N[Power[N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision], If[LessEqual[n, 3950000.0], N[Sqrt[N[(U * N[(N[(-4.0 * N[(N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(n * t), $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}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.5 \cdot 10^{+206}:\\
\;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\

\mathbf{elif}\;n \leq 3950000:\\
\;\;\;\;\sqrt{U \cdot \left(-4 \cdot \frac{n \cdot {l\_m}^{2}}{Om} + 2 \cdot \left(n \cdot t\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -2.5000000000000001e206

    1. Initial program 47.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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt38.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}}^{0.5} \]
      3. metadata-eval31.8%

        \[\leadsto {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      4. pow-pow31.7%

        \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
      5. sqr-pow31.7%

        \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \cdot {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} \]
      6. pow-prod-down31.7%

        \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5} \cdot {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} \]
      7. pow-prod-up44.2%

        \[\leadsto {\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 + 1.5\right)}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      8. metadata-eval44.2%

        \[\leadsto {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\color{blue}{3}}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      9. associate-*l*44.2%

        \[\leadsto {\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{3}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      10. metadata-eval44.2%

        \[\leadsto {\left({\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{3}\right)}^{\color{blue}{0.16666666666666666}} \]
    9. Applied egg-rr44.2%

      \[\leadsto \color{blue}{{\left({\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{3}\right)}^{0.16666666666666666}} \]
    10. Step-by-step derivation
      1. associate-*r*44.3%

        \[\leadsto {\left({\left(2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right)}^{3}\right)}^{0.16666666666666666} \]
      2. *-commutative44.3%

        \[\leadsto {\left({\left(2 \cdot \left(\color{blue}{\left(U \cdot n\right)} \cdot t\right)\right)}^{3}\right)}^{0.16666666666666666} \]
    11. Simplified44.3%

      \[\leadsto \color{blue}{{\left({\left(2 \cdot \left(\left(U \cdot n\right) \cdot t\right)\right)}^{3}\right)}^{0.16666666666666666}} \]

    if -2.5000000000000001e206 < n < 3.95e6

    1. Initial program 51.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. Simplified53.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 Om around inf 46.7%

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

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

    if 3.95e6 < n

    1. Initial program 59.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. Simplified63.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. Step-by-step derivation
      1. sqrt-prod73.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-undefine73.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*71.2%

        \[\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. fma-define71.2%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.9% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;n \leq -3.7 \cdot 10^{+224}:\\ \;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\ \mathbf{elif}\;n \leq 11000000:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= n -3.7e+224)
   (pow (pow (* 2.0 (* t (* n U))) 3.0) 0.16666666666666666)
   (if (<= n 11000000.0)
     (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l_m 2.0) Om)))))))
     (* (sqrt (* 2.0 n)) (sqrt (* U t))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (n <= -3.7e+224) {
		tmp = pow(pow((2.0 * (t * (n * U))), 3.0), 0.16666666666666666);
	} else if (n <= 11000000.0) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l_m, 2.0) / Om)))))));
	} else {
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (n <= (-3.7d+224)) then
        tmp = ((2.0d0 * (t * (n * u))) ** 3.0d0) ** 0.16666666666666666d0
    else if (n <= 11000000.0d0) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l_m ** 2.0d0) / om)))))))
    else
        tmp = sqrt((2.0d0 * n)) * sqrt((u * t))
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (n <= -3.7e+224) {
		tmp = Math.pow(Math.pow((2.0 * (t * (n * U))), 3.0), 0.16666666666666666);
	} else if (n <= 11000000.0) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l_m, 2.0) / Om)))))));
	} else {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if n <= -3.7e+224:
		tmp = math.pow(math.pow((2.0 * (t * (n * U))), 3.0), 0.16666666666666666)
	elif n <= 11000000.0:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l_m, 2.0) / Om)))))))
	else:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (n <= -3.7e+224)
		tmp = (Float64(2.0 * Float64(t * Float64(n * U))) ^ 3.0) ^ 0.16666666666666666;
	elseif (n <= 11000000.0)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l_m ^ 2.0) / Om)))))));
	else
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t)));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0;
	if (n <= -3.7e+224)
		tmp = ((2.0 * (t * (n * U))) ^ 3.0) ^ 0.16666666666666666;
	elseif (n <= 11000000.0)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l_m ^ 2.0) / Om)))))));
	else
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	end
	tmp_2 = tmp;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[n, -3.7e+224], N[Power[N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.16666666666666666], $MachinePrecision], If[LessEqual[n, 11000000.0], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[Power[l$95$m, 2.0], $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}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.7 \cdot 10^{+224}:\\
\;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\

\mathbf{elif}\;n \leq 11000000:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -3.70000000000000003e224

    1. Initial program 46.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt41.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      4. pow-pow37.3%

        \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
      5. sqr-pow37.3%

        \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \cdot {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} \]
      6. pow-prod-down37.3%

        \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5} \cdot {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{\left(\frac{0.3333333333333333}{2}\right)}} \]
      7. pow-prod-up52.3%

        \[\leadsto {\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 + 1.5\right)}\right)}}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      8. metadata-eval52.3%

        \[\leadsto {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\color{blue}{3}}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      9. associate-*l*52.3%

        \[\leadsto {\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{3}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      10. metadata-eval52.3%

        \[\leadsto {\left({\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{3}\right)}^{\color{blue}{0.16666666666666666}} \]
    9. Applied egg-rr52.3%

      \[\leadsto \color{blue}{{\left({\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{3}\right)}^{0.16666666666666666}} \]
    10. Step-by-step derivation
      1. associate-*r*52.3%

        \[\leadsto {\left({\left(2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right)}^{3}\right)}^{0.16666666666666666} \]
      2. *-commutative52.3%

        \[\leadsto {\left({\left(2 \cdot \left(\color{blue}{\left(U \cdot n\right)} \cdot t\right)\right)}^{3}\right)}^{0.16666666666666666} \]
    11. Simplified52.3%

      \[\leadsto \color{blue}{{\left({\left(2 \cdot \left(\left(U \cdot n\right) \cdot t\right)\right)}^{3}\right)}^{0.16666666666666666}} \]

    if -3.70000000000000003e224 < n < 1.1e7

    1. Initial program 51.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. Simplified53.2%

      \[\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 45.7%

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

    if 1.1e7 < n

    1. Initial program 59.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. Simplified63.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. Step-by-step derivation
      1. sqrt-prod73.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-undefine73.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*71.2%

        \[\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. fma-define71.2%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 40.6% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;U \leq -9 \cdot 10^{-20}:\\ \;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\ \mathbf{elif}\;U \leq -2.9 \cdot 10^{-66}:\\ \;\;\;\;\frac{\sqrt{U \cdot U*} \cdot \left(l\_m \cdot \left(n \cdot \left(-\sqrt{2}\right)\right)\right)}{Om}\\ \mathbf{elif}\;U \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= U -9e-20)
   (pow (pow (* 2.0 (* t (* n U))) 0.25) 2.0)
   (if (<= U -2.9e-66)
     (/ (* (sqrt (* U U*)) (* l_m (* n (- (sqrt 2.0))))) Om)
     (if (<= U -1e-310)
       (sqrt (fabs (* 2.0 (* U (* n t)))))
       (* (sqrt (* 2.0 U)) (sqrt (* n t)))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (U <= -9e-20) {
		tmp = pow(pow((2.0 * (t * (n * U))), 0.25), 2.0);
	} else if (U <= -2.9e-66) {
		tmp = (sqrt((U * U_42_)) * (l_m * (n * -sqrt(2.0)))) / Om;
	} else if (U <= -1e-310) {
		tmp = sqrt(fabs((2.0 * (U * (n * t)))));
	} else {
		tmp = sqrt((2.0 * U)) * sqrt((n * t));
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (u <= (-9d-20)) then
        tmp = ((2.0d0 * (t * (n * u))) ** 0.25d0) ** 2.0d0
    else if (u <= (-2.9d-66)) then
        tmp = (sqrt((u * u_42)) * (l_m * (n * -sqrt(2.0d0)))) / om
    else if (u <= (-1d-310)) then
        tmp = sqrt(abs((2.0d0 * (u * (n * t)))))
    else
        tmp = sqrt((2.0d0 * u)) * sqrt((n * t))
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (U <= -9e-20) {
		tmp = Math.pow(Math.pow((2.0 * (t * (n * U))), 0.25), 2.0);
	} else if (U <= -2.9e-66) {
		tmp = (Math.sqrt((U * U_42_)) * (l_m * (n * -Math.sqrt(2.0)))) / Om;
	} else if (U <= -1e-310) {
		tmp = Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
	} else {
		tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * t));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if U <= -9e-20:
		tmp = math.pow(math.pow((2.0 * (t * (n * U))), 0.25), 2.0)
	elif U <= -2.9e-66:
		tmp = (math.sqrt((U * U_42_)) * (l_m * (n * -math.sqrt(2.0)))) / Om
	elif U <= -1e-310:
		tmp = math.sqrt(math.fabs((2.0 * (U * (n * t)))))
	else:
		tmp = math.sqrt((2.0 * U)) * math.sqrt((n * t))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (U <= -9e-20)
		tmp = (Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.25) ^ 2.0;
	elseif (U <= -2.9e-66)
		tmp = Float64(Float64(sqrt(Float64(U * U_42_)) * Float64(l_m * Float64(n * Float64(-sqrt(2.0))))) / Om);
	elseif (U <= -1e-310)
		tmp = sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t)))));
	else
		tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t)));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0;
	if (U <= -9e-20)
		tmp = ((2.0 * (t * (n * U))) ^ 0.25) ^ 2.0;
	elseif (U <= -2.9e-66)
		tmp = (sqrt((U * U_42_)) * (l_m * (n * -sqrt(2.0)))) / Om;
	elseif (U <= -1e-310)
		tmp = sqrt(abs((2.0 * (U * (n * t)))));
	else
		tmp = sqrt((2.0 * U)) * sqrt((n * t));
	end
	tmp_2 = tmp;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[U, -9e-20], N[Power[N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[U, -2.9e-66], N[(N[(N[Sqrt[N[(U * U$42$), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[(n * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision], If[LessEqual[U, -1e-310], N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $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}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;U \leq -9 \cdot 10^{-20}:\\
\;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\

\mathbf{elif}\;U \leq -2.9 \cdot 10^{-66}:\\
\;\;\;\;\frac{\sqrt{U \cdot U*} \cdot \left(l\_m \cdot \left(n \cdot \left(-\sqrt{2}\right)\right)\right)}{Om}\\

\mathbf{elif}\;U \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if U < -9.0000000000000003e-20

    1. Initial program 72.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. Simplified69.2%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}}\right)}^{2}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity53.6%

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

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

        \[\leadsto {\left(1 \cdot {\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}\right)}}^{0.5}\right)}^{2} \]
      4. metadata-eval53.7%

        \[\leadsto {\left(1 \cdot {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{0.5}\right)}^{2} \]
      5. metadata-eval53.7%

        \[\leadsto {\left(1 \cdot {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{2} \]
      6. pow-pow53.7%

        \[\leadsto {\left(1 \cdot \color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(\left(1.5 \cdot 0.3333333333333333\right) \cdot \left(1.5 \cdot 0.3333333333333333\right)\right)}}\right)}^{2} \]
      7. associate-*l*53.7%

        \[\leadsto {\left(1 \cdot {\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{\left(\left(1.5 \cdot 0.3333333333333333\right) \cdot \left(1.5 \cdot 0.3333333333333333\right)\right)}\right)}^{2} \]
      8. metadata-eval53.7%

        \[\leadsto {\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{\left(\color{blue}{0.5} \cdot \left(1.5 \cdot 0.3333333333333333\right)\right)}\right)}^{2} \]
      9. metadata-eval53.7%

        \[\leadsto {\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{\left(0.5 \cdot \color{blue}{0.5}\right)}\right)}^{2} \]
      10. metadata-eval53.7%

        \[\leadsto {\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    8. Applied egg-rr53.7%

      \[\leadsto {\color{blue}{\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.25}\right)}}^{2} \]
    9. Step-by-step derivation
      1. *-lft-identity53.7%

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

        \[\leadsto {\left({\left(2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right)}^{0.25}\right)}^{2} \]
      3. *-commutative56.8%

        \[\leadsto {\left({\left(2 \cdot \left(\color{blue}{\left(U \cdot n\right)} \cdot t\right)\right)}^{0.25}\right)}^{2} \]
    10. Simplified56.8%

      \[\leadsto {\color{blue}{\left({\left(2 \cdot \left(\left(U \cdot n\right) \cdot t\right)\right)}^{0.25}\right)}}^{2} \]

    if -9.0000000000000003e-20 < U < -2.90000000000000011e-66

    1. Initial program 43.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. Simplified43.2%

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

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

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

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

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

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

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

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

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

    if -2.90000000000000011e-66 < U < -9.999999999999969e-311

    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. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt35.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1}}} \]
      3. metadata-eval26.4%

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

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(\color{blue}{1.5 \cdot 0.3333333333333333} + 0.5\right)}} \]
      5. metadata-eval26.4%

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333 + \color{blue}{1.5 \cdot 0.3333333333333333}\right)}} \]
      6. pow-prod-up27.8%

        \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)} \cdot {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      7. pow-prod-down22.0%

        \[\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)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      8. pow222.0%

        \[\leadsto \sqrt{{\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{2}\right)}}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      9. associate-*l*22.0%

        \[\leadsto \sqrt{{\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{2}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      10. metadata-eval22.0%

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

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

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

        \[\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-square29.0%

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}} \]

    if -9.999999999999969e-311 < U

    1. Initial program 48.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. Simplified50.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -9 \cdot 10^{-20}:\\ \;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\ \mathbf{elif}\;U \leq -2.9 \cdot 10^{-66}:\\ \;\;\;\;\frac{\sqrt{U \cdot U*} \cdot \left(\ell \cdot \left(n \cdot \left(-\sqrt{2}\right)\right)\right)}{Om}\\ \mathbf{elif}\;U \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 40.5% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;U \leq -1 \cdot 10^{-310}:\\ \;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= U -1e-310)
   (pow (pow (* 2.0 (* t (* n U))) 0.25) 2.0)
   (* (sqrt (* 2.0 U)) (sqrt (* n t)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (U <= -1e-310) {
		tmp = pow(pow((2.0 * (t * (n * U))), 0.25), 2.0);
	} else {
		tmp = sqrt((2.0 * U)) * sqrt((n * t));
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (u <= (-1d-310)) then
        tmp = ((2.0d0 * (t * (n * u))) ** 0.25d0) ** 2.0d0
    else
        tmp = sqrt((2.0d0 * u)) * sqrt((n * t))
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (U <= -1e-310) {
		tmp = Math.pow(Math.pow((2.0 * (t * (n * U))), 0.25), 2.0);
	} else {
		tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * t));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if U <= -1e-310:
		tmp = math.pow(math.pow((2.0 * (t * (n * U))), 0.25), 2.0)
	else:
		tmp = math.sqrt((2.0 * U)) * math.sqrt((n * t))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (U <= -1e-310)
		tmp = (Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.25) ^ 2.0;
	else
		tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * t)));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0;
	if (U <= -1e-310)
		tmp = ((2.0 * (t * (n * U))) ^ 0.25) ^ 2.0;
	else
		tmp = sqrt((2.0 * U)) * sqrt((n * t));
	end
	tmp_2 = tmp;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[U, -1e-310], N[Power[N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;U \leq -1 \cdot 10^{-310}:\\
\;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\

\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 < -9.999999999999969e-311

    1. Initial program 56.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. Simplified59.6%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}}\right)}^{2}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity37.0%

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

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

        \[\leadsto {\left(1 \cdot {\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}\right)}}^{0.5}\right)}^{2} \]
      4. metadata-eval37.8%

        \[\leadsto {\left(1 \cdot {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{0.5}\right)}^{2} \]
      5. metadata-eval37.8%

        \[\leadsto {\left(1 \cdot {\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{2} \]
      6. pow-pow37.8%

        \[\leadsto {\left(1 \cdot \color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(\left(1.5 \cdot 0.3333333333333333\right) \cdot \left(1.5 \cdot 0.3333333333333333\right)\right)}}\right)}^{2} \]
      7. associate-*l*37.8%

        \[\leadsto {\left(1 \cdot {\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{\left(\left(1.5 \cdot 0.3333333333333333\right) \cdot \left(1.5 \cdot 0.3333333333333333\right)\right)}\right)}^{2} \]
      8. metadata-eval37.8%

        \[\leadsto {\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{\left(\color{blue}{0.5} \cdot \left(1.5 \cdot 0.3333333333333333\right)\right)}\right)}^{2} \]
      9. metadata-eval37.8%

        \[\leadsto {\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{\left(0.5 \cdot \color{blue}{0.5}\right)}\right)}^{2} \]
      10. metadata-eval37.8%

        \[\leadsto {\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2} \]
    8. Applied egg-rr37.8%

      \[\leadsto {\color{blue}{\left(1 \cdot {\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.25}\right)}}^{2} \]
    9. Step-by-step derivation
      1. *-lft-identity37.8%

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

        \[\leadsto {\left({\left(2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right)}^{0.25}\right)}^{2} \]
      3. *-commutative39.1%

        \[\leadsto {\left({\left(2 \cdot \left(\color{blue}{\left(U \cdot n\right)} \cdot t\right)\right)}^{0.25}\right)}^{2} \]
    10. Simplified39.1%

      \[\leadsto {\color{blue}{\left({\left(2 \cdot \left(\left(U \cdot n\right) \cdot t\right)\right)}^{0.25}\right)}}^{2} \]

    if -9.999999999999969e-311 < U

    1. Initial program 48.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. Simplified50.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -1 \cdot 10^{-310}:\\ \;\;\;\;{\left({\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.25}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 41.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\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 < -9.999999999999969e-311

    1. Initial program 56.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. add-sqr-sqrt44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(\color{blue}{1.5 \cdot 0.3333333333333333} + 0.5\right)}} \]
      5. metadata-eval37.1%

        \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333 + \color{blue}{1.5 \cdot 0.3333333333333333}\right)}} \]
      6. pow-prod-up37.9%

        \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)} \cdot {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      7. pow-prod-down31.7%

        \[\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)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      8. pow231.7%

        \[\leadsto \sqrt{{\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{2}\right)}}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      9. associate-*l*31.7%

        \[\leadsto \sqrt{{\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{2}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      10. metadata-eval31.7%

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

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

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

        \[\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-square38.8%

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

        \[\leadsto \sqrt{\left|2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right|} \]
      5. *-commutative40.1%

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

        \[\leadsto \sqrt{\left|2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}\right|} \]
    11. Simplified39.0%

      \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}} \]

    if -9.999999999999969e-311 < U

    1. Initial program 48.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. Simplified50.8%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 39.2% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (sqrt (fabs (* 2.0 (* U (* n t))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return sqrt(fabs((2.0 * (U * (n * t)))));
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt(abs((2.0d0 * (u * (n * t)))))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return Math.sqrt(Math.abs((2.0 * (U * (n * t)))));
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.sqrt(math.fabs((2.0 * (U * (n * t)))))
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return sqrt(abs(Float64(2.0 * Float64(U * Float64(n * t)))))
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = sqrt(abs((2.0 * (U * (n * t)))));
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[Abs[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}
\end{array}
Derivation
  1. Initial program 52.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. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt40.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(\color{blue}{1.5 \cdot 0.3333333333333333} + 0.5\right)}} \]
    5. metadata-eval36.1%

      \[\leadsto \sqrt{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333 + \color{blue}{1.5 \cdot 0.3333333333333333}\right)}} \]
    6. pow-prod-up36.9%

      \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)} \cdot {\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
    7. pow-prod-down30.8%

      \[\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)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
    8. pow230.8%

      \[\leadsto \sqrt{{\color{blue}{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{2}\right)}}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
    9. associate-*l*30.8%

      \[\leadsto \sqrt{{\left({\color{blue}{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}}^{2}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
    10. metadata-eval30.8%

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

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

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

      \[\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-square37.8%

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

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

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

      \[\leadsto \sqrt{\left|2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}\right|} \]
  11. Simplified39.1%

    \[\leadsto \sqrt{\color{blue}{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}} \]
  12. Final simplification39.1%

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

Alternative 12: 38.5% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ {\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*) :precision binary64 (pow (* 2.0 (* U (* n t))) 0.5))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return pow((2.0 * (U * (n * t))), 0.5);
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = (2.0d0 * (u * (n * t))) ** 0.5d0
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return Math.pow((2.0 * (U * (n * t))), 0.5);
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.pow((2.0 * (U * (n * t))), 0.5)
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return Float64(2.0 * Float64(U * Float64(n * t))) ^ 0.5
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = (2.0 * (U * (n * t))) ^ 0.5;
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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

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

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

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

Alternative 13: 36.4% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return sqrt((2.0 * (U * (n * t))));
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt((2.0d0 * (u * (n * t))))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return Math.sqrt((2.0 * (U * (n * t))));
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.sqrt((2.0 * (U * (n * t))))
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(n * t))))
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = sqrt((2.0 * (U * (n * t))));
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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

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

Alternative 14: 36.3% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* (* U (* 2.0 n)) t)))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return sqrt(((U * (2.0 * n)) * t));
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt(((u * (2.0d0 * n)) * t))
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	return Math.sqrt(((U * (2.0 * n)) * t));
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.sqrt(((U * (2.0 * n)) * t))
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return sqrt(Float64(Float64(U * Float64(2.0 * n)) * t))
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = sqrt(((U * (2.0 * n)) * t));
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(N[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t}
\end{array}
Derivation
  1. Initial program 52.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. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt40.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
  8. Final simplification37.4%

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

Reproduce

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