Toniolo and Linder, Equation (13)

Percentage Accurate: 49.1% → 65.2%
Time: 31.5s
Alternatives: 16
Speedup: 1.6×

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 16 alternatives:

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

Initial Program: 49.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.2% 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(\left(2 \cdot n\right) \cdot U\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{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{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}:\\ \;\;\;\;\sqrt{U \cdot \frac{n \cdot -2 + \frac{{n}^{2} \cdot \left(U* - U\right)}{Om}}{Om}} \cdot \left(l\_m \cdot \sqrt{2}\right)\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* (* n (pow (/ l_m Om) 2.0)) (- U* U)))
        (t_2 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1))))
   (if (<= t_2 0.0)
     (sqrt (* (* 2.0 n) (* U (- t (/ (* 2.0 (pow l_m 2.0)) Om)))))
     (if (<= t_2 INFINITY)
       (sqrt (* (* 2.0 (* n U)) (+ t (- t_1 (* 2.0 (* l_m (/ l_m Om)))))))
       (*
        (sqrt (* U (/ (+ (* n -2.0) (/ (* (pow n 2.0) (- U* U)) Om)) Om)))
        (* l_m (sqrt 2.0)))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = (n * pow((l_m / Om), 2.0)) * (U_42_ - U);
	double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1);
	double tmp;
	if (t_2 <= 0.0) {
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * pow(l_m, 2.0)) / 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 = sqrt((U * (((n * -2.0) + ((pow(n, 2.0) * (U_42_ - U)) / Om)) / Om))) * (l_m * sqrt(2.0));
	}
	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 = ((2.0 * n) * U) * ((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 - ((2.0 * Math.pow(l_m, 2.0)) / 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 = Math.sqrt((U * (((n * -2.0) + ((Math.pow(n, 2.0) * (U_42_ - U)) / Om)) / Om))) * (l_m * Math.sqrt(2.0));
	}
	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 = ((2.0 * n) * U) * ((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 - ((2.0 * math.pow(l_m, 2.0)) / 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 = math.sqrt((U * (((n * -2.0) + ((math.pow(n, 2.0) * (U_42_ - U)) / Om)) / Om))) * (l_m * math.sqrt(2.0))
	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(Float64(2.0 * n) * U) * 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(Float64(2.0 * n) * Float64(U * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / 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(sqrt(Float64(U * Float64(Float64(Float64(n * -2.0) + Float64(Float64((n ^ 2.0) * Float64(U_42_ - U)) / Om)) / Om))) * Float64(l_m * sqrt(2.0)));
	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 = ((2.0 * n) * U) * ((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 - ((2.0 * (l_m ^ 2.0)) / Om)))));
	elseif (t_2 <= Inf)
		tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l_m * (l_m / Om)))))));
	else
		tmp = sqrt((U * (((n * -2.0) + (((n ^ 2.0) * (U_42_ - U)) / Om)) / Om))) * (l_m * sqrt(2.0));
	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[(N[(2.0 * n), $MachinePrecision] * U), $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[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $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[Sqrt[N[(U * N[(N[(N[(n * -2.0), $MachinePrecision] + N[(N[(N[Power[n, 2.0], $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(\left(2 \cdot n\right) \cdot U\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{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{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}:\\
\;\;\;\;\sqrt{U \cdot \frac{n \cdot -2 + \frac{{n}^{2} \cdot \left(U* - U\right)}{Om}}{Om}} \cdot \left(l\_m \cdot \sqrt{2}\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 10.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. Simplified30.4%

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

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

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

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

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

    if +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. 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 l around inf 23.6%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/34.3%

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

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

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

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

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

Alternative 2: 64.4% 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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1\right)}\\ \mathbf{if}\;t\_2 \leq 10^{-161}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\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{U \cdot \left(n \cdot \left(n \cdot \left(\left(U* - U\right) \cdot {Om}^{-2}\right) - \frac{2}{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 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1)))))
   (if (<= t_2 1e-161)
     (* (sqrt (* 2.0 U)) (sqrt (* n (- t (/ (* 2.0 (pow l_m 2.0)) 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 (* U (* n (- (* 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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_2 <= 1e-161) {
		tmp = sqrt((2.0 * U)) * sqrt((n * (t - ((2.0 * pow(l_m, 2.0)) / 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((U * (n * ((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 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_2 <= 1e-161) {
		tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * (t - ((2.0 * Math.pow(l_m, 2.0)) / 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((U * (n * ((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 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)))
	tmp = 0
	if t_2 <= 1e-161:
		tmp = math.sqrt((2.0 * U)) * math.sqrt((n * (t - ((2.0 * math.pow(l_m, 2.0)) / 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((U * (n * ((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 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_1)))
	tmp = 0.0
	if (t_2 <= 1e-161)
		tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / 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(U * Float64(n * 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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	tmp = 0.0;
	if (t_2 <= 1e-161)
		tmp = sqrt((2.0 * U)) * sqrt((n * (t - ((2.0 * (l_m ^ 2.0)) / 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((U * (n * ((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[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $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-161], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $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[(U * N[(n * 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]), $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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1\right)}\\
\mathbf{if}\;t\_2 \leq 10^{-161}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\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{U \cdot \left(n \cdot \left(n \cdot \left(\left(U* - U\right) \cdot {Om}^{-2}\right) - \frac{2}{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*))))) < 1.00000000000000003e-161

    1. Initial program 11.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. Simplified11.4%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*11.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000003e-161 < (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 61.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. Simplified68.4%

      \[\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. Simplified12.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 inf 24.2%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/34.2%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 64.4% 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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1\right)}\\ \mathbf{if}\;t\_2 \leq 10^{-161}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\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{U \cdot \left(n \cdot \left(n \cdot \left(U* \cdot {Om}^{-2}\right) - \frac{2}{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 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1)))))
   (if (<= t_2 1e-161)
     (* (sqrt (* 2.0 U)) (sqrt (* n (- t (/ (* 2.0 (pow l_m 2.0)) 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 (* U (* n (- (* n (* 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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_2 <= 1e-161) {
		tmp = sqrt((2.0 * U)) * sqrt((n * (t - ((2.0 * pow(l_m, 2.0)) / 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((U * (n * ((n * (U_42_ * 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 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_2 <= 1e-161) {
		tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * (t - ((2.0 * Math.pow(l_m, 2.0)) / 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((U * (n * ((n * (U_42_ * 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 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)))
	tmp = 0
	if t_2 <= 1e-161:
		tmp = math.sqrt((2.0 * U)) * math.sqrt((n * (t - ((2.0 * math.pow(l_m, 2.0)) / 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((U * (n * ((n * (U_42_ * 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 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_1)))
	tmp = 0.0
	if (t_2 <= 1e-161)
		tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / 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(U * Float64(n * Float64(Float64(n * Float64(U_42_ * (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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	tmp = 0.0;
	if (t_2 <= 1e-161)
		tmp = sqrt((2.0 * U)) * sqrt((n * (t - ((2.0 * (l_m ^ 2.0)) / 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((U * (n * ((n * (U_42_ * (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[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $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-161], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $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[(U * N[(n * N[(N[(n * N[(U$42$ * N[Power[Om, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / 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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1\right)}\\
\mathbf{if}\;t\_2 \leq 10^{-161}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\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{U \cdot \left(n \cdot \left(n \cdot \left(U* \cdot {Om}^{-2}\right) - \frac{2}{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*))))) < 1.00000000000000003e-161

    1. Initial program 11.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. Simplified11.4%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*11.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000003e-161 < (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 61.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. Simplified68.4%

      \[\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. Simplified12.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 inf 24.2%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/34.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 59.9% 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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1\right)}\\ \mathbf{if}\;t\_2 \leq 10^{-161}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\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{U \cdot \frac{n \cdot -2}{Om}}\\ \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 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1)))))
   (if (<= t_2 1e-161)
     (* (sqrt (* 2.0 U)) (sqrt (* n (- t (/ (* 2.0 (pow l_m 2.0)) 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 (* U (/ (* n -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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_2 <= 1e-161) {
		tmp = sqrt((2.0 * U)) * sqrt((n * (t - ((2.0 * pow(l_m, 2.0)) / 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((U * ((n * -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 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_2 <= 1e-161) {
		tmp = Math.sqrt((2.0 * U)) * Math.sqrt((n * (t - ((2.0 * Math.pow(l_m, 2.0)) / 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((U * ((n * -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 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)))
	tmp = 0
	if t_2 <= 1e-161:
		tmp = math.sqrt((2.0 * U)) * math.sqrt((n * (t - ((2.0 * math.pow(l_m, 2.0)) / 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((U * ((n * -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 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_1)))
	tmp = 0.0
	if (t_2 <= 1e-161)
		tmp = Float64(sqrt(Float64(2.0 * U)) * sqrt(Float64(n * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / 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(U * Float64(Float64(n * -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 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	tmp = 0.0;
	if (t_2 <= 1e-161)
		tmp = sqrt((2.0 * U)) * sqrt((n * (t - ((2.0 * (l_m ^ 2.0)) / 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((U * ((n * -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[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $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-161], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $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[(U * N[(N[(n * -2.0), $MachinePrecision] / Om), $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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1\right)}\\
\mathbf{if}\;t\_2 \leq 10^{-161}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\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{U \cdot \frac{n \cdot -2}{Om}}\\


\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*))))) < 1.00000000000000003e-161

    1. Initial program 11.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. Simplified11.4%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*11.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000003e-161 < (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 61.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. Simplified68.4%

      \[\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. Simplified12.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 inf 24.2%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/34.2%

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

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

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

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

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

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

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

Alternative 5: 65.2% 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(\left(2 \cdot n\right) \cdot U\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{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{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{U \cdot \frac{n \cdot -2 + \frac{U* \cdot {n}^{2}}{Om}}{Om}}\\ \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 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1))))
   (if (<= t_2 0.0)
     (sqrt (* (* 2.0 n) (* U (- t (/ (* 2.0 (pow l_m 2.0)) 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 (* U (/ (+ (* n -2.0) (/ (* U* (pow n 2.0)) Om)) 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 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1);
	double tmp;
	if (t_2 <= 0.0) {
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * pow(l_m, 2.0)) / 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((U * (((n * -2.0) + ((U_42_ * pow(n, 2.0)) / Om)) / 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 = ((2.0 * n) * U) * ((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 - ((2.0 * Math.pow(l_m, 2.0)) / 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((U * (((n * -2.0) + ((U_42_ * Math.pow(n, 2.0)) / Om)) / 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 = ((2.0 * n) * U) * ((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 - ((2.0 * math.pow(l_m, 2.0)) / 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((U * (((n * -2.0) + ((U_42_ * math.pow(n, 2.0)) / Om)) / 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(Float64(2.0 * n) * U) * 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(Float64(2.0 * n) * Float64(U * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / 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(U * Float64(Float64(Float64(n * -2.0) + Float64(Float64(U_42_ * (n ^ 2.0)) / Om)) / 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 = ((2.0 * n) * U) * ((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 - ((2.0 * (l_m ^ 2.0)) / 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((U * (((n * -2.0) + ((U_42_ * (n ^ 2.0)) / Om)) / 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[(N[(2.0 * n), $MachinePrecision] * U), $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[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $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[(U * N[(N[(N[(n * -2.0), $MachinePrecision] + N[(N[(U$42$ * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] / Om), $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(\left(2 \cdot n\right) \cdot U\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{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{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{U \cdot \frac{n \cdot -2 + \frac{U* \cdot {n}^{2}}{Om}}{Om}}\\


\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 10.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. Simplified30.4%

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

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

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

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

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

    if +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. 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 l around inf 23.6%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/34.3%

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

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

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

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

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

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

Alternative 6: 64.3% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{Om}\right)\right)}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+301}:\\ \;\;\;\;\sqrt{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \frac{2}{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
         (*
          (* (* 2.0 n) U)
          (+
           (- t (* 2.0 (/ (* l_m l_m) Om)))
           (* (* n (pow (/ l_m Om) 2.0)) (- U* U))))))
   (if (<= t_1 0.0)
     (sqrt (* (* 2.0 n) (* U (- t (/ (* 2.0 (pow l_m 2.0)) Om)))))
     (if (<= t_1 2e+301)
       (sqrt t_1)
       (*
        (* l_m (sqrt 2.0))
        (sqrt (* n (* U (- (/ (* n 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 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + ((n * pow((l_m / Om), 2.0)) * (U_42_ - U)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * pow(l_m, 2.0)) / Om)))));
	} else if (t_1 <= 2e+301) {
		tmp = sqrt(t_1);
	} else {
		tmp = (l_m * sqrt(2.0)) * sqrt((n * (U * (((n * U_42_) / pow(Om, 2.0)) - (2.0 / 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) :: t_1
    real(8) :: tmp
    t_1 = ((2.0d0 * n) * u) * ((t - (2.0d0 * ((l_m * l_m) / om))) + ((n * ((l_m / om) ** 2.0d0)) * (u_42 - u)))
    if (t_1 <= 0.0d0) then
        tmp = sqrt(((2.0d0 * n) * (u * (t - ((2.0d0 * (l_m ** 2.0d0)) / om)))))
    else if (t_1 <= 2d+301) then
        tmp = sqrt(t_1)
    else
        tmp = (l_m * sqrt(2.0d0)) * sqrt((n * (u * (((n * u_42) / (om ** 2.0d0)) - (2.0d0 / 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 t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + ((n * Math.pow((l_m / Om), 2.0)) * (U_42_ - U)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t - ((2.0 * Math.pow(l_m, 2.0)) / Om)))));
	} else if (t_1 <= 2e+301) {
		tmp = Math.sqrt(t_1);
	} else {
		tmp = (l_m * Math.sqrt(2.0)) * Math.sqrt((n * (U * (((n * U_42_) / 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 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + ((n * math.pow((l_m / Om), 2.0)) * (U_42_ - U)))
	tmp = 0
	if t_1 <= 0.0:
		tmp = math.sqrt(((2.0 * n) * (U * (t - ((2.0 * math.pow(l_m, 2.0)) / Om)))))
	elif t_1 <= 2e+301:
		tmp = math.sqrt(t_1)
	else:
		tmp = (l_m * math.sqrt(2.0)) * math.sqrt((n * (U * (((n * U_42_) / 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(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U_42_ - U))))
	tmp = 0.0
	if (t_1 <= 0.0)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / Om)))));
	elseif (t_1 <= 2e+301)
		tmp = sqrt(t_1);
	else
		tmp = Float64(Float64(l_m * sqrt(2.0)) * sqrt(Float64(n * Float64(U * Float64(Float64(Float64(n * U_42_) / (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 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + ((n * ((l_m / Om) ^ 2.0)) * (U_42_ - U)));
	tmp = 0.0;
	if (t_1 <= 0.0)
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * (l_m ^ 2.0)) / Om)))));
	elseif (t_1 <= 2e+301)
		tmp = sqrt(t_1);
	else
		tmp = (l_m * sqrt(2.0)) * sqrt((n * (U * (((n * U_42_) / (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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 2e+301], N[Sqrt[t$95$1], $MachinePrecision], N[(N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(n * N[(U * N[(N[(N[(n * U$42$), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{n \cdot \left(U \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \frac{2}{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 10.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. Simplified30.4%

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

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

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \color{blue}{\frac{2 \cdot {\ell}^{2}}{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*)))) < 2.00000000000000011e301

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

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

    1. Initial program 20.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. Simplified31.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 inf 24.0%

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

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

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

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

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

      \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(U \cdot \color{blue}{\left({\ell}^{2} \cdot \left(\frac{t}{{\ell}^{2}} + \left(n \cdot \frac{U* - U}{{Om}^{2}} - \frac{2}{Om}\right)\right)\right)}\right)\right)} \]
    7. Taylor expanded in l around inf 21.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)} \]
    8. Step-by-step derivation
      1. associate-*r/21.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.8% accurate, 0.5× 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(\left(2 \cdot n\right) \cdot U\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{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{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{U \cdot \frac{n \cdot -2}{Om}}\\ \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 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1))))
   (if (<= t_2 0.0)
     (sqrt (* (* 2.0 n) (* U (- t (/ (* 2.0 (pow l_m 2.0)) 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 (* U (/ (* n -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 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1);
	double tmp;
	if (t_2 <= 0.0) {
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * pow(l_m, 2.0)) / 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((U * ((n * -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 = ((2.0 * n) * U) * ((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 - ((2.0 * Math.pow(l_m, 2.0)) / 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((U * ((n * -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 = ((2.0 * n) * U) * ((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 - ((2.0 * math.pow(l_m, 2.0)) / 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((U * ((n * -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(Float64(2.0 * n) * U) * 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(Float64(2.0 * n) * Float64(U * Float64(t - Float64(Float64(2.0 * (l_m ^ 2.0)) / 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(U * Float64(Float64(n * -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 = ((2.0 * n) * U) * ((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 - ((2.0 * (l_m ^ 2.0)) / 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((U * ((n * -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[(N[(2.0 * n), $MachinePrecision] * U), $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[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(N[(2.0 * N[Power[l$95$m, 2.0], $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[(U * N[(N[(n * -2.0), $MachinePrecision] / Om), $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(\left(2 \cdot n\right) \cdot U\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{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {l\_m}^{2}}{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{U \cdot \frac{n \cdot -2}{Om}}\\


\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 10.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. Simplified30.4%

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

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

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

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

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

    if +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. 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 l around inf 23.6%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/34.3%

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

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

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

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

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

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

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

Alternative 8: 52.8% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -4.99999999999999989e101

    1. Initial program 46.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. Simplified54.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 l around 0 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\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)}}} \]
      3. rem-sqrt-square58.2%

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

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

    if -4.99999999999999989e101 < t < 8.50000000000000041e196

    1. Initial program 45.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. Simplified51.6%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.50000000000000041e196 < t

    1. Initial program 28.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. Simplified42.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 42.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 48.8% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 1.45 \cdot 10^{-31}:\\ \;\;\;\;\sqrt{\left|\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right|}\\ \mathbf{elif}\;l\_m \leq 10^{+222}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(\left(n \cdot U*\right) \cdot \left(\frac{l\_m}{Om} \cdot \frac{l\_m}{Om}\right) - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(l\_m \cdot \sqrt{2}\right) \cdot \sqrt{\frac{n \cdot \left(U \cdot -2\right)}{Om}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= l_m 1.45e-31)
   (sqrt (fabs (* (* 2.0 n) (* U t))))
   (if (<= l_m 1e+222)
     (sqrt
      (*
       (* 2.0 (* n U))
       (+
        t
        (-
         (* (* n U*) (* (/ l_m Om) (/ l_m Om)))
         (* 2.0 (* l_m (/ l_m Om)))))))
     (* (* l_m (sqrt 2.0)) (sqrt (/ (* n (* U -2.0)) 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 <= 1.45e-31) {
		tmp = sqrt(fabs(((2.0 * n) * (U * t))));
	} else if (l_m <= 1e+222) {
		tmp = sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = (l_m * sqrt(2.0)) * sqrt(((n * (U * -2.0)) / 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 <= 1.45d-31) then
        tmp = sqrt(abs(((2.0d0 * n) * (u * t))))
    else if (l_m <= 1d+222) then
        tmp = sqrt(((2.0d0 * (n * u)) * (t + (((n * u_42) * ((l_m / om) * (l_m / om))) - (2.0d0 * (l_m * (l_m / om)))))))
    else
        tmp = (l_m * sqrt(2.0d0)) * sqrt(((n * (u * (-2.0d0))) / 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 <= 1.45e-31) {
		tmp = Math.sqrt(Math.abs(((2.0 * n) * (U * t))));
	} else if (l_m <= 1e+222) {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = (l_m * Math.sqrt(2.0)) * Math.sqrt(((n * (U * -2.0)) / Om));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if l_m <= 1.45e-31:
		tmp = math.sqrt(math.fabs(((2.0 * n) * (U * t))))
	elif l_m <= 1e+222:
		tmp = math.sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))))
	else:
		tmp = (l_m * math.sqrt(2.0)) * math.sqrt(((n * (U * -2.0)) / Om))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (l_m <= 1.45e-31)
		tmp = sqrt(abs(Float64(Float64(2.0 * n) * Float64(U * t))));
	elseif (l_m <= 1e+222)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64(Float64(n * U_42_) * Float64(Float64(l_m / Om) * Float64(l_m / Om))) - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = Float64(Float64(l_m * sqrt(2.0)) * sqrt(Float64(Float64(n * Float64(U * -2.0)) / 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 <= 1.45e-31)
		tmp = sqrt(abs(((2.0 * n) * (U * t))));
	elseif (l_m <= 1e+222)
		tmp = sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	else
		tmp = (l_m * sqrt(2.0)) * sqrt(((n * (U * -2.0)) / 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, 1.45e-31], N[Sqrt[N[Abs[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1e+222], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[(n * U$42$), $MachinePrecision] * N[(N[(l$95$m / Om), $MachinePrecision] * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 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 * N[(U * -2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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


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

    1. Initial program 49.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. Simplified53.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 41.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\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)}}} \]
      3. rem-sqrt-square44.1%

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

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

    if 1.45e-31 < l < 1e222

    1. Initial program 39.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. Simplified52.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
    4. Step-by-step derivation
      1. associate-*r*50.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\left(\left(-U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)}^{1}\right)\right)} \]
    12. Applied egg-rr51.5%

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

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

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

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

        \[\leadsto \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(-U*\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)} \]
    16. Applied egg-rr51.4%

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

    if 1e222 < l

    1. Initial program 11.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. Simplified16.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 l around inf 14.2%

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

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

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

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

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

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

      \[\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)} \]
    8. Step-by-step derivation
      1. associate-*r/47.8%

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

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

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

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

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

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

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

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

Alternative 10: 51.5% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := 2 \cdot \left(n \cdot U\right)\\ \mathbf{if}\;t \leq -2.05 \cdot 10^{+101}:\\ \;\;\;\;\sqrt{\left|\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right|}\\ \mathbf{elif}\;t \leq 4.8 \cdot 10^{+140}:\\ \;\;\;\;\sqrt{t\_1 \cdot \left(t + \left(\left(n \cdot U*\right) \cdot \left(\frac{l\_m}{Om} \cdot \frac{l\_m}{Om}\right) - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t} \cdot \sqrt{t\_1}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* 2.0 (* n U))))
   (if (<= t -2.05e+101)
     (sqrt (fabs (* (* 2.0 n) (* U t))))
     (if (<= t 4.8e+140)
       (sqrt
        (*
         t_1
         (+
          t
          (-
           (* (* n U*) (* (/ l_m Om) (/ l_m Om)))
           (* 2.0 (* l_m (/ l_m Om)))))))
       (* (sqrt t) (sqrt t_1))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = 2.0 * (n * U);
	double tmp;
	if (t <= -2.05e+101) {
		tmp = sqrt(fabs(((2.0 * n) * (U * t))));
	} else if (t <= 4.8e+140) {
		tmp = sqrt((t_1 * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = sqrt(t) * sqrt(t_1);
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (n * u)
    if (t <= (-2.05d+101)) then
        tmp = sqrt(abs(((2.0d0 * n) * (u * t))))
    else if (t <= 4.8d+140) then
        tmp = sqrt((t_1 * (t + (((n * u_42) * ((l_m / om) * (l_m / om))) - (2.0d0 * (l_m * (l_m / om)))))))
    else
        tmp = sqrt(t) * sqrt(t_1)
    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 t_1 = 2.0 * (n * U);
	double tmp;
	if (t <= -2.05e+101) {
		tmp = Math.sqrt(Math.abs(((2.0 * n) * (U * t))));
	} else if (t <= 4.8e+140) {
		tmp = Math.sqrt((t_1 * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = Math.sqrt(t) * Math.sqrt(t_1);
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	t_1 = 2.0 * (n * U)
	tmp = 0
	if t <= -2.05e+101:
		tmp = math.sqrt(math.fabs(((2.0 * n) * (U * t))))
	elif t <= 4.8e+140:
		tmp = math.sqrt((t_1 * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))))
	else:
		tmp = math.sqrt(t) * math.sqrt(t_1)
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(2.0 * Float64(n * U))
	tmp = 0.0
	if (t <= -2.05e+101)
		tmp = sqrt(abs(Float64(Float64(2.0 * n) * Float64(U * t))));
	elseif (t <= 4.8e+140)
		tmp = sqrt(Float64(t_1 * Float64(t + Float64(Float64(Float64(n * U_42_) * Float64(Float64(l_m / Om) * Float64(l_m / Om))) - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = Float64(sqrt(t) * sqrt(t_1));
	end
	return tmp
end
l_m = abs(l);
function tmp_2 = code(n, U, t, l_m, Om, U_42_)
	t_1 = 2.0 * (n * U);
	tmp = 0.0;
	if (t <= -2.05e+101)
		tmp = sqrt(abs(((2.0 * n) * (U * t))));
	elseif (t <= 4.8e+140)
		tmp = sqrt((t_1 * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	else
		tmp = sqrt(t) * sqrt(t_1);
	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[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.05e+101], N[Sqrt[N[Abs[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 4.8e+140], N[Sqrt[N[(t$95$1 * N[(t + N[(N[(N[(n * U$42$), $MachinePrecision] * N[(N[(l$95$m / Om), $MachinePrecision] * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := 2 \cdot \left(n \cdot U\right)\\
\mathbf{if}\;t \leq -2.05 \cdot 10^{+101}:\\
\;\;\;\;\sqrt{\left|\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right|}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.05e101

    1. Initial program 46.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. Simplified54.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 l around 0 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\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)}}} \]
      3. rem-sqrt-square58.2%

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

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

    if -2.05e101 < t < 4.7999999999999999e140

    1. Initial program 45.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. Simplified51.6%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\left(\left(-U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)}^{1}\right)\right)} \]
    12. Applied egg-rr52.1%

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

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

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

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

        \[\leadsto \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(-U*\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)} \]
    16. Applied egg-rr51.0%

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

    if 4.7999999999999999e140 < t

    1. Initial program 33.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. Simplified44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 51.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.09999999999999995e101

    1. Initial program 46.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. Simplified54.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 l around 0 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\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)}}} \]
      3. rem-sqrt-square58.2%

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

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

    if -5.09999999999999995e101 < t < 2.00000000000000012e140

    1. Initial program 45.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. Simplified51.6%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\left(\left(-U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)}^{1}\right)\right)} \]
    12. Applied egg-rr52.1%

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

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

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

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

        \[\leadsto \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(-U*\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)} \]
    16. Applied egg-rr51.0%

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

    if 2.00000000000000012e140 < t

    1. Initial program 33.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. Simplified44.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 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.3% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 2.4 \cdot 10^{-22}:\\ \;\;\;\;\sqrt{\left|\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(\left(n \cdot U*\right) \cdot \left(\frac{l\_m}{Om} \cdot \frac{l\_m}{Om}\right) - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\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.4e-22)
   (sqrt (fabs (* (* 2.0 n) (* U t))))
   (sqrt
    (*
     (* 2.0 (* n U))
     (+
      t
      (-
       (* (* n U*) (* (/ l_m Om) (/ l_m Om)))
       (* 2.0 (* l_m (/ l_m 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.4e-22) {
		tmp = sqrt(fabs(((2.0 * n) * (U * t))));
	} else {
		tmp = sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / 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.4d-22) then
        tmp = sqrt(abs(((2.0d0 * n) * (u * t))))
    else
        tmp = sqrt(((2.0d0 * (n * u)) * (t + (((n * u_42) * ((l_m / om) * (l_m / om))) - (2.0d0 * (l_m * (l_m / 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.4e-22) {
		tmp = Math.sqrt(Math.abs(((2.0 * n) * (U * t))));
	} else {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if l_m <= 2.4e-22:
		tmp = math.sqrt(math.fabs(((2.0 * n) * (U * t))))
	else:
		tmp = math.sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (l_m <= 2.4e-22)
		tmp = sqrt(abs(Float64(Float64(2.0 * n) * Float64(U * t))));
	else
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64(Float64(n * U_42_) * Float64(Float64(l_m / Om) * Float64(l_m / Om))) - Float64(2.0 * Float64(l_m * Float64(l_m / 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.4e-22)
		tmp = sqrt(abs(((2.0 * n) * (U * t))));
	else
		tmp = sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / 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.4e-22], N[Sqrt[N[Abs[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[(n * U$42$), $MachinePrecision] * N[(N[(l$95$m / Om), $MachinePrecision] * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 2.40000000000000002e-22

    1. Initial program 49.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. Simplified53.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 41.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\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)}}} \]
      3. rem-sqrt-square44.2%

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

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

    if 2.40000000000000002e-22 < l

    1. Initial program 31.8%

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

      \[\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
    4. Step-by-step derivation
      1. associate-*r*41.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\left(\left(-U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)}^{1}\right)\right)} \]
    12. Applied egg-rr42.4%

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

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

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

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

        \[\leadsto \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(-U*\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)} \]
    16. Applied egg-rr42.4%

      \[\leadsto \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(-U*\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.7%

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

Alternative 13: 50.0% accurate, 1.6× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;t \leq -2.7 \cdot 10^{+98}:\\ \;\;\;\;{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{+195}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(\left(n \cdot U*\right) \cdot \left(\frac{l\_m}{Om} \cdot \frac{l\_m}{Om}\right) - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= t -2.7e+98)
   (pow (* (* 2.0 n) (* U t)) 0.5)
   (if (<= t 1.75e+195)
     (sqrt
      (*
       (* 2.0 (* n U))
       (+
        t
        (-
         (* (* n U*) (* (/ l_m Om) (/ l_m Om)))
         (* 2.0 (* l_m (/ l_m Om)))))))
     (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_) {
	double tmp;
	if (t <= -2.7e+98) {
		tmp = pow(((2.0 * n) * (U * t)), 0.5);
	} else if (t <= 1.75e+195) {
		tmp = sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = sqrt(((2.0 * U) * (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 (t <= (-2.7d+98)) then
        tmp = ((2.0d0 * n) * (u * t)) ** 0.5d0
    else if (t <= 1.75d+195) then
        tmp = sqrt(((2.0d0 * (n * u)) * (t + (((n * u_42) * ((l_m / om) * (l_m / om))) - (2.0d0 * (l_m * (l_m / om)))))))
    else
        tmp = sqrt(((2.0d0 * u) * (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 (t <= -2.7e+98) {
		tmp = Math.pow(((2.0 * n) * (U * t)), 0.5);
	} else if (t <= 1.75e+195) {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = Math.sqrt(((2.0 * U) * (n * t)));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if t <= -2.7e+98:
		tmp = math.pow(((2.0 * n) * (U * t)), 0.5)
	elif t <= 1.75e+195:
		tmp = math.sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))))
	else:
		tmp = math.sqrt(((2.0 * U) * (n * t)))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (t <= -2.7e+98)
		tmp = Float64(Float64(2.0 * n) * Float64(U * t)) ^ 0.5;
	elseif (t <= 1.75e+195)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64(Float64(n * U_42_) * Float64(Float64(l_m / Om) * Float64(l_m / Om))) - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = sqrt(Float64(Float64(2.0 * U) * 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 (t <= -2.7e+98)
		tmp = ((2.0 * n) * (U * t)) ^ 0.5;
	elseif (t <= 1.75e+195)
		tmp = sqrt(((2.0 * (n * U)) * (t + (((n * U_42_) * ((l_m / Om) * (l_m / Om))) - (2.0 * (l_m * (l_m / Om)))))));
	else
		tmp = sqrt(((2.0 * U) * (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[t, -2.7e+98], N[Power[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[t, 1.75e+195], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[(n * U$42$), $MachinePrecision] * N[(N[(l$95$m / Om), $MachinePrecision] * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+98}:\\
\;\;\;\;{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.7e98

    1. Initial program 46.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. Simplified54.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 l around 0 52.2%

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

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

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

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

    if -2.7e98 < t < 1.7500000000000001e195

    1. Initial program 45.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. Simplified51.6%

      \[\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
    4. Step-by-step derivation
      1. associate-*r*51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \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 \color{blue}{\left(\left(-U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)}\right)}^{1}\right)\right)} \]
    12. Applied egg-rr52.1%

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

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

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

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

        \[\leadsto \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(-U*\right)\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)} \]
    16. Applied egg-rr51.0%

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

    if 1.7500000000000001e195 < t

    1. Initial program 28.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. Simplified42.5%

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

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

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

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

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

Alternative 14: 47.0% accurate, 1.9× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 3.2 \cdot 10^{-77}:\\ \;\;\;\;{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{l\_m}{Om} \cdot \left(2 \cdot l\_m\right)\right)\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= l_m 3.2e-77)
   (pow (* (* 2.0 n) (* U t)) 0.5)
   (sqrt (* 2.0 (* U (* n (- t (* (/ l_m Om) (* 2.0 l_m)))))))))
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 <= 3.2e-77) {
		tmp = pow(((2.0 * n) * (U * t)), 0.5);
	} else {
		tmp = sqrt((2.0 * (U * (n * (t - ((l_m / Om) * (2.0 * l_m)))))));
	}
	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 <= 3.2d-77) then
        tmp = ((2.0d0 * n) * (u * t)) ** 0.5d0
    else
        tmp = sqrt((2.0d0 * (u * (n * (t - ((l_m / om) * (2.0d0 * l_m)))))))
    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 <= 3.2e-77) {
		tmp = Math.pow(((2.0 * n) * (U * t)), 0.5);
	} else {
		tmp = Math.sqrt((2.0 * (U * (n * (t - ((l_m / Om) * (2.0 * l_m)))))));
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if l_m <= 3.2e-77:
		tmp = math.pow(((2.0 * n) * (U * t)), 0.5)
	else:
		tmp = math.sqrt((2.0 * (U * (n * (t - ((l_m / Om) * (2.0 * l_m)))))))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (l_m <= 3.2e-77)
		tmp = Float64(Float64(2.0 * n) * Float64(U * t)) ^ 0.5;
	else
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(Float64(l_m / Om) * Float64(2.0 * l_m)))))));
	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 <= 3.2e-77)
		tmp = ((2.0 * n) * (U * t)) ^ 0.5;
	else
		tmp = sqrt((2.0 * (U * (n * (t - ((l_m / Om) * (2.0 * l_m)))))));
	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, 3.2e-77], N[Power[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[(l$95$m / Om), $MachinePrecision] * N[(2.0 * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 3.2e-77

    1. Initial program 49.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. Simplified54.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 42.0%

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

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

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

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

    if 3.2e-77 < l

    1. Initial program 32.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. Simplified42.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
    4. Step-by-step derivation
      1. associate-*r*41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 35.9% accurate, 2.1× speedup?

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

\\
{\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 44.1%

    \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
  2. Simplified49.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 l around 0 33.0%

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

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

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

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

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

Alternative 16: 34.4% accurate, 2.1× speedup?

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

\\
\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 44.1%

    \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
  2. Simplified49.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 l around 0 33.0%

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

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

Reproduce

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