Toniolo and Linder, Equation (13)

Percentage Accurate: 49.3% → 64.4%
Time: 25.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 49.3% accurate, 1.0× speedup?

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

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

Alternative 1: 64.4% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 18.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. Simplified18.3%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.7%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 2: 64.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 18.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. Simplified18.3%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right)} \]
    8. Applied egg-rr35.0%

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

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

    1. Initial program 66.7%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 3: 61.4% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{\left(\left(2 \cdot n\right) \cdot \left(U \cdot \mathsf{fma}\left(-2, \frac{{\ell}^{2}}{Om}, t\right)\right)\right)}^{0.5}\\


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

    1. Initial program 18.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. Simplified18.3%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right)} \]
    8. Applied egg-rr35.0%

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

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

    1. Initial program 66.7%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 57.2% accurate, 0.5× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right)} \]
    8. Applied egg-rr34.0%

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

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

    1. Initial program 66.7%

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

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

    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. Taylor expanded in Om around inf 20.6%

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

Alternative 5: 54.8% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -1.8499999999999999e-122 or 5.50000000000000031e-121 < n

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

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

    if -1.8499999999999999e-122 < n < 1.05e-276

    1. Initial program 55.8%

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

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

    if 1.05e-276 < n < 5.50000000000000031e-121

    1. Initial program 32.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. Simplified39.4%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -1.85 \cdot 10^{-122}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\right)\right)}\\ \mathbf{elif}\;n \leq 1.05 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \mathbf{elif}\;n \leq 5.5 \cdot 10^{-121}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\right)\right)}\\ \end{array} \]

Alternative 6: 48.3% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 8.80000000000000016e-281

    1. Initial program 56.2%

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

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

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

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

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

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

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

    if 8.80000000000000016e-281 < n

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 48.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 5.59999999999999989e-275

    1. Initial program 56.2%

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

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

    if 5.59999999999999989e-275 < n

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 48.3% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 7.20000000000000013e-281

    1. Initial program 56.2%

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

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

    if 7.20000000000000013e-281 < n

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 49.0% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 3.09999999999999992e-308

    1. Initial program 56.4%

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

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

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

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

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

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

    if 3.09999999999999992e-308 < n

    1. Initial program 45.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. Simplified47.0%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t + -2 \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \ell\right)}\right)} \]
    8. Applied egg-rr52.0%

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

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

Alternative 10: 40.3% accurate, 1.0× speedup?

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

\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+55}:\\
\;\;\;\;{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}\\

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


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

    1. Initial program 51.7%

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

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

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

    if 3.9999999999999999e-171 < l < 1.4e55

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

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

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

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

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

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

    if 1.4e55 < l

    1. Initial program 35.2%

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

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

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

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

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

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

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

Alternative 11: 44.4% accurate, 1.0× speedup?

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

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


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

    1. Initial program 51.7%

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

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

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

    if 5.3999999999999999e-173 < l

    1. Initial program 49.5%

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

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

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

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

Alternative 12: 38.0% accurate, 1.1× speedup?

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

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


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

    1. Initial program 51.6%

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

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

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

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

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

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

    if -1.80000000000000008e-189 < t

    1. Initial program 50.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 37.1% accurate, 2.1× speedup?

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

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


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

    1. Initial program 51.7%

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

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

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

    if 3.00000000000000013e-170 < l

    1. Initial program 49.5%

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

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

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

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

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

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

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

Alternative 14: 35.2% accurate, 2.1× speedup?

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

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


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

    1. Initial program 51.7%

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

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

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

    if 2.1000000000000001e-169 < l

    1. Initial program 49.5%

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

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

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

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

Alternative 15: 35.2% accurate, 2.1× speedup?

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

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

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

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

Reproduce

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