Toniolo and Linder, Equation (13)

Percentage Accurate: 50.1% → 65.3%
Time: 23.4s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 50.1% accurate, 1.0× speedup?

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

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

Alternative 1: 65.3% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := U \cdot \left(n \cdot \left(\frac{n}{{Om}^{2}} \cdot \left(U* - U\right) - \frac{2}{Om}\right)\right)\\ t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\ t_4 := \left(2 \cdot n\right) \cdot U\\ t_5 := \sqrt{t_4 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)}\\ \mathbf{if}\;t_5 \leq 0:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(t_2 \cdot \left(U - U*\right)\right)\right)\right)}\\ \mathbf{elif}\;t_5 \leq \infty:\\ \;\;\;\;\sqrt{t_4 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt[3]{t_1} \cdot \sqrt[3]{\sqrt{t_1}}\right) \cdot \left(\ell \cdot \sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (* U (* n (- (* (/ n (pow Om 2.0)) (- U* U)) (/ 2.0 Om)))))
        (t_2 (pow (/ l Om) 2.0))
        (t_3 (* (* n t_2) (- U* U)))
        (t_4 (* (* 2.0 n) U))
        (t_5 (sqrt (* t_4 (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))))
   (if (<= t_5 0.0)
     (*
      (sqrt (* 2.0 n))
      (sqrt (* U (- t (fma 2.0 (/ (pow l 2.0) Om) (* n (* t_2 (- U U*))))))))
     (if (<= t_5 INFINITY)
       (sqrt (* t_4 (+ (- t (* 2.0 (* l (/ l Om)))) t_3)))
       (* (* (cbrt t_1) (cbrt (sqrt t_1))) (* l (sqrt 2.0)))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = U * (n * (((n / pow(Om, 2.0)) * (U_42_ - U)) - (2.0 / Om)));
	double t_2 = pow((l / Om), 2.0);
	double t_3 = (n * t_2) * (U_42_ - U);
	double t_4 = (2.0 * n) * U;
	double t_5 = sqrt((t_4 * ((t - (2.0 * ((l * l) / Om))) + t_3)));
	double tmp;
	if (t_5 <= 0.0) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma(2.0, (pow(l, 2.0) / Om), (n * (t_2 * (U - U_42_)))))));
	} else if (t_5 <= ((double) INFINITY)) {
		tmp = sqrt((t_4 * ((t - (2.0 * (l * (l / Om)))) + t_3)));
	} else {
		tmp = (cbrt(t_1) * cbrt(sqrt(t_1))) * (l * sqrt(2.0));
	}
	return tmp;
}
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(U * Float64(n * Float64(Float64(Float64(n / (Om ^ 2.0)) * Float64(U_42_ - U)) - Float64(2.0 / Om))))
	t_2 = Float64(l / Om) ^ 2.0
	t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U))
	t_4 = Float64(Float64(2.0 * n) * U)
	t_5 = sqrt(Float64(t_4 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3)))
	tmp = 0.0
	if (t_5 <= 0.0)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(n * Float64(t_2 * Float64(U - U_42_))))))));
	elseif (t_5 <= Inf)
		tmp = sqrt(Float64(t_4 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_3)));
	else
		tmp = Float64(Float64(cbrt(t_1) * cbrt(sqrt(t_1))) * Float64(l * sqrt(2.0)));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * N[(N[(N[(n / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(t$95$4 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, 0.0], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(n * N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[Sqrt[N[(t$95$4 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[Power[t$95$1, 1/3], $MachinePrecision] * N[Power[N[Sqrt[t$95$1], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot \left(\frac{n}{{Om}^{2}} \cdot \left(U* - U\right) - \frac{2}{Om}\right)\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(n \cdot t_2\right) \cdot \left(U* - U\right)\\
t_4 := \left(2 \cdot n\right) \cdot U\\
t_5 := \sqrt{t_4 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)}\\
\mathbf{if}\;t_5 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(t_2 \cdot \left(U - U*\right)\right)\right)\right)}\\

\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{t_4 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{t_1} \cdot \sqrt[3]{\sqrt{t_1}}\right) \cdot \left(\ell \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*))))) < 0.0

    1. Initial program 15.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. Step-by-step derivation
      1. associate-*l/15.1%

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

      \[\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. Step-by-step derivation
      1. pow1/215.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.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*))))) < +inf.0

    1. Initial program 70.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. Step-by-step derivation
      1. associate-*l/80.0%

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

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

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate-/l*28.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 64.9% accurate, 0.3× speedup?

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

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_2\right)}\\

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

    1. Initial program 15.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. Step-by-step derivation
      1. associate-*l/15.1%

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

      \[\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. Step-by-step derivation
      1. pow1/215.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.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*))))) < +inf.0

    1. Initial program 70.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. Step-by-step derivation
      1. associate-*l/80.0%

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

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

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate-/l*28.4%

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

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

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

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

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

Alternative 3: 60.7% accurate, 0.3× speedup?

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

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot U*} \cdot \frac{\ell}{\frac{\frac{Om}{n}}{\sqrt{2}}}\\


\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*))))) < 0.0

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

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

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

    if 0.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*))))) < +inf.0

    1. Initial program 70.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. Step-by-step derivation
      1. associate-*l/80.0%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{U \cdot U*} \cdot \color{blue}{\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}} \]
      5. associate-/r*16.9%

        \[\leadsto \sqrt{U \cdot U*} \cdot \frac{\ell}{\color{blue}{\frac{\frac{Om}{n}}{\sqrt{2}}}} \]
    6. Simplified16.9%

      \[\leadsto \color{blue}{\sqrt{U \cdot U*} \cdot \frac{\ell}{\frac{\frac{Om}{n}}{\sqrt{2}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.8%

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

Alternative 4: 65.5% accurate, 0.4× speedup?

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

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\

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


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

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

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

    if 0.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*)))) < +inf.0

    1. Initial program 70.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. Step-by-step derivation
      1. associate-*l/80.0%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \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. Simplified8.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. Taylor expanded in l around inf 25.4%

      \[\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)} \]
    4. Step-by-step derivation
      1. associate-/l*27.9%

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

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

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

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

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

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

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

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

Alternative 5: 61.9% accurate, 0.4× speedup?

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

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_3\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(U \cdot U*\right) \cdot \left({\left(n \cdot \ell\right)}^{2} \cdot {Om}^{-2}\right)\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*)))) < 0.0

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

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

    if 0.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*)))) < +inf.0

    1. Initial program 70.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. Step-by-step derivation
      1. associate-*l/80.0%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \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. Simplified8.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. Taylor expanded in U* around inf 30.4%

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{U \cdot \left(U* \cdot \left({\ell}^{2} \cdot {n}^{2}\right)\right)}{{Om}^{2}}\right)} - 1\right)}} \]
      3. div-inv30.1%

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

        \[\leadsto \sqrt{2 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\left(U \cdot U*\right) \cdot \left({\ell}^{2} \cdot {n}^{2}\right)\right)} \cdot \frac{1}{{Om}^{2}}\right)} - 1\right)} \]
      5. pow-prod-down30.7%

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

        \[\leadsto \sqrt{2 \cdot \left(e^{\mathsf{log1p}\left(\left(\left(U \cdot U*\right) \cdot {\left(\ell \cdot n\right)}^{2}\right) \cdot \color{blue}{{Om}^{\left(-2\right)}}\right)} - 1\right)} \]
      7. metadata-eval30.7%

        \[\leadsto \sqrt{2 \cdot \left(e^{\mathsf{log1p}\left(\left(\left(U \cdot U*\right) \cdot {\left(\ell \cdot n\right)}^{2}\right) \cdot {Om}^{\color{blue}{-2}}\right)} - 1\right)} \]
    5. Applied egg-rr30.7%

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\left(\left(U \cdot U*\right) \cdot {\left(\ell \cdot n\right)}^{2}\right) \cdot {Om}^{-2}\right)} - 1\right)}} \]
    6. Step-by-step derivation
      1. expm1-def30.7%

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

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

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

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

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

Alternative 6: 53.5% accurate, 1.0× speedup?

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

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


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

    1. Initial program 50.9%

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

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

    if 8.39999999999999986e129 < U

    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. Step-by-step derivation
      1. associate-*l/74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 46.8% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+38}:\\ \;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{+209}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot \left(2 \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= t -1.25e+38)
   (pow (* (* 2.0 U) (* n t)) 0.5)
   (if (<= t 4.3e+209)
     (sqrt (* 2.0 (* U (* n (- t (* 2.0 (/ (pow l 2.0) Om)))))))
     (* (sqrt (* n (* 2.0 U))) (sqrt t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (t <= -1.25e+38) {
		tmp = pow(((2.0 * U) * (n * t)), 0.5);
	} else if (t <= 4.3e+209) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (pow(l, 2.0) / Om)))))));
	} else {
		tmp = sqrt((n * (2.0 * U))) * sqrt(t);
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (t <= (-1.25d+38)) then
        tmp = ((2.0d0 * u) * (n * t)) ** 0.5d0
    else if (t <= 4.3d+209) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * ((l ** 2.0d0) / om)))))))
    else
        tmp = sqrt((n * (2.0d0 * u))) * sqrt(t)
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (t <= -1.25e+38) {
		tmp = Math.pow(((2.0 * U) * (n * t)), 0.5);
	} else if (t <= 4.3e+209) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * (Math.pow(l, 2.0) / Om)))))));
	} else {
		tmp = Math.sqrt((n * (2.0 * U))) * Math.sqrt(t);
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if t <= -1.25e+38:
		tmp = math.pow(((2.0 * U) * (n * t)), 0.5)
	elif t <= 4.3e+209:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * (math.pow(l, 2.0) / Om)))))))
	else:
		tmp = math.sqrt((n * (2.0 * U))) * math.sqrt(t)
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (t <= -1.25e+38)
		tmp = Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5;
	elseif (t <= 4.3e+209)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64((l ^ 2.0) / Om)))))));
	else
		tmp = Float64(sqrt(Float64(n * Float64(2.0 * U))) * sqrt(t));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (t <= -1.25e+38)
		tmp = ((2.0 * U) * (n * t)) ^ 0.5;
	elseif (t <= 4.3e+209)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * ((l ^ 2.0) / Om)))))));
	else
		tmp = sqrt((n * (2.0 * U))) * sqrt(t);
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, -1.25e+38], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[t, 4.3e+209], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+38}:\\
\;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\

\mathbf{elif}\;t \leq 4.3 \cdot 10^{+209}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\

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


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

    1. Initial program 49.7%

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

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

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

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

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

    if -1.24999999999999992e38 < t < 4.29999999999999988e209

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \cdot \left(t - \mathsf{fma}\left(2, \frac{\ell}{Om} \cdot \ell, {\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Taylor expanded in n around 0 45.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 4.29999999999999988e209 < t

    1. Initial program 53.9%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.25 \cdot 10^{+38}:\\ \;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\ \mathbf{elif}\;t \leq 4.3 \cdot 10^{+209}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot \left(2 \cdot U\right)} \cdot \sqrt{t}\\ \end{array} \]

Alternative 8: 41.2% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 6.1 \cdot 10^{+63} \lor \neg \left(\ell \leq 2.5 \cdot 10^{+166}\right) \land \ell \leq 2.8 \cdot 10^{+224}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= l 6.1e+63) (and (not (<= l 2.5e+166)) (<= l 2.8e+224)))
   (sqrt (fabs (* t (* n (* 2.0 U)))))
   (sqrt (* -4.0 (/ (* U (* n (pow l 2.0))) Om)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((l <= 6.1e+63) || (!(l <= 2.5e+166) && (l <= 2.8e+224))) {
		tmp = sqrt(fabs((t * (n * (2.0 * U)))));
	} else {
		tmp = sqrt((-4.0 * ((U * (n * pow(l, 2.0))) / Om)));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if ((l <= 6.1d+63) .or. (.not. (l <= 2.5d+166)) .and. (l <= 2.8d+224)) then
        tmp = sqrt(abs((t * (n * (2.0d0 * u)))))
    else
        tmp = sqrt(((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((l <= 6.1e+63) || (!(l <= 2.5e+166) && (l <= 2.8e+224))) {
		tmp = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
	} else {
		tmp = Math.sqrt((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (l <= 6.1e+63) or (not (l <= 2.5e+166) and (l <= 2.8e+224)):
		tmp = math.sqrt(math.fabs((t * (n * (2.0 * U)))))
	else:
		tmp = math.sqrt((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((l <= 6.1e+63) || (!(l <= 2.5e+166) && (l <= 2.8e+224)))
		tmp = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U)))));
	else
		tmp = sqrt(Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((l <= 6.1e+63) || (~((l <= 2.5e+166)) && (l <= 2.8e+224)))
		tmp = sqrt(abs((t * (n * (2.0 * U)))));
	else
		tmp = sqrt((-4.0 * ((U * (n * (l ^ 2.0))) / Om)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[l, 6.1e+63], And[N[Not[LessEqual[l, 2.5e+166]], $MachinePrecision], LessEqual[l, 2.8e+224]]], N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.1 \cdot 10^{+63} \lor \neg \left(\ell \leq 2.5 \cdot 10^{+166}\right) \land \ell \leq 2.8 \cdot 10^{+224}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 6.09999999999999968e63 or 2.5000000000000001e166 < l < 2.80000000000000008e224

    1. Initial program 53.8%

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

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

      \[\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. Taylor expanded in t around inf 40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.09999999999999968e63 < l < 2.5000000000000001e166 or 2.80000000000000008e224 < l

    1. Initial program 40.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. Step-by-step derivation
      1. associate-*l/50.4%

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

      \[\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. Taylor expanded in n around 0 38.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 6.1 \cdot 10^{+63} \lor \neg \left(\ell \leq 2.5 \cdot 10^{+166}\right) \land \ell \leq 2.8 \cdot 10^{+224}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}}\\ \end{array} \]

Alternative 9: 41.3% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ t_2 := n \cdot {\ell}^{2}\\ \mathbf{if}\;\ell \leq 2.4 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+166}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{t_2}}}\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+224}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U \cdot t_2}{Om}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (sqrt (fabs (* t (* n (* 2.0 U)))))) (t_2 (* n (pow l 2.0))))
   (if (<= l 2.4e+61)
     t_1
     (if (<= l 3.2e+166)
       (sqrt (* -4.0 (/ U (/ Om t_2))))
       (if (<= l 5.8e+224) t_1 (sqrt (* -4.0 (/ (* U t_2) Om))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = sqrt(fabs((t * (n * (2.0 * U)))));
	double t_2 = n * pow(l, 2.0);
	double tmp;
	if (l <= 2.4e+61) {
		tmp = t_1;
	} else if (l <= 3.2e+166) {
		tmp = sqrt((-4.0 * (U / (Om / t_2))));
	} else if (l <= 5.8e+224) {
		tmp = t_1;
	} else {
		tmp = sqrt((-4.0 * ((U * t_2) / Om)));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = sqrt(abs((t * (n * (2.0d0 * u)))))
    t_2 = n * (l ** 2.0d0)
    if (l <= 2.4d+61) then
        tmp = t_1
    else if (l <= 3.2d+166) then
        tmp = sqrt(((-4.0d0) * (u / (om / t_2))))
    else if (l <= 5.8d+224) then
        tmp = t_1
    else
        tmp = sqrt(((-4.0d0) * ((u * t_2) / om)))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
	double t_2 = n * Math.pow(l, 2.0);
	double tmp;
	if (l <= 2.4e+61) {
		tmp = t_1;
	} else if (l <= 3.2e+166) {
		tmp = Math.sqrt((-4.0 * (U / (Om / t_2))));
	} else if (l <= 5.8e+224) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt((-4.0 * ((U * t_2) / Om)));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	t_1 = math.sqrt(math.fabs((t * (n * (2.0 * U)))))
	t_2 = n * math.pow(l, 2.0)
	tmp = 0
	if l <= 2.4e+61:
		tmp = t_1
	elif l <= 3.2e+166:
		tmp = math.sqrt((-4.0 * (U / (Om / t_2))))
	elif l <= 5.8e+224:
		tmp = t_1
	else:
		tmp = math.sqrt((-4.0 * ((U * t_2) / Om)))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U)))))
	t_2 = Float64(n * (l ^ 2.0))
	tmp = 0.0
	if (l <= 2.4e+61)
		tmp = t_1;
	elseif (l <= 3.2e+166)
		tmp = sqrt(Float64(-4.0 * Float64(U / Float64(Om / t_2))));
	elseif (l <= 5.8e+224)
		tmp = t_1;
	else
		tmp = sqrt(Float64(-4.0 * Float64(Float64(U * t_2) / Om)));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = sqrt(abs((t * (n * (2.0 * U)))));
	t_2 = n * (l ^ 2.0);
	tmp = 0.0;
	if (l <= 2.4e+61)
		tmp = t_1;
	elseif (l <= 3.2e+166)
		tmp = sqrt((-4.0 * (U / (Om / t_2))));
	elseif (l <= 5.8e+224)
		tmp = t_1;
	else
		tmp = sqrt((-4.0 * ((U * t_2) / Om)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 2.4e+61], t$95$1, If[LessEqual[l, 3.2e+166], N[Sqrt[N[(-4.0 * N[(U / N[(Om / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5.8e+224], t$95$1, N[Sqrt[N[(-4.0 * N[(N[(U * t$95$2), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\
t_2 := n \cdot {\ell}^{2}\\
\mathbf{if}\;\ell \leq 2.4 \cdot 10^{+61}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+166}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{t_2}}}\\

\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+224}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot t_2}{Om}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.3999999999999999e61 or 3.19999999999999968e166 < l < 5.79999999999999978e224

    1. Initial program 53.8%

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

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

      \[\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. Taylor expanded in t around inf 40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3999999999999999e61 < l < 3.19999999999999968e166

    1. Initial program 51.7%

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{U}{\frac{Om}{{\ell}^{2} \cdot n}}} \cdot -4} \]
      3. *-commutative41.0%

        \[\leadsto \sqrt{\frac{U}{\frac{Om}{\color{blue}{n \cdot {\ell}^{2}}}} \cdot -4} \]
    7. Simplified41.0%

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

    if 5.79999999999999978e224 < l

    1. Initial program 31.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. Step-by-step derivation
      1. associate-*l/41.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.4 \cdot 10^{+61}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ \mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+166}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{n \cdot {\ell}^{2}}}}\\ \mathbf{elif}\;\ell \leq 5.8 \cdot 10^{+224}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}}\\ \end{array} \]

Alternative 10: 44.8% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 1.35 \cdot 10^{+61}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+149}:\\ \;\;\;\;\sqrt{\frac{-4 \cdot \left(n \cdot \left(U \cdot {\ell}^{2}\right)\right)}{Om}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{-2 \cdot \frac{n \cdot U}{Om}}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= l 1.35e+61)
   (sqrt (fabs (* t (* n (* 2.0 U)))))
   (if (<= l 5.5e+149)
     (sqrt (/ (* -4.0 (* n (* U (pow l 2.0)))) Om))
     (* (* l (sqrt 2.0)) (sqrt (* -2.0 (/ (* n U) Om)))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 1.35e+61) {
		tmp = sqrt(fabs((t * (n * (2.0 * U)))));
	} else if (l <= 5.5e+149) {
		tmp = sqrt(((-4.0 * (n * (U * pow(l, 2.0)))) / Om));
	} else {
		tmp = (l * sqrt(2.0)) * sqrt((-2.0 * ((n * U) / Om)));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (l <= 1.35d+61) then
        tmp = sqrt(abs((t * (n * (2.0d0 * u)))))
    else if (l <= 5.5d+149) then
        tmp = sqrt((((-4.0d0) * (n * (u * (l ** 2.0d0)))) / om))
    else
        tmp = (l * sqrt(2.0d0)) * sqrt(((-2.0d0) * ((n * u) / om)))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 1.35e+61) {
		tmp = Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
	} else if (l <= 5.5e+149) {
		tmp = Math.sqrt(((-4.0 * (n * (U * Math.pow(l, 2.0)))) / Om));
	} else {
		tmp = (l * Math.sqrt(2.0)) * Math.sqrt((-2.0 * ((n * U) / Om)));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 1.35e+61:
		tmp = math.sqrt(math.fabs((t * (n * (2.0 * U)))))
	elif l <= 5.5e+149:
		tmp = math.sqrt(((-4.0 * (n * (U * math.pow(l, 2.0)))) / Om))
	else:
		tmp = (l * math.sqrt(2.0)) * math.sqrt((-2.0 * ((n * U) / Om)))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 1.35e+61)
		tmp = sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U)))));
	elseif (l <= 5.5e+149)
		tmp = sqrt(Float64(Float64(-4.0 * Float64(n * Float64(U * (l ^ 2.0)))) / Om));
	else
		tmp = Float64(Float64(l * sqrt(2.0)) * sqrt(Float64(-2.0 * Float64(Float64(n * U) / Om))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 1.35e+61)
		tmp = sqrt(abs((t * (n * (2.0 * U)))));
	elseif (l <= 5.5e+149)
		tmp = sqrt(((-4.0 * (n * (U * (l ^ 2.0)))) / Om));
	else
		tmp = (l * sqrt(2.0)) * sqrt((-2.0 * ((n * U) / Om)));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.35e+61], N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5.5e+149], N[Sqrt[N[(N[(-4.0 * N[(n * N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision], N[(N[(l * 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 = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.35 \cdot 10^{+61}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\

\mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+149}:\\
\;\;\;\;\sqrt{\frac{-4 \cdot \left(n \cdot \left(U \cdot {\ell}^{2}\right)\right)}{Om}}\\

\mathbf{else}:\\
\;\;\;\;\left(\ell \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 < 1.3500000000000001e61

    1. Initial program 56.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. Step-by-step derivation
      1. associate-*l/60.6%

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

      \[\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. Taylor expanded in t around inf 42.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3500000000000001e61 < l < 5.49999999999999999e149

    1. Initial program 55.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. Step-by-step derivation
      1. associate-*l/55.0%

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

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

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

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

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

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

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

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

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

    if 5.49999999999999999e149 < l

    1. Initial program 23.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. Simplified50.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. Taylor expanded in l around inf 54.4%

      \[\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)} \]
    4. Step-by-step derivation
      1. associate-/l*57.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 1.35 \cdot 10^{+61}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+149}:\\ \;\;\;\;\sqrt{\frac{-4 \cdot \left(n \cdot \left(U \cdot {\ell}^{2}\right)\right)}{Om}}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{-2 \cdot \frac{n \cdot U}{Om}}\\ \end{array} \]

Alternative 11: 38.5% accurate, 1.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (sqrt (fabs (* t (* n (* 2.0 U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt(fabs((t * (n * (2.0 * U)))));
}
NOTE: l should be positive before calling this function
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(abs((t * (n * (2.0d0 * u)))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt(Math.abs((t * (n * (2.0 * U)))));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt(math.fabs((t * (n * (2.0 * U)))))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(abs(Float64(t * Float64(n * Float64(2.0 * U)))))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt(abs((t * (n * (2.0 * U)))));
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[Abs[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{\left|t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right|}
\end{array}
Derivation
  1. Initial program 51.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. Step-by-step derivation
    1. associate-*l/58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 38.4% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ {\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*) :precision binary64 (pow (* (* 2.0 U) (* n t)) 0.5))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return pow(((2.0 * U) * (n * t)), 0.5);
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = ((2.0d0 * u) * (n * t)) ** 0.5d0
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.pow(((2.0 * U) * (n * t)), 0.5);
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.pow(((2.0 * U) * (n * t)), 0.5)
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = ((2.0 * U) * (n * t)) ^ 0.5;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 51.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. Simplified55.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. Taylor expanded in l around 0 35.6%

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

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

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

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

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

Alternative 13: 36.3% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (U * (n * t))));
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt((2.0d0 * (u * (n * t))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((2.0 * (U * (n * t))));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (U * (n * t))))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(n * t))))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (U * (n * t))));
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 51.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. Simplified55.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. Taylor expanded in l around 0 35.6%

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

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

Alternative 14: 35.8% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* t (* n U)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (t * (n * U))));
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    code = sqrt((2.0d0 * (t * (n * u))))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt((2.0 * (t * (n * U))));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (t * (n * U))))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(t * Float64(n * U))))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (t * (n * U))));
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}
\end{array}
Derivation
  1. Initial program 51.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. Simplified55.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. Taylor expanded in l around 0 35.6%

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

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

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

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

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

Reproduce

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