Toniolo and Linder, Equation (13)

Percentage Accurate: 50.3% → 62.6%
Time: 28.3s
Alternatives: 18
Speedup: 0.5×

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

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

Initial Program: 50.3% 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: 62.6% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 17.9%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 71.2%

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

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

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

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

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

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

    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. Simplified5.1%

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

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

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

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

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

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

        \[\leadsto {\left(-4 \cdot \frac{\color{blue}{\left(U \cdot {\ell}^{2}\right) \cdot n}}{Om}\right)}^{0.5} \]
    7. Applied egg-rr42.0%

      \[\leadsto \color{blue}{{\left(-4 \cdot \frac{\left(U \cdot {\ell}^{2}\right) \cdot n}{Om}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. clear-num42.0%

        \[\leadsto {\left(-4 \cdot \color{blue}{\frac{1}{\frac{Om}{\left(U \cdot {\ell}^{2}\right) \cdot n}}}\right)}^{0.5} \]
      2. inv-pow42.0%

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

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

        \[\leadsto {\left(-4 \cdot {\left(\frac{Om}{U \cdot \color{blue}{\left(n \cdot {\ell}^{2}\right)}}\right)}^{-1}\right)}^{0.5} \]
    9. Applied egg-rr41.9%

      \[\leadsto {\left(-4 \cdot \color{blue}{{\left(\frac{Om}{U \cdot \left(n \cdot {\ell}^{2}\right)}\right)}^{-1}}\right)}^{0.5} \]
    10. Step-by-step derivation
      1. unpow-141.9%

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

        \[\leadsto {\left(-4 \cdot \frac{1}{\color{blue}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}}\right)}^{0.5} \]
    11. Simplified45.7%

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

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

Alternative 2: 61.7% 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 2 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(-4 \cdot \frac{1}{\frac{\frac{Om}{U}}{n \cdot {l\_m}^{2}}}\right)}^{0.5}\\ \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 2e-160)
     (* (sqrt (* 2.0 n)) (sqrt (* U t)))
     (if (<= t_2 INFINITY)
       (sqrt (* (* 2.0 (* n U)) (+ t (- t_1 (* 2.0 (* l_m (/ l_m Om)))))))
       (pow (* -4.0 (/ 1.0 (/ (/ Om U) (* n (pow l_m 2.0))))) 0.5)))))
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 <= 2e-160) {
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = pow((-4.0 * (1.0 / ((Om / U) / (n * pow(l_m, 2.0))))), 0.5);
	}
	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 <= 2e-160) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((U * t));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = Math.pow((-4.0 * (1.0 / ((Om / U) / (n * Math.pow(l_m, 2.0))))), 0.5);
	}
	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 <= 2e-160:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((U * t))
	elif t_2 <= math.inf:
		tmp = math.sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l_m * (l_m / Om)))))))
	else:
		tmp = math.pow((-4.0 * (1.0 / ((Om / U) / (n * math.pow(l_m, 2.0))))), 0.5)
	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 <= 2e-160)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * t)));
	elseif (t_2 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_1 - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = Float64(-4.0 * Float64(1.0 / Float64(Float64(Om / U) / Float64(n * (l_m ^ 2.0))))) ^ 0.5;
	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 <= 2e-160)
		tmp = sqrt((2.0 * n)) * sqrt((U * t));
	elseif (t_2 <= Inf)
		tmp = sqrt(((2.0 * (n * U)) * (t + (t_1 - (2.0 * (l_m * (l_m / Om)))))));
	else
		tmp = (-4.0 * (1.0 / ((Om / U) / (n * (l_m ^ 2.0))))) ^ 0.5;
	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, 2e-160], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(t$95$1 - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(1.0 / N[(N[(Om / U), $MachinePrecision] / N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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 2 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\

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

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


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

    1. Initial program 17.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 17.9%

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

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot n} \cdot \color{blue}{\sqrt{U \cdot t}} \]
    7. Simplified44.7%

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

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

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

        \[\leadsto {\left(-4 \cdot \frac{\color{blue}{\left(U \cdot {\ell}^{2}\right) \cdot n}}{Om}\right)}^{0.5} \]
    7. Applied egg-rr42.0%

      \[\leadsto \color{blue}{{\left(-4 \cdot \frac{\left(U \cdot {\ell}^{2}\right) \cdot n}{Om}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. clear-num42.0%

        \[\leadsto {\left(-4 \cdot \color{blue}{\frac{1}{\frac{Om}{\left(U \cdot {\ell}^{2}\right) \cdot n}}}\right)}^{0.5} \]
      2. inv-pow42.0%

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

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

        \[\leadsto {\left(-4 \cdot {\left(\frac{Om}{U \cdot \color{blue}{\left(n \cdot {\ell}^{2}\right)}}\right)}^{-1}\right)}^{0.5} \]
    9. Applied egg-rr41.9%

      \[\leadsto {\left(-4 \cdot \color{blue}{{\left(\frac{Om}{U \cdot \left(n \cdot {\ell}^{2}\right)}\right)}^{-1}}\right)}^{0.5} \]
    10. Step-by-step derivation
      1. unpow-141.9%

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

        \[\leadsto {\left(-4 \cdot \frac{1}{\color{blue}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}}\right)}^{0.5} \]
    11. Simplified45.7%

      \[\leadsto {\left(-4 \cdot \color{blue}{\frac{1}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}}\right)}^{0.5} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification66.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 2 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\ \mathbf{elif}\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)} \leq \infty:\\ \;\;\;\;\sqrt{\left(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(-4 \cdot \frac{1}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 62.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := l\_m \cdot \frac{l\_m}{Om}\\
t_2 := {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t\_2\right) \cdot \left(U* - U\right)\\
t_4 := \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\_3\right)}\\
\mathbf{if}\;t\_4 \leq 2 \cdot 10^{-160}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot {\left(U \cdot \left(t - \mathsf{fma}\left(2, t\_1, n \cdot \left(t\_2 \cdot \left(U - U*\right)\right)\right)\right)\right)}^{0.5}\\

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

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


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

    1. Initial program 17.9%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

        \[\leadsto {\left(-4 \cdot \frac{\color{blue}{\left(U \cdot {\ell}^{2}\right) \cdot n}}{Om}\right)}^{0.5} \]
    7. Applied egg-rr42.0%

      \[\leadsto \color{blue}{{\left(-4 \cdot \frac{\left(U \cdot {\ell}^{2}\right) \cdot n}{Om}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. clear-num42.0%

        \[\leadsto {\left(-4 \cdot \color{blue}{\frac{1}{\frac{Om}{\left(U \cdot {\ell}^{2}\right) \cdot n}}}\right)}^{0.5} \]
      2. inv-pow42.0%

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

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

        \[\leadsto {\left(-4 \cdot {\left(\frac{Om}{U \cdot \color{blue}{\left(n \cdot {\ell}^{2}\right)}}\right)}^{-1}\right)}^{0.5} \]
    9. Applied egg-rr41.9%

      \[\leadsto {\left(-4 \cdot \color{blue}{{\left(\frac{Om}{U \cdot \left(n \cdot {\ell}^{2}\right)}\right)}^{-1}}\right)}^{0.5} \]
    10. Step-by-step derivation
      1. unpow-141.9%

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

        \[\leadsto {\left(-4 \cdot \frac{1}{\color{blue}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}}\right)}^{0.5} \]
    11. Simplified45.7%

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

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

Alternative 4: 62.7% 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{\frac{{l\_m}^{2} \cdot \left(n \cdot \left(U* - U\right)\right)}{Om} - 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(-4 \cdot \frac{1}{\frac{\frac{Om}{U}}{n \cdot {l\_m}^{2}}}\right)}^{0.5}\\ \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
         (/
          (- (/ (* (pow l_m 2.0) (* n (- U* U))) Om) (* 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)))))))
       (pow (* -4.0 (/ 1.0 (/ (/ Om U) (* n (pow l_m 2.0))))) 0.5)))))
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 + ((((pow(l_m, 2.0) * (n * (U_42_ - U))) / Om) - (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 = pow((-4.0 * (1.0 / ((Om / U) / (n * pow(l_m, 2.0))))), 0.5);
	}
	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 + ((((Math.pow(l_m, 2.0) * (n * (U_42_ - U))) / Om) - (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.pow((-4.0 * (1.0 / ((Om / U) / (n * Math.pow(l_m, 2.0))))), 0.5);
	}
	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 + ((((math.pow(l_m, 2.0) * (n * (U_42_ - U))) / Om) - (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.pow((-4.0 * (1.0 / ((Om / U) / (n * math.pow(l_m, 2.0))))), 0.5)
	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(Float64(Float64((l_m ^ 2.0) * Float64(n * Float64(U_42_ - U))) / Om) - 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(-4.0 * Float64(1.0 / Float64(Float64(Om / U) / Float64(n * (l_m ^ 2.0))))) ^ 0.5;
	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 + (((((l_m ^ 2.0) * (n * (U_42_ - U))) / Om) - (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 = (-4.0 * (1.0 / ((Om / U) / (n * (l_m ^ 2.0))))) ^ 0.5;
	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[(N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] - N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(t$95$1 - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(1.0 / N[(N[(Om / U), $MachinePrecision] / N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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{\frac{{l\_m}^{2} \cdot \left(n \cdot \left(U* - U\right)\right)}{Om} - 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(-4 \cdot \frac{1}{\frac{\frac{Om}{U}}{n \cdot {l\_m}^{2}}}\right)}^{0.5}\\


\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 14.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. Simplified30.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 Om around inf 40.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(-4 \cdot \frac{\left(U \cdot {\ell}^{2}\right) \cdot n}{Om}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. clear-num45.0%

        \[\leadsto {\left(-4 \cdot \color{blue}{\frac{1}{\frac{Om}{\left(U \cdot {\ell}^{2}\right) \cdot n}}}\right)}^{0.5} \]
      2. inv-pow45.0%

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

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

        \[\leadsto {\left(-4 \cdot {\left(\frac{Om}{U \cdot \color{blue}{\left(n \cdot {\ell}^{2}\right)}}\right)}^{-1}\right)}^{0.5} \]
    9. Applied egg-rr45.0%

      \[\leadsto {\left(-4 \cdot \color{blue}{{\left(\frac{Om}{U \cdot \left(n \cdot {\ell}^{2}\right)}\right)}^{-1}}\right)}^{0.5} \]
    10. Step-by-step derivation
      1. unpow-145.0%

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

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

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

    \[\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{\frac{{\ell}^{2} \cdot \left(n \cdot \left(U* - U\right)\right)}{Om} - 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(-4 \cdot \frac{1}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.18 \cdot 10^{-26} \lor \neg \left(n \leq 6.6 \cdot 10^{-127}\right):\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.17999999999999996e-26 or 6.59999999999999961e-127 < n

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

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

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

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

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

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

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

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

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

    if -1.17999999999999996e-26 < n < 6.59999999999999961e-127

    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. Simplified48.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 42.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 3.25000000000000009e44

    1. Initial program 57.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. Simplified55.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 t around inf 42.9%

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt46.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.25000000000000009e44 < l < 5.09999999999999967e159

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.09999999999999967e159 < l

    1. Initial program 22.2%

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

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

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

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

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

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

Alternative 7: 47.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.92000000000000004e90

    1. Initial program 57.2%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around 0 48.7%

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

    if 1.92000000000000004e90 < l

    1. Initial program 31.3%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 46.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.09999999999999965e44

    1. Initial program 57.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. Simplified55.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 t around inf 42.9%

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt46.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.09999999999999965e44 < l

    1. Initial program 36.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. Simplified45.3%

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

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

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

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

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

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

        \[\leadsto {\left(-4 \cdot \frac{\color{blue}{\left(U \cdot {\ell}^{2}\right) \cdot n}}{Om}\right)}^{0.5} \]
    7. Applied egg-rr47.2%

      \[\leadsto \color{blue}{{\left(-4 \cdot \frac{\left(U \cdot {\ell}^{2}\right) \cdot n}{Om}\right)}^{0.5}} \]
    8. Step-by-step derivation
      1. clear-num47.2%

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

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

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

        \[\leadsto {\left(-4 \cdot {\left(\frac{Om}{U \cdot \color{blue}{\left(n \cdot {\ell}^{2}\right)}}\right)}^{-1}\right)}^{0.5} \]
    9. Applied egg-rr47.1%

      \[\leadsto {\left(-4 \cdot \color{blue}{{\left(\frac{Om}{U \cdot \left(n \cdot {\ell}^{2}\right)}\right)}^{-1}}\right)}^{0.5} \]
    10. Step-by-step derivation
      1. unpow-147.1%

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

        \[\leadsto {\left(-4 \cdot \frac{1}{\color{blue}{\frac{\frac{Om}{U}}{n \cdot {\ell}^{2}}}}\right)}^{0.5} \]
    11. Simplified48.6%

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

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

Alternative 9: 46.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.4999999999999999e60

    1. Initial program 56.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. Simplified55.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4999999999999999e60 < l

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

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

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

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

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

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

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

        \[\leadsto {\left(-4 \cdot \frac{\color{blue}{\left(U \cdot {\ell}^{2}\right) \cdot n}}{Om}\right)}^{0.5} \]
    7. Applied egg-rr50.9%

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

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

Alternative 10: 41.4% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 6.19999999999999991e44

    1. Initial program 57.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. Simplified55.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 t around inf 42.9%

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt46.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.19999999999999991e44 < l

    1. Initial program 36.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. Simplified45.3%

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

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

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

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

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

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

        \[\leadsto {\left(-4 \cdot \frac{\color{blue}{\left(U \cdot {\ell}^{2}\right) \cdot n}}{Om}\right)}^{0.5} \]
    7. Applied egg-rr47.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 42.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 5.7000000000000003e44

    1. Initial program 57.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. Simplified55.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 t around inf 42.9%

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt46.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.7000000000000003e44 < l

    1. Initial program 36.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. Simplified45.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 49.9% accurate, 1.1× speedup?

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

\\
{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 40.7% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 2.2 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{2 \cdot \left|t \cdot \left(n \cdot U\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= t 2.2e-160)
   (sqrt (* 2.0 (fabs (* t (* n U)))))
   (* (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 <= 2.2e-160) {
		tmp = sqrt((2.0 * fabs((t * (n * U)))));
	} 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 <= 2.2d-160) then
        tmp = sqrt((2.0d0 * abs((t * (n * u)))))
    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 <= 2.2e-160) {
		tmp = Math.sqrt((2.0 * Math.abs((t * (n * U)))));
	} 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 <= 2.2e-160:
		tmp = math.sqrt((2.0 * math.fabs((t * (n * U)))))
	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 <= 2.2e-160)
		tmp = sqrt(Float64(2.0 * abs(Float64(t * Float64(n * U)))));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(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 <= 2.2e-160)
		tmp = sqrt((2.0 * abs((t * (n * U)))));
	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, 2.2e-160], N[Sqrt[N[(2.0 * N[Abs[N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.2e-160

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

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt37.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2e-160 < t

    1. Initial program 55.7%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 43.9%

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

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

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

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

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

Alternative 14: 39.3% accurate, 1.1× speedup?

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

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

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

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

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

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
    2. add-sqr-sqrt39.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 37.1% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.59999999999999966e244

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

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

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

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

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

    if -7.59999999999999966e244 < t

    1. Initial program 53.3%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 40.0%

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

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

Alternative 16: 37.3% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.00000000000000002e100

    1. Initial program 44.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 44.2%

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

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

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

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

    if -1.00000000000000002e100 < t

    1. Initial program 54.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 38.6%

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

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

Alternative 17: 36.7% accurate, 2.1× speedup?

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

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

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

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

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

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

Alternative 18: 36.7% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \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(Float64(Float64(2.0 * n) * 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[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

    \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in t around inf 39.8%

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

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

Reproduce

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