Toniolo and Linder, Equation (13)

Percentage Accurate: 50.0% → 63.2%
Time: 23.0s
Alternatives: 14
Speedup: 1.9×

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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 63.2% accurate, 0.2× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{t_5} \cdot \sqrt[3]{\sqrt{t_5}}\right) \cdot \left(l_m \cdot \sqrt{2}\right)\\


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

    1. Initial program 17.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. Simplified32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(n \cdot 2\right) \cdot U} \cdot \sqrt{\mathsf{fma}\left(-2, \color{blue}{\frac{\ell}{Om} \cdot \ell}, t\right)} \]
    11. Applied egg-rr38.7%

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

    if 2e-160 < (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 74.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/81.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-rr81.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. Simplified0.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around inf 36.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. add-cube-cbrt36.2%

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

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

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

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

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

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

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

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

Alternative 2: 63.0% accurate, 0.3× speedup?

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

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

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

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

    1. Initial program 17.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. Simplified32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(n \cdot 2\right) \cdot U} \cdot \sqrt{\mathsf{fma}\left(-2, \color{blue}{\frac{\ell}{Om} \cdot \ell}, t\right)} \]
    11. Applied egg-rr38.7%

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

    if 2e-160 < (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 74.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/81.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-rr81.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. Simplified0.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around inf 36.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. Taylor expanded in U* around inf 36.4%

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

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

Alternative 3: 62.2% accurate, 0.3× speedup?

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

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

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

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

    1. Initial program 17.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. Simplified32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(n \cdot 2\right) \cdot U} \cdot \sqrt{\mathsf{fma}\left(-2, \color{blue}{\frac{\ell}{Om} \cdot \ell}, t\right)} \]
    11. Applied egg-rr38.7%

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

    if 2e-160 < (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 74.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/81.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-rr81.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. Simplified0.4%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around inf 36.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. Taylor expanded in U around 0 36.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 60.0% accurate, 0.3× speedup?

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

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

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

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


\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 16.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. Simplified32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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 74.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/80.8%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 60.3% accurate, 0.3× speedup?

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

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

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

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


\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*))))) < 2e-160

    1. Initial program 17.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. Simplified32.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(n \cdot 2\right) \cdot U} \cdot \sqrt{\mathsf{fma}\left(-2, \color{blue}{\frac{\ell}{Om} \cdot \ell}, t\right)} \]
    11. Applied egg-rr38.7%

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

    if 2e-160 < (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 74.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/81.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-rr81.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. Simplified1.1%

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

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

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

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

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

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

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

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

      \[\leadsto {\left(2 \cdot \color{blue}{\left(-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot n\right)}{Om}\right)}\right)}^{0.5} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.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 2 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot U} \cdot \sqrt{\mathsf{fma}\left(-2, \ell \cdot \frac{\ell}{Om}, t\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(2 \cdot \left(-2 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)\right)}^{0.5}\\ \end{array} \]

Alternative 6: 52.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;l_m \leq 1.6 \cdot 10^{+262}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \left(l_m \cdot \frac{l_m}{Om}\right)\right)\right)\right)}^{0.5}\\

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


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

    1. Initial program 58.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.5999999999999999e262 < l

    1. Initial program 29.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. Simplified29.0%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around inf 90.5%

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

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

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

Alternative 7: 52.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;l_m \leq 6 \cdot 10^{+261}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \left(l_m \cdot \frac{l_m}{Om}\right)\right)\right)\right)}^{0.5}\\

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


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

    1. Initial program 58.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999957e261 < l

    1. Initial program 29.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. Simplified29.0%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around inf 90.5%

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

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

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

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

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

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

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

Alternative 8: 47.0% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;l_m \leq 900000000:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\

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


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

    1. Initial program 62.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    9. Step-by-step derivation
      1. pow-pow49.1%

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

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

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

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

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

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

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

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

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

    if 9e8 < l

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

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

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

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

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

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

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

Alternative 9: 52.4% accurate, 1.9× speedup?

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

\\
{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \left(l_m \cdot \frac{l_m}{Om}\right)\right)\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 57.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. Simplified58.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 37.7% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 63.4%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Step-by-step derivation
      1. associate-*l/66.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-rr66.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 t around inf 45.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    9. Step-by-step derivation
      1. pow-pow48.8%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999992e28 < l

    1. Initial program 39.9%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around 0 17.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2 \cdot 10^{+28}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\ \end{array} \]

Alternative 11: 35.7% accurate, 2.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -8.00000000000000008e55

    1. Initial program 59.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/77.8%

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

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

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

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

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

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

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

    if -8.00000000000000008e55 < Om

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Taylor expanded in l around 0 37.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -8 \cdot 10^{+55}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array} \]

Alternative 12: 35.9% accurate, 2.1× speedup?

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

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

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
  3. Taylor expanded in l around 0 38.5%

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

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

Alternative 13: 35.9% accurate, 2.1× speedup?

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

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

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
  3. Taylor expanded in l around 0 41.4%

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

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

Alternative 14: 35.9% accurate, 2.1× speedup?

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

\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}
\end{array}
Derivation
  1. Initial program 57.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/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 t around inf 38.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot n\right) \cdot \left(U \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
  9. Step-by-step derivation
    1. pow-pow41.9%

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

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

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

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

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

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

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

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

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

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

Reproduce

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