Toniolo and Linder, Equation (13)

Percentage Accurate: 49.3% → 63.5%
Time: 28.7s
Alternatives: 18
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (sqrt
  (*
   (* (* 2.0 n) U)
   (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_2}\\

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


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

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

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

    if 5.0000000000000001e-4 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0

    1. Initial program 64.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. Step-by-step derivation
      1. associate-*r/68.8%

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

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

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

    if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.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. Simplified7.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_2}\\

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


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

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

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

    if 5.0000000000000001e-4 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0

    1. Initial program 64.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. Step-by-step derivation
      1. associate-*r/68.8%

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

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

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

    if +inf.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.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. Simplified7.5%

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

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

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

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

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

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

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

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

Alternative 3: 60.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot t\_3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 9.9999999999999995e-8

    1. Initial program 59.5%

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

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

    if 9.9999999999999995e-8 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < +inf.0

    1. Initial program 64.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. Step-by-step derivation
      1. associate-*r/68.8%

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

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

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

    if +inf.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 4: 60.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot t\_3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 9.9999999999999995e-8

    1. Initial program 59.5%

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

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

    if 9.9999999999999995e-8 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < +inf.0

    1. Initial program 64.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. Step-by-step derivation
      1. associate-*r/68.8%

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

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

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

    if +inf.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))

    1. Initial program 0.0%

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

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

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

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

Alternative 5: 60.2% accurate, 0.5× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \left(2 \cdot n\right) \cdot U\\ t_2 := \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\ t_3 := \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right) + t\_2\\ t_4 := t\_1 \cdot \left(t\_2 - \left(2 \cdot \frac{l\_m \cdot l\_m}{Om} - t\right)\right)\\ \mathbf{if}\;t\_4 \leq 10^{-7}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\_3\right)}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\sqrt{t\_1 \cdot t\_3}\\ \mathbf{else}:\\ \;\;\;\;{\left(t\_1 \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\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 (* (* 2.0 n) U))
        (t_2 (* (* n (pow (/ l_m Om) 2.0)) (- U* U)))
        (t_3 (+ (- t (* 2.0 (* l_m (/ l_m Om)))) t_2))
        (t_4 (* t_1 (- t_2 (- (* 2.0 (/ (* l_m l_m) Om)) t)))))
   (if (<= t_4 1e-7)
     (sqrt (* (* 2.0 n) (* U t_3)))
     (if (<= t_4 INFINITY)
       (sqrt (* t_1 t_3))
       (pow (* t_1 (+ 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_) {
	double t_1 = (2.0 * n) * U;
	double t_2 = (n * pow((l_m / Om), 2.0)) * (U_42_ - U);
	double t_3 = (t - (2.0 * (l_m * (l_m / Om)))) + t_2;
	double t_4 = t_1 * (t_2 - ((2.0 * ((l_m * l_m) / Om)) - t));
	double tmp;
	if (t_4 <= 1e-7) {
		tmp = sqrt(((2.0 * n) * (U * t_3)));
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = sqrt((t_1 * t_3));
	} else {
		tmp = pow((t_1 * (t + (-2.0 * (pow(l_m, 2.0) / Om)))), 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 = (2.0 * n) * U;
	double t_2 = (n * Math.pow((l_m / Om), 2.0)) * (U_42_ - U);
	double t_3 = (t - (2.0 * (l_m * (l_m / Om)))) + t_2;
	double t_4 = t_1 * (t_2 - ((2.0 * ((l_m * l_m) / Om)) - t));
	double tmp;
	if (t_4 <= 1e-7) {
		tmp = Math.sqrt(((2.0 * n) * (U * t_3)));
	} else if (t_4 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_1 * t_3));
	} else {
		tmp = Math.pow((t_1 * (t + (-2.0 * (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_):
	t_1 = (2.0 * n) * U
	t_2 = (n * math.pow((l_m / Om), 2.0)) * (U_42_ - U)
	t_3 = (t - (2.0 * (l_m * (l_m / Om)))) + t_2
	t_4 = t_1 * (t_2 - ((2.0 * ((l_m * l_m) / Om)) - t))
	tmp = 0
	if t_4 <= 1e-7:
		tmp = math.sqrt(((2.0 * n) * (U * t_3)))
	elif t_4 <= math.inf:
		tmp = math.sqrt((t_1 * t_3))
	else:
		tmp = math.pow((t_1 * (t + (-2.0 * (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_)
	t_1 = Float64(Float64(2.0 * n) * U)
	t_2 = Float64(Float64(n * (Float64(l_m / Om) ^ 2.0)) * Float64(U_42_ - U))
	t_3 = Float64(Float64(t - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))) + t_2)
	t_4 = Float64(t_1 * Float64(t_2 - Float64(Float64(2.0 * Float64(Float64(l_m * l_m) / Om)) - t)))
	tmp = 0.0
	if (t_4 <= 1e-7)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t_3)));
	elseif (t_4 <= Inf)
		tmp = sqrt(Float64(t_1 * t_3));
	else
		tmp = Float64(t_1 * Float64(t + Float64(-2.0 * Float64((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_)
	t_1 = (2.0 * n) * U;
	t_2 = (n * ((l_m / Om) ^ 2.0)) * (U_42_ - U);
	t_3 = (t - (2.0 * (l_m * (l_m / Om)))) + t_2;
	t_4 = t_1 * (t_2 - ((2.0 * ((l_m * l_m) / Om)) - t));
	tmp = 0.0;
	if (t_4 <= 1e-7)
		tmp = sqrt(((2.0 * n) * (U * t_3)));
	elseif (t_4 <= Inf)
		tmp = sqrt((t_1 * t_3));
	else
		tmp = (t_1 * (t + (-2.0 * ((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$_] := Block[{t$95$1 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(t$95$2 - N[(N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 1e-7], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$1 * t$95$3), $MachinePrecision]], $MachinePrecision], N[Power[N[(t$95$1 * N[(t + N[(-2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

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

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_1 \cdot t\_3}\\

\mathbf{else}:\\
\;\;\;\;{\left(t\_1 \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 9.9999999999999995e-8

    1. Initial program 59.5%

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

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

    if 9.9999999999999995e-8 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < +inf.0

    1. Initial program 64.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. Step-by-step derivation
      1. associate-*r/68.8%

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

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

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

    if +inf.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

Alternative 6: 54.2% accurate, 1.0× speedup?

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

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

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


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

    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. Simplified61.3%

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

    if 1.24999999999999994e157 < U

    1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -2.90000000000000007e119

    1. Initial program 62.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. Simplified52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.90000000000000007e119 < U < 1.30000000000000005e157

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

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

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

    if 1.30000000000000005e157 < U

    1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 45.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -5.99999999999999995e81

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.99999999999999995e81 < U < 1.02000000000000003e157

    1. Initial program 54.2%

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

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

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

    if 1.02000000000000003e157 < U

    1. Initial program 57.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 43.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;l\_m \leq 8.5 \cdot 10^{+161}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\

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


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

    1. Initial program 56.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. Simplified56.9%

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

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

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

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

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

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

    if 4.0999999999999998e-251 < l < 8.50000000000000007e161

    1. Initial program 65.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. Simplified67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.50000000000000007e161 < l

    1. Initial program 11.5%

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

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

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

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

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

Alternative 10: 48.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 48.7%

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

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

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

    if -2.2999999999999999e89 < t

    1. Initial program 57.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. Simplified61.3%

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

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

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

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

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

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

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

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

Alternative 11: 39.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -2.8 \cdot 10^{-90} \lor \neg \left(U \leq 1.15 \cdot 10^{-137}\right):\\
\;\;\;\;\sqrt{\left|2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right|}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -2.7999999999999999e-90 or 1.15000000000000004e-137 < U

    1. Initial program 65.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. Simplified62.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7999999999999999e-90 < U < 1.15000000000000004e-137

    1. Initial program 38.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(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in t around inf 41.5%

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

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

Alternative 12: 40.5% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -7.5000000000000005e-92

    1. Initial program 63.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. Simplified57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000005e-92 < U < 9.0000000000000021e-309

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

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

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

    if 9.0000000000000021e-309 < U

    1. Initial program 59.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. Simplified62.0%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.5% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 56.5%

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

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

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

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

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

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

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

    if 1.5500000000000001e-248 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 38.4% accurate, 1.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 (fabs (* 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 * fabs((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 * abs((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 * Math.abs((U * (n * t)))));
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.sqrt((2.0 * math.fabs((U * (n * t)))))
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return sqrt(Float64(2.0 * abs(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 * abs((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[Abs[N[(U * N[(n * t), $MachinePrecision]), $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 55.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. Simplified57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 37.7% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

Alternative 16: 35.5% 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 55.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. Simplified57.9%

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

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

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

Alternative 17: 35.5% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 35.0% accurate, 2.1× speedup?

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

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

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

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

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

Reproduce

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