Toniolo and Linder, Equation (13)

Percentage Accurate: 49.7% → 69.3%
Time: 24.5s
Alternatives: 17
Speedup: 1.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 49.7% 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: 69.3% accurate, 0.5× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := n \cdot \left(U* - U\right)\\ t_2 := \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)\\ \mathbf{if}\;t_2 \leq 5 \cdot 10^{-309}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\ell}{Om} \cdot t_1\right)\right)\right)}\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{+301}:\\ \;\;\;\;\sqrt{t_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n \cdot \left(U \cdot \left(\frac{t_1}{Om} - 2\right)\right)}{Om}}\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 (* n (- U* U)))
        (t_2
         (*
          (* (* 2.0 n) U)
          (+
           (- t (* 2.0 (/ (* l l) Om)))
           (* (* n (pow (/ l Om) 2.0)) (- U* U))))))
   (if (<= t_2 5e-309)
     (sqrt
      (* (* 2.0 n) (* U (+ t (* (/ l Om) (fma l -2.0 (* (/ l Om) t_1)))))))
     (if (<= t_2 2e+301)
       (sqrt t_2)
       (* (sqrt 2.0) (* l (sqrt (/ (* n (* U (- (/ t_1 Om) 2.0))) Om))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = n * (U_42_ - U);
	double t_2 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + ((n * pow((l / Om), 2.0)) * (U_42_ - U)));
	double tmp;
	if (t_2 <= 5e-309) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l / Om) * fma(l, -2.0, ((l / Om) * t_1)))))));
	} else if (t_2 <= 2e+301) {
		tmp = sqrt(t_2);
	} else {
		tmp = sqrt(2.0) * (l * sqrt(((n * (U * ((t_1 / Om) - 2.0))) / Om)));
	}
	return tmp;
}
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(n * Float64(U_42_ - U))
	t_2 = 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_42_ - U))))
	tmp = 0.0
	if (t_2 <= 5e-309)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l / Om) * fma(l, -2.0, Float64(Float64(l / Om) * t_1)))))));
	elseif (t_2 <= 2e+301)
		tmp = sqrt(t_2);
	else
		tmp = Float64(sqrt(2.0) * Float64(l * sqrt(Float64(Float64(n * Float64(U * Float64(Float64(t_1 / Om) - 2.0))) / Om))));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 5e-309], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l / Om), $MachinePrecision] * N[(l * -2.0 + N[(N[(l / Om), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 2e+301], N[Sqrt[t$95$2], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(N[(n * N[(U * N[(N[(t$95$1 / Om), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := n \cdot \left(U* - U\right)\\
t_2 := \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)\\
\mathbf{if}\;t_2 \leq 5 \cdot 10^{-309}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\ell}{Om} \cdot t_1\right)\right)\right)}\\

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;\sqrt{t_2}\\

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


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

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

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

    if 4.9999999999999995e-309 < (*.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*)))) < 2.00000000000000011e301

    1. Initial program 99.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)} \]

    if 2.00000000000000011e301 < (*.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 21.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. Simplified40.8%

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

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

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

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

Alternative 2: 61.4% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := n \cdot \left(U* - U\right)\\ t_2 := \frac{t_1}{Om} - 2\\ \mathbf{if}\;\ell \leq 1.35 \cdot 10^{-6}:\\ \;\;\;\;\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{elif}\;\ell \leq 5.1 \cdot 10^{+179}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\ell}{Om} \cdot t_1\right)\right)\right)}\\ \mathbf{elif}\;\ell \leq 6.4 \cdot 10^{+240}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n \cdot \left(U \cdot t_2\right)}{Om}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(t_2 \cdot \left(U \cdot \ell\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
 (let* ((t_1 (* n (- U* U))) (t_2 (- (/ t_1 Om) 2.0)))
   (if (<= l 1.35e-6)
     (sqrt
      (*
       (* (* 2.0 n) U)
       (+ (- t (* 2.0 (* l (/ l Om)))) (* (* n (pow (/ l Om) 2.0)) (- U* U)))))
     (if (<= l 5.1e+179)
       (sqrt
        (* (* 2.0 n) (* U (+ t (* (/ l Om) (fma l -2.0 (* (/ l Om) t_1)))))))
       (if (<= l 6.4e+240)
         (* (sqrt 2.0) (* l (sqrt (/ (* n (* U t_2)) Om))))
         (sqrt (* (* 2.0 n) (* (/ l Om) (* t_2 (* U l))))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = n * (U_42_ - U);
	double t_2 = (t_1 / Om) - 2.0;
	double tmp;
	if (l <= 1.35e-6) {
		tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * (l * (l / Om)))) + ((n * pow((l / Om), 2.0)) * (U_42_ - U)))));
	} else if (l <= 5.1e+179) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l / Om) * fma(l, -2.0, ((l / Om) * t_1)))))));
	} else if (l <= 6.4e+240) {
		tmp = sqrt(2.0) * (l * sqrt(((n * (U * t_2)) / Om)));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * (t_2 * (U * l)))));
	}
	return tmp;
}
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(n * Float64(U_42_ - U))
	t_2 = Float64(Float64(t_1 / Om) - 2.0)
	tmp = 0.0
	if (l <= 1.35e-6)
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U_42_ - U)))));
	elseif (l <= 5.1e+179)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l / Om) * fma(l, -2.0, Float64(Float64(l / Om) * t_1)))))));
	elseif (l <= 6.4e+240)
		tmp = Float64(sqrt(2.0) * Float64(l * sqrt(Float64(Float64(n * Float64(U * t_2)) / Om))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(t_2 * Float64(U * l)))));
	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[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / Om), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[l, 1.35e-6], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5.1e+179], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l / Om), $MachinePrecision] * N[(l * -2.0 + N[(N[(l / Om), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 6.4e+240], N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(N[(n * N[(U * t$95$2), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(t$95$2 * N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := n \cdot \left(U* - U\right)\\
t_2 := \frac{t_1}{Om} - 2\\
\mathbf{if}\;\ell \leq 1.35 \cdot 10^{-6}:\\
\;\;\;\;\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{elif}\;\ell \leq 5.1 \cdot 10^{+179}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{\ell}{Om} \cdot t_1\right)\right)\right)}\\

\mathbf{elif}\;\ell \leq 6.4 \cdot 10^{+240}:\\
\;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n \cdot \left(U \cdot t_2\right)}{Om}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < 1.34999999999999999e-6

    1. Initial program 56.6%

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

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

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

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

    if 1.34999999999999999e-6 < l < 5.1000000000000002e179

    1. Initial program 67.1%

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

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

    if 5.1000000000000002e179 < l < 6.39999999999999994e240

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

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

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

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

    if 6.39999999999999994e240 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 62.1% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 6.2 \cdot 10^{-51}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 1.76 \cdot 10^{+192}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{elif}\;\ell \leq 4.7 \cdot 10^{+242}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n}{\frac{Om}{U \cdot \left(-2 - \left(U - U*\right) \cdot \frac{n}{Om}\right)}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(\left(\frac{n \cdot \left(U* - U\right)}{Om} - 2\right) \cdot \left(U \cdot \ell\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 6.2e-51)
   (sqrt
    (*
     (* 2.0 n)
     (* U (+ t (/ (* l (+ (* l -2.0) (/ (* n (* l U*)) Om))) Om)))))
   (if (<= l 1.76e+192)
     (sqrt
      (* (* 2.0 n) (* U (+ t (/ l (/ (/ Om (+ -2.0 (/ n (/ Om U*)))) l))))))
     (if (<= l 4.7e+242)
       (*
        (sqrt 2.0)
        (* l (sqrt (/ n (/ Om (* U (- -2.0 (* (- U U*) (/ n Om)))))))))
       (sqrt
        (*
         (* 2.0 n)
         (* (/ l Om) (* (- (/ (* n (- U* U)) Om) 2.0) (* U l)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 6.2e-51) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	} else if (l <= 1.76e+192) {
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else if (l <= 4.7e+242) {
		tmp = sqrt(2.0) * (l * sqrt((n / (Om / (U * (-2.0 - ((U - U_42_) * (n / Om))))))));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	}
	return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: tmp
    if (l <= 6.2d-51) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((l * ((l * (-2.0d0)) + ((n * (l * u_42)) / om))) / om)))))
    else if (l <= 1.76d+192) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + (l / ((om / ((-2.0d0) + (n / (om / u_42)))) / l))))))
    else if (l <= 4.7d+242) then
        tmp = sqrt(2.0d0) * (l * sqrt((n / (om / (u * ((-2.0d0) - ((u - u_42) * (n / om))))))))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * ((((n * (u_42 - u)) / om) - 2.0d0) * (u * l)))))
    end if
    code = tmp
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 6.2e-51) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	} else if (l <= 1.76e+192) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else if (l <= 4.7e+242) {
		tmp = Math.sqrt(2.0) * (l * Math.sqrt((n / (Om / (U * (-2.0 - ((U - U_42_) * (n / Om))))))));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 6.2e-51:
		tmp = math.sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))))
	elif l <= 1.76e+192:
		tmp = math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))))
	elif l <= 4.7e+242:
		tmp = math.sqrt(2.0) * (l * math.sqrt((n / (Om / (U * (-2.0 - ((U - U_42_) * (n / Om))))))))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 6.2e-51)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))) / Om)))));
	elseif (l <= 1.76e+192)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(l / Float64(Float64(Om / Float64(-2.0 + Float64(n / Float64(Om / U_42_)))) / l))))));
	elseif (l <= 4.7e+242)
		tmp = Float64(sqrt(2.0) * Float64(l * sqrt(Float64(n / Float64(Om / Float64(U * Float64(-2.0 - Float64(Float64(U - U_42_) * Float64(n / Om)))))))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(Float64(Float64(Float64(n * Float64(U_42_ - U)) / Om) - 2.0) * Float64(U * l)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 6.2e-51)
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	elseif (l <= 1.76e+192)
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	elseif (l <= 4.7e+242)
		tmp = sqrt(2.0) * (l * sqrt((n / (Om / (U * (-2.0 - ((U - U_42_) * (n / Om))))))));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	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, 6.2e-51], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.76e+192], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(l / N[(N[(Om / N[(-2.0 + N[(n / N[(Om / U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 4.7e+242], N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(n / N[(Om / N[(U * N[(-2.0 - N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] - 2.0), $MachinePrecision] * N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.2 \cdot 10^{-51}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < 6.1999999999999995e-51

    1. Initial program 55.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. Simplified57.6%

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

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

    if 6.1999999999999995e-51 < l < 1.76e192

    1. Initial program 64.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. Simplified69.4%

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

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

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

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

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

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

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

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

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

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

    if 1.76e192 < l < 4.69999999999999971e242

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.69999999999999971e242 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 6.2 \cdot 10^{-51}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 1.76 \cdot 10^{+192}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{elif}\;\ell \leq 4.7 \cdot 10^{+242}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n}{\frac{Om}{U \cdot \left(-2 - \left(U - U*\right) \cdot \frac{n}{Om}\right)}}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(\left(\frac{n \cdot \left(U* - U\right)}{Om} - 2\right) \cdot \left(U \cdot \ell\right)\right)\right)}\\ \end{array} \]

Alternative 4: 62.1% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \frac{n \cdot \left(U* - U\right)}{Om} - 2\\ \mathbf{if}\;\ell \leq 5 \cdot 10^{-51}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+181}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{elif}\;\ell \leq 1.66 \cdot 10^{+239}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n \cdot \left(U \cdot t_1\right)}{Om}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(t_1 \cdot \left(U \cdot \ell\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
 (let* ((t_1 (- (/ (* n (- U* U)) Om) 2.0)))
   (if (<= l 5e-51)
     (sqrt
      (*
       (* 2.0 n)
       (* U (+ t (/ (* l (+ (* l -2.0) (/ (* n (* l U*)) Om))) Om)))))
     (if (<= l 2.25e+181)
       (sqrt
        (* (* 2.0 n) (* U (+ t (/ l (/ (/ Om (+ -2.0 (/ n (/ Om U*)))) l))))))
       (if (<= l 1.66e+239)
         (* (sqrt 2.0) (* l (sqrt (/ (* n (* U t_1)) Om))))
         (sqrt (* (* 2.0 n) (* (/ l Om) (* t_1 (* U l))))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = ((n * (U_42_ - U)) / Om) - 2.0;
	double tmp;
	if (l <= 5e-51) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	} else if (l <= 2.25e+181) {
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else if (l <= 1.66e+239) {
		tmp = sqrt(2.0) * (l * sqrt(((n * (U * t_1)) / Om)));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * (t_1 * (U * l)))));
	}
	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 = ((n * (u_42 - u)) / om) - 2.0d0
    if (l <= 5d-51) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((l * ((l * (-2.0d0)) + ((n * (l * u_42)) / om))) / om)))))
    else if (l <= 2.25d+181) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + (l / ((om / ((-2.0d0) + (n / (om / u_42)))) / l))))))
    else if (l <= 1.66d+239) then
        tmp = sqrt(2.0d0) * (l * sqrt(((n * (u * t_1)) / om)))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * (t_1 * (u * l)))))
    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 = ((n * (U_42_ - U)) / Om) - 2.0;
	double tmp;
	if (l <= 5e-51) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	} else if (l <= 2.25e+181) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else if (l <= 1.66e+239) {
		tmp = Math.sqrt(2.0) * (l * Math.sqrt(((n * (U * t_1)) / Om)));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * (t_1 * (U * l)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	t_1 = ((n * (U_42_ - U)) / Om) - 2.0
	tmp = 0
	if l <= 5e-51:
		tmp = math.sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))))
	elif l <= 2.25e+181:
		tmp = math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))))
	elif l <= 1.66e+239:
		tmp = math.sqrt(2.0) * (l * math.sqrt(((n * (U * t_1)) / Om)))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * (t_1 * (U * l)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(Float64(Float64(n * Float64(U_42_ - U)) / Om) - 2.0)
	tmp = 0.0
	if (l <= 5e-51)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))) / Om)))));
	elseif (l <= 2.25e+181)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(l / Float64(Float64(Om / Float64(-2.0 + Float64(n / Float64(Om / U_42_)))) / l))))));
	elseif (l <= 1.66e+239)
		tmp = Float64(sqrt(2.0) * Float64(l * sqrt(Float64(Float64(n * Float64(U * t_1)) / Om))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(t_1 * Float64(U * l)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = ((n * (U_42_ - U)) / Om) - 2.0;
	tmp = 0.0;
	if (l <= 5e-51)
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	elseif (l <= 2.25e+181)
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	elseif (l <= 1.66e+239)
		tmp = sqrt(2.0) * (l * sqrt(((n * (U * t_1)) / Om)));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * (t_1 * (U * l)))));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[l, 5e-51], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.25e+181], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(l / N[(N[(Om / N[(-2.0 + N[(n / N[(Om / U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.66e+239], N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(N[(n * N[(U * t$95$1), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(t$95$1 * N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{n \cdot \left(U* - U\right)}{Om} - 2\\
\mathbf{if}\;\ell \leq 5 \cdot 10^{-51}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\

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

\mathbf{elif}\;\ell \leq 1.66 \cdot 10^{+239}:\\
\;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n \cdot \left(U \cdot t_1\right)}{Om}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < 5.00000000000000004e-51

    1. Initial program 55.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. Simplified57.6%

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

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

    if 5.00000000000000004e-51 < l < 2.25e181

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

    if 2.25e181 < l < 1.6599999999999999e239

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

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

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

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

    if 1.6599999999999999e239 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 5 \cdot 10^{-51}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 2.25 \cdot 10^{+181}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{elif}\;\ell \leq 1.66 \cdot 10^{+239}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n \cdot \left(U \cdot \left(\frac{n \cdot \left(U* - U\right)}{Om} - 2\right)\right)}{Om}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(\left(\frac{n \cdot \left(U* - U\right)}{Om} - 2\right) \cdot \left(U \cdot \ell\right)\right)\right)}\\ \end{array} \]

Alternative 5: 54.8% accurate, 1.8× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;U* \leq -1 \cdot 10^{+30} \lor \neg \left(U* \leq 2.6 \cdot 10^{-142}\right):\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \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 (or (<= U* -1e+30) (not (<= U* 2.6e-142)))
   (sqrt (* (* 2.0 n) (* U (+ t (/ l (/ (/ Om (+ -2.0 (/ n (/ Om U*)))) l))))))
   (sqrt (* (* (* 2.0 n) 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 ((U_42_ <= -1e+30) || !(U_42_ <= 2.6e-142)) {
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else {
		tmp = sqrt((((2.0 * n) * 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 ((u_42 <= (-1d+30)) .or. (.not. (u_42 <= 2.6d-142))) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + (l / ((om / ((-2.0d0) + (n / (om / u_42)))) / l))))))
    else
        tmp = sqrt((((2.0d0 * n) * 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 ((U_42_ <= -1e+30) || !(U_42_ <= 2.6e-142)) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else {
		tmp = Math.sqrt((((2.0 * n) * U) * (t + (-2.0 * (l * (l / Om))))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (U_42_ <= -1e+30) or not (U_42_ <= 2.6e-142):
		tmp = math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))))
	else:
		tmp = math.sqrt((((2.0 * n) * 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 ((U_42_ <= -1e+30) || !(U_42_ <= 2.6e-142))
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(l / Float64(Float64(Om / Float64(-2.0 + Float64(n / Float64(Om / U_42_)))) / l))))));
	else
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * 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 ((U_42_ <= -1e+30) || ~((U_42_ <= 2.6e-142)))
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	else
		tmp = sqrt((((2.0 * n) * 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[Or[LessEqual[U$42$, -1e+30], N[Not[LessEqual[U$42$, 2.6e-142]], $MachinePrecision]], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(l / N[(N[(Om / N[(-2.0 + N[(n / N[(Om / U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U* \leq -1 \cdot 10^{+30} \lor \neg \left(U* \leq 2.6 \cdot 10^{-142}\right):\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \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 U* < -1e30 or 2.6e-142 < U*

    1. Initial program 47.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1e30 < U* < 2.6e-142

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 57.9% accurate, 1.8× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.2 \cdot 10^{-112}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \mathbf{elif}\;\ell \leq 9.2 \cdot 10^{+179}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(\left(\frac{n \cdot \left(U* - U\right)}{Om} - 2\right) \cdot \left(U \cdot \ell\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 4.2e-112)
   (sqrt (* (* (* 2.0 n) U) t))
   (if (<= l 9.2e+179)
     (sqrt
      (* (* 2.0 n) (* U (+ t (/ l (/ (/ Om (+ -2.0 (/ n (/ Om U*)))) l))))))
     (sqrt
      (* (* 2.0 n) (* (/ l Om) (* (- (/ (* n (- U* U)) Om) 2.0) (* U l))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 4.2e-112) {
		tmp = sqrt((((2.0 * n) * U) * t));
	} else if (l <= 9.2e+179) {
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	}
	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 <= 4.2d-112) then
        tmp = sqrt((((2.0d0 * n) * u) * t))
    else if (l <= 9.2d+179) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + (l / ((om / ((-2.0d0) + (n / (om / u_42)))) / l))))))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * ((((n * (u_42 - u)) / om) - 2.0d0) * (u * l)))))
    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 <= 4.2e-112) {
		tmp = Math.sqrt((((2.0 * n) * U) * t));
	} else if (l <= 9.2e+179) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 4.2e-112:
		tmp = math.sqrt((((2.0 * n) * U) * t))
	elif l <= 9.2e+179:
		tmp = math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 4.2e-112)
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t));
	elseif (l <= 9.2e+179)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(l / Float64(Float64(Om / Float64(-2.0 + Float64(n / Float64(Om / U_42_)))) / l))))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(Float64(Float64(Float64(n * Float64(U_42_ - U)) / Om) - 2.0) * Float64(U * l)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 4.2e-112)
		tmp = sqrt((((2.0 * n) * U) * t));
	elseif (l <= 9.2e+179)
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	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, 4.2e-112], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 9.2e+179], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(l / N[(N[(Om / N[(-2.0 + N[(n / N[(Om / U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] - 2.0), $MachinePrecision] * N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.2 \cdot 10^{-112}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\

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

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


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

    1. Initial program 54.7%

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \color{blue}{\frac{\ell}{\frac{Om}{\ell}}}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      2. associate-/r/58.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-rr58.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 42.2%

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

    if 4.2000000000000001e-112 < l < 9.19999999999999976e179

    1. Initial program 68.1%

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

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

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

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

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

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

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

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

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

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

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

    if 9.19999999999999976e179 < l

    1. Initial program 4.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. Simplified42.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell \cdot \left(\ell \cdot -2 + \color{blue}{\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)}\right)}{Om} \cdot U\right)} \]
      10. fma-udef32.9%

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

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

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

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

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

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

Alternative 7: 60.6% accurate, 1.8× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 4.4 \cdot 10^{-51}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 3.35 \cdot 10^{+179}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{\frac{\frac{Om}{-2 + \frac{n}{\frac{Om}{U*}}}}{\ell}}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(\left(\frac{n \cdot \left(U* - U\right)}{Om} - 2\right) \cdot \left(U \cdot \ell\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 4.4e-51)
   (sqrt
    (*
     (* 2.0 n)
     (* U (+ t (/ (* l (+ (* l -2.0) (/ (* n (* l U*)) Om))) Om)))))
   (if (<= l 3.35e+179)
     (sqrt
      (* (* 2.0 n) (* U (+ t (/ l (/ (/ Om (+ -2.0 (/ n (/ Om U*)))) l))))))
     (sqrt
      (* (* 2.0 n) (* (/ l Om) (* (- (/ (* n (- U* U)) Om) 2.0) (* U l))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 4.4e-51) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	} else if (l <= 3.35e+179) {
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	}
	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 <= 4.4d-51) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((l * ((l * (-2.0d0)) + ((n * (l * u_42)) / om))) / om)))))
    else if (l <= 3.35d+179) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + (l / ((om / ((-2.0d0) + (n / (om / u_42)))) / l))))))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * ((((n * (u_42 - u)) / om) - 2.0d0) * (u * l)))))
    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 <= 4.4e-51) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	} else if (l <= 3.35e+179) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 4.4e-51:
		tmp = math.sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))))
	elif l <= 3.35e+179:
		tmp = math.sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 4.4e-51)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))) / Om)))));
	elseif (l <= 3.35e+179)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(l / Float64(Float64(Om / Float64(-2.0 + Float64(n / Float64(Om / U_42_)))) / l))))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(Float64(Float64(Float64(n * Float64(U_42_ - U)) / Om) - 2.0) * Float64(U * l)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 4.4e-51)
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * ((l * -2.0) + ((n * (l * U_42_)) / Om))) / Om)))));
	elseif (l <= 3.35e+179)
		tmp = sqrt(((2.0 * n) * (U * (t + (l / ((Om / (-2.0 + (n / (Om / U_42_)))) / l))))));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * ((((n * (U_42_ - U)) / Om) - 2.0) * (U * l)))));
	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, 4.4e-51], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 3.35e+179], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(l / N[(N[(Om / N[(-2.0 + N[(n / N[(Om / U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] - 2.0), $MachinePrecision] * N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.4 \cdot 10^{-51}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)}{Om}\right)\right)}\\

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

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


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

    1. Initial program 55.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. Simplified57.6%

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

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

    if 4.4e-51 < l < 3.3499999999999999e179

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.3499999999999999e179 < l

    1. Initial program 4.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. Simplified42.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell \cdot \left(\ell \cdot -2 + \color{blue}{\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)}\right)}{Om} \cdot U\right)} \]
      10. fma-udef32.9%

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

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

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

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

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

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

Alternative 8: 48.7% accurate, 1.8× speedup?

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

\mathbf{elif}\;U* \leq 4.2 \cdot 10^{+127}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \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(t + \frac{n}{\frac{Om \cdot Om}{\left(\ell \cdot \ell\right) \cdot U*}}\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U* < -1.22e150

    1. Initial program 33.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.22e150 < U* < 4.19999999999999983e127

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

    if 4.19999999999999983e127 < U*

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 48.5% accurate, 1.8× speedup?

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

\mathbf{elif}\;U* \leq 1.4 \cdot 10^{+127}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \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(t + \frac{n}{\frac{Om \cdot Om}{\left(\ell \cdot \ell\right) \cdot U*}}\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U* < -1.22e150

    1. Initial program 33.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.22e150 < U* < 1.4000000000000001e127

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e127 < U*

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 43.9% accurate, 1.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 3.5 \cdot 10^{+54}:\\ \;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\ \mathbf{elif}\;\ell \leq 7.2 \cdot 10^{+103}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(-2 \cdot \frac{\ell \cdot \ell}{\frac{Om}{U}}\right)}\\ \mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+120}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(U \cdot \left(\ell \cdot -2\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 3.5e+54)
   (pow (* 2.0 (* n (* U t))) 0.5)
   (if (<= l 7.2e+103)
     (sqrt (* (* 2.0 n) (* -2.0 (/ (* l l) (/ Om U)))))
     (if (<= l 9.5e+120)
       (sqrt (* (* (* 2.0 n) U) t))
       (sqrt (* (* 2.0 n) (* (/ l Om) (* U (* l -2.0)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 3.5e+54) {
		tmp = pow((2.0 * (n * (U * t))), 0.5);
	} else if (l <= 7.2e+103) {
		tmp = sqrt(((2.0 * n) * (-2.0 * ((l * l) / (Om / U)))));
	} else if (l <= 9.5e+120) {
		tmp = sqrt((((2.0 * n) * U) * t));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	}
	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 <= 3.5d+54) then
        tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
    else if (l <= 7.2d+103) then
        tmp = sqrt(((2.0d0 * n) * ((-2.0d0) * ((l * l) / (om / u)))))
    else if (l <= 9.5d+120) then
        tmp = sqrt((((2.0d0 * n) * u) * t))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * (u * (l * (-2.0d0))))))
    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 <= 3.5e+54) {
		tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
	} else if (l <= 7.2e+103) {
		tmp = Math.sqrt(((2.0 * n) * (-2.0 * ((l * l) / (Om / U)))));
	} else if (l <= 9.5e+120) {
		tmp = Math.sqrt((((2.0 * n) * U) * t));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 3.5e+54:
		tmp = math.pow((2.0 * (n * (U * t))), 0.5)
	elif l <= 7.2e+103:
		tmp = math.sqrt(((2.0 * n) * (-2.0 * ((l * l) / (Om / U)))))
	elif l <= 9.5e+120:
		tmp = math.sqrt((((2.0 * n) * U) * t))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 3.5e+54)
		tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5;
	elseif (l <= 7.2e+103)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(-2.0 * Float64(Float64(l * l) / Float64(Om / U)))));
	elseif (l <= 9.5e+120)
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(U * Float64(l * -2.0)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 3.5e+54)
		tmp = (2.0 * (n * (U * t))) ^ 0.5;
	elseif (l <= 7.2e+103)
		tmp = sqrt(((2.0 * n) * (-2.0 * ((l * l) / (Om / U)))));
	elseif (l <= 9.5e+120)
		tmp = sqrt((((2.0 * n) * U) * t));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	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, 3.5e+54], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[l, 7.2e+103], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(-2.0 * N[(N[(l * l), $MachinePrecision] / N[(Om / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 9.5e+120], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(U * N[(l * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.5 \cdot 10^{+54}:\\
\;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\

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

\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{+120}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < 3.5000000000000001e54

    1. Initial program 57.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. Simplified58.9%

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

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

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

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

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

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

    if 3.5000000000000001e54 < l < 7.20000000000000033e103

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.20000000000000033e103 < l < 9.5e120

    1. Initial program 100.0%

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

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

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

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

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

    if 9.5e120 < l

    1. Initial program 14.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell \cdot \left(\ell \cdot -2 + \color{blue}{\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)}\right)}{Om} \cdot U\right)} \]
      10. fma-udef39.0%

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

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

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

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

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

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

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

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

Alternative 11: 48.4% accurate, 1.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 2.9 \cdot 10^{+153}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\left(\ell \cdot \ell\right) \cdot -2}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(U \cdot \left(\ell \cdot -2\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 2.9e+153)
   (sqrt (* (* 2.0 n) (* U (+ t (/ (* (* l l) -2.0) Om)))))
   (sqrt (* (* 2.0 n) (* (/ l Om) (* U (* l -2.0)))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 2.9e+153) {
		tmp = sqrt(((2.0 * n) * (U * (t + (((l * l) * -2.0) / Om)))));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	}
	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.9d+153) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + (((l * l) * (-2.0d0)) / om)))))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * (u * (l * (-2.0d0))))))
    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.9e+153) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (((l * l) * -2.0) / Om)))));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 2.9e+153:
		tmp = math.sqrt(((2.0 * n) * (U * (t + (((l * l) * -2.0) / Om)))))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 2.9e+153)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(Float64(l * l) * -2.0) / Om)))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(U * Float64(l * -2.0)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 2.9e+153)
		tmp = sqrt(((2.0 * n) * (U * (t + (((l * l) * -2.0) / Om)))));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	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.9e+153], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(N[(l * l), $MachinePrecision] * -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(U * N[(l * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.9 \cdot 10^{+153}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\left(\ell \cdot \ell\right) \cdot -2}{Om}\right)\right)}\\

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


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

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

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

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

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

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

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

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

    if 2.90000000000000002e153 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 48.6% accurate, 1.9× speedup?

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

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


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

    1. Initial program 58.1%

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

        \[\leadsto \sqrt{\color{blue}{\left(2 \cdot n\right) \cdot \left(U \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)\right)}} \]
      2. sub-neg56.5%

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

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

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

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

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

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

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

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

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

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

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

    if 1.8000000000000001e180 < l

    1. Initial program 4.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. Simplified42.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell \cdot \left(\ell \cdot -2 + \color{blue}{\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)}\right)}{Om} \cdot U\right)} \]
      10. fma-udef32.9%

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

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

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

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

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

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

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

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

Alternative 13: 48.3% accurate, 1.9× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 5.8 \cdot 10^{+183}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell}{Om} \cdot \left(U \cdot \left(\ell \cdot -2\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.8e+183)
   (sqrt (* (* (* 2.0 n) U) (+ t (* -2.0 (* l (/ l Om))))))
   (sqrt (* (* 2.0 n) (* (/ l Om) (* U (* l -2.0)))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 5.8e+183) {
		tmp = sqrt((((2.0 * n) * U) * (t + (-2.0 * (l * (l / Om))))));
	} else {
		tmp = sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	}
	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.8d+183) then
        tmp = sqrt((((2.0d0 * n) * u) * (t + ((-2.0d0) * (l * (l / om))))))
    else
        tmp = sqrt(((2.0d0 * n) * ((l / om) * (u * (l * (-2.0d0))))))
    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.8e+183) {
		tmp = Math.sqrt((((2.0 * n) * U) * (t + (-2.0 * (l * (l / Om))))));
	} else {
		tmp = Math.sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 5.8e+183:
		tmp = math.sqrt((((2.0 * n) * U) * (t + (-2.0 * (l * (l / Om))))))
	else:
		tmp = math.sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 5.8e+183)
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om))))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(Float64(l / Om) * Float64(U * Float64(l * -2.0)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 5.8e+183)
		tmp = sqrt((((2.0 * n) * U) * (t + (-2.0 * (l * (l / Om))))));
	else
		tmp = sqrt(((2.0 * n) * ((l / Om) * (U * (l * -2.0)))));
	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.8e+183], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * N[(U * N[(l * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5.8 \cdot 10^{+183}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\

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


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

    1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

    if 5.8000000000000001e183 < l

    1. Initial program 4.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. Simplified42.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(\frac{\ell \cdot \left(\ell \cdot -2 + \color{blue}{\frac{\ell}{Om} \cdot \left(n \cdot \left(U* - U\right)\right)}\right)}{Om} \cdot U\right)} \]
      10. fma-udef32.9%

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

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

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

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

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

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

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

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

Alternative 14: 39.5% accurate, 2.0× speedup?

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

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


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

    1. Initial program 57.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. Simplified58.9%

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

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

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

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

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

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

    if 4.0000000000000003e54 < l

    1. Initial program 30.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 36.1% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;n \leq -5.2 \cdot 10^{-276}:\\ \;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \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.2e-276)
   (pow (* 2.0 (* n (* U t))) 0.5)
   (sqrt (* (* (* 2.0 n) U) t))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= -5.2e-276) {
		tmp = pow((2.0 * (n * (U * t))), 0.5);
	} else {
		tmp = sqrt((((2.0 * n) * U) * 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 (n <= (-5.2d-276)) then
        tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
    else
        tmp = sqrt((((2.0d0 * n) * u) * 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 (n <= -5.2e-276) {
		tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
	} else {
		tmp = Math.sqrt((((2.0 * n) * U) * t));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if n <= -5.2e-276:
		tmp = math.pow((2.0 * (n * (U * t))), 0.5)
	else:
		tmp = math.sqrt((((2.0 * n) * U) * t))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (n <= -5.2e-276)
		tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5;
	else
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (n <= -5.2e-276)
		tmp = (2.0 * (n * (U * t))) ^ 0.5;
	else
		tmp = sqrt((((2.0 * n) * U) * 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[n, -5.2e-276], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.2 \cdot 10^{-276}:\\
\;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\

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


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

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

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

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

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

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

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

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

    if -5.19999999999999969e-276 < n

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

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

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

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

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

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

Alternative 16: 35.5% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;n \leq -6.6 \cdot 10^{-276}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= n -6.6e-276)
   (sqrt (* (* 2.0 n) (* U t)))
   (sqrt (* (* (* 2.0 n) U) t))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= -6.6e-276) {
		tmp = sqrt(((2.0 * n) * (U * t)));
	} else {
		tmp = sqrt((((2.0 * n) * U) * 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 (n <= (-6.6d-276)) then
        tmp = sqrt(((2.0d0 * n) * (u * t)))
    else
        tmp = sqrt((((2.0d0 * n) * u) * 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 (n <= -6.6e-276) {
		tmp = Math.sqrt(((2.0 * n) * (U * t)));
	} else {
		tmp = Math.sqrt((((2.0 * n) * U) * t));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if n <= -6.6e-276:
		tmp = math.sqrt(((2.0 * n) * (U * t)))
	else:
		tmp = math.sqrt((((2.0 * n) * U) * t))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (n <= -6.6e-276)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t)));
	else
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * t));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (n <= -6.6e-276)
		tmp = sqrt(((2.0 * n) * (U * t)));
	else
		tmp = sqrt((((2.0 * n) * U) * 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[n, -6.6e-276], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6.6 \cdot 10^{-276}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\

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


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

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

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

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

    if -6.59999999999999982e-276 < n

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

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

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

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

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

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

Alternative 17: 35.3% accurate, 2.1× speedup?

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

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

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

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

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

Reproduce

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