Toniolo and Linder, Equation (13)

Percentage Accurate: 49.1% → 64.3%
Time: 27.0s
Alternatives: 17
Speedup: 1.8×

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

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

Initial Program: 49.1% accurate, 1.0× speedup?

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

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

Alternative 1: 64.3% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 9.7%

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

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

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

    1. Initial program 66.8%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. *-commutative72.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. Applied egg-rr72.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)} \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 2: 64.6% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 9.7%

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

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

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

    1. Initial program 66.8%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. *-commutative72.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. Applied egg-rr72.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)} \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 3: 64.2% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 9.7%

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

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

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

    1. Initial program 66.8%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. *-commutative72.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. Applied egg-rr72.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)} \]

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

    1. Initial program 0.0%

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

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

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

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

        \[\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. *-commutative30.7%

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

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

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

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

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

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

Alternative 4: 61.3% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 9.7%

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

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

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

    1. Initial program 66.8%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. *-commutative72.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. Applied egg-rr72.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)} \]

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.2% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{\left(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 (*.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 9.7%

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

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

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

    1. Initial program 66.8%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. *-commutative72.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. Applied egg-rr72.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)} \]

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

    1. Initial program 0.0%

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

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

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/240.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*30.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. *-commutative30.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-inv30.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-eval30.1%

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

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

      \[\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 simplification62.6%

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

Alternative 6: 56.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 53.3%

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

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

    if 1.3e94 < l

    1. Initial program 20.6%

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

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

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

        \[\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*38.7%

        \[\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. *-commutative38.7%

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

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

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

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

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

        \[\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)} \]
    8. Applied egg-rr52.8%

      \[\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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.4%

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

Alternative 7: 55.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 53.6%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. *-commutative55.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. Applied egg-rr55.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)} \]
    5. Step-by-step derivation
      1. pow155.9%

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

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

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

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

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

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

    if 2.7999999999999998e49 < l

    1. Initial program 23.7%

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

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*39.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. *-commutative39.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-inv39.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-eval39.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} \]
    6. Applied egg-rr39.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}} \]
    7. Step-by-step derivation
      1. unpow222.4%

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
      2. associate-*l/36.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)} \]
    8. Applied egg-rr51.9%

      \[\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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.7%

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

Alternative 8: 54.6% accurate, 1.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.1000000000000001e-108 or 1.2e-102 < n

    1. Initial program 53.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. Simplified58.5%

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

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. Step-by-step derivation
      1. pow1/249.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*54.8%

        \[\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. *-commutative54.8%

        \[\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-inv54.8%

        \[\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-eval54.8%

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

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

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
      2. associate-*l/41.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)} \]
    8. Applied egg-rr58.2%

      \[\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.1000000000000001e-108 < n < 1.2e-102

    1. Initial program 36.8%

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

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

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

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

        \[\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)} \]
    6. Applied egg-rr53.5%

      \[\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 simplification56.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.1 \cdot 10^{-108} \lor \neg \left(n \leq 1.2 \cdot 10^{-102}\right):\\ \;\;\;\;{\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}:\\ \;\;\;\;\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} \]
  5. Add Preprocessing

Alternative 9: 48.7% accurate, 1.9× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \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 9.2e-69)
   (pow (* t (* 2.0 (* n U))) 0.5)
   (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 <= 9.2e-69) {
		tmp = pow((t * (2.0 * (n * U))), 0.5);
	} 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 <= 9.2d-69) then
        tmp = (t * (2.0d0 * (n * u))) ** 0.5d0
    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 <= 9.2e-69) {
		tmp = Math.pow((t * (2.0 * (n * U))), 0.5);
	} 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 <= 9.2e-69:
		tmp = math.pow((t * (2.0 * (n * U))), 0.5)
	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 <= 9.2e-69)
		tmp = Float64(t * Float64(2.0 * Float64(n * U))) ^ 0.5;
	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 <= 9.2e-69)
		tmp = (t * (2.0 * (n * U))) ^ 0.5;
	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, 9.2e-69], N[Power[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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 9.2 \cdot 10^{-69}:\\
\;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\

\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 < 9.2000000000000003e-69

    1. Initial program 52.7%

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

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

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

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

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

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

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

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

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

    if 9.2000000000000003e-69 < l

    1. Initial program 34.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. Simplified47.4%

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

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

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)\right)} \]
      2. associate-*l/44.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)} \]
    6. Applied egg-rr44.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 simplification44.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \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} \]
  5. Add Preprocessing

Alternative 10: 38.6% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 3.1 \cdot 10^{-32}:\\ \;\;\;\;\sqrt{t \cdot \left(2 \cdot \left(n \cdot U\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\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 3.1e-32)
   (sqrt (* t (* 2.0 (* n U))))
   (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 <= 3.1e-32) {
		tmp = sqrt((t * (2.0 * (n * U))));
	} 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 <= 3.1d-32) then
        tmp = sqrt((t * (2.0d0 * (n * u))))
    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 <= 3.1e-32) {
		tmp = Math.sqrt((t * (2.0 * (n * U))));
	} 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 <= 3.1e-32:
		tmp = math.sqrt((t * (2.0 * (n * U))))
	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 <= 3.1e-32)
		tmp = sqrt(Float64(t * Float64(2.0 * Float64(n * U))));
	else
		tmp = Float64(2.0 * Float64(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 <= 3.1e-32)
		tmp = sqrt((t * (2.0 * (n * U))));
	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, 3.1e-32], N[Sqrt[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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


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

    1. Initial program 52.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r/54.3%

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

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

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

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

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

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

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

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

    if 3.10000000000000011e-32 < l

    1. Initial program 33.7%

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

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

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

        \[\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*43.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. *-commutative43.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-inv43.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-eval43.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} \]
    6. Applied egg-rr43.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}} \]
    7. Taylor expanded in t around inf 23.2%

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

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

Alternative 11: 38.9% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 6.6 \cdot 10^{-32}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\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 6.6e-32)
   (pow (* 2.0 (* t (* n U))) 0.5)
   (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 <= 6.6e-32) {
		tmp = pow((2.0 * (t * (n * U))), 0.5);
	} 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 <= 6.6d-32) then
        tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
    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 <= 6.6e-32) {
		tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
	} 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 <= 6.6e-32:
		tmp = math.pow((2.0 * (t * (n * U))), 0.5)
	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 <= 6.6e-32)
		tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5;
	else
		tmp = Float64(2.0 * Float64(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 <= 6.6e-32)
		tmp = (2.0 * (t * (n * U))) ^ 0.5;
	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, 6.6e-32], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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


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

    1. Initial program 52.0%

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

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

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

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

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

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

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

    if 6.60000000000000051e-32 < l

    1. Initial program 33.7%

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

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

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

        \[\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*43.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. *-commutative43.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-inv43.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-eval43.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} \]
    6. Applied egg-rr43.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}} \]
    7. Taylor expanded in t around inf 23.2%

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

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

Alternative 12: 38.9% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 6.6 \cdot 10^{-32}:\\ \;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\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 6.6e-32)
   (pow (* t (* 2.0 (* n U))) 0.5)
   (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 <= 6.6e-32) {
		tmp = pow((t * (2.0 * (n * U))), 0.5);
	} 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 <= 6.6d-32) then
        tmp = (t * (2.0d0 * (n * u))) ** 0.5d0
    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 <= 6.6e-32) {
		tmp = Math.pow((t * (2.0 * (n * U))), 0.5);
	} 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 <= 6.6e-32:
		tmp = math.pow((t * (2.0 * (n * U))), 0.5)
	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 <= 6.6e-32)
		tmp = Float64(t * Float64(2.0 * Float64(n * U))) ^ 0.5;
	else
		tmp = Float64(2.0 * Float64(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 <= 6.6e-32)
		tmp = (t * (2.0 * (n * U))) ^ 0.5;
	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, 6.6e-32], N[Power[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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


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

    1. Initial program 52.0%

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

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

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

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

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

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

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

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

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

    if 6.60000000000000051e-32 < l

    1. Initial program 33.7%

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

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

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

        \[\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*43.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. *-commutative43.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-inv43.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-eval43.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} \]
    6. Applied egg-rr43.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}} \]
    7. Taylor expanded in t around inf 23.2%

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

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

Alternative 13: 36.4% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -6.0999999999999998e-226

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

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

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

    if -6.0999999999999998e-226 < Om

    1. Initial program 53.7%

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

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

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

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

Alternative 14: 36.5% accurate, 2.1× speedup?

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

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

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

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

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

Alternative 15: 36.3% 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 47.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. Simplified51.2%

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

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

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

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

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

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

Alternative 16: 36.4% accurate, 2.1× speedup?

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. *-commutative52.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. Applied egg-rr52.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)} \]
  5. Taylor expanded in t around inf 33.6%

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

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

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

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

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

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

Alternative 17: 36.4% 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 47.3%

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\left(\ell \cdot \frac{\ell}{Om}\right)}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. *-commutative52.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. Applied egg-rr52.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)} \]
  5. Step-by-step derivation
    1. pow152.9%

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

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

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

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

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

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

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

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

Reproduce

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