Toniolo and Linder, Equation (13)

Percentage Accurate: 49.7% → 63.3%
Time: 23.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: 63.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \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_1 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \left(\ell \cdot U*\right) \cdot \frac{n}{Om}\right)\right)}\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+252}:\\
\;\;\;\;\sqrt{t_1}\\

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


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

    1. Initial program 4.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. Simplified42.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 U* around inf 39.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 4.9999999999999997e252

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

    if 4.9999999999999997e252 < (*.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 19.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. Simplified36.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 inf 46.1%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv46.1%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*42.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 62.5% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_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)}\\
\mathbf{if}\;t_1 \leq 0:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}\\

\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+126}:\\
\;\;\;\;t_1\\

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


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

    1. Initial program 5.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. Simplified40.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 inf 29.3%

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{t \cdot U}} \]
      2. *-commutative46.3%

        \[\leadsto \sqrt{2 \cdot n} \cdot \sqrt{\color{blue}{U \cdot t}} \]
    5. Applied egg-rr46.3%

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}} \]

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 3.9999999999999997e126

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

    if 3.9999999999999997e126 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))))

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv45.6%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*42.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 61.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2.2 \cdot 10^{-15}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+103}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{n}{\frac{Om}{\ell \cdot U*}}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \sqrt{2}\right) \cdot \sqrt{\frac{n}{\frac{Om}{U \cdot \left(-2 + \frac{n}{\frac{Om}{U* - U}}\right)}}}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= l -2.2e-15)
   (sqrt
    (+
     (* 2.0 (* n (* U t)))
     (* 2.0 (* (/ n (/ Om (* U l))) (+ (* l -2.0) (/ (* n (* l U*)) Om))))))
   (if (<= l 6.2e+103)
     (sqrt
      (*
       (* 2.0 n)
       (* U (+ t (* (/ l Om) (fma l -2.0 (/ n (/ Om (* l U*)))))))))
     (*
      (* l (sqrt 2.0))
      (sqrt (/ n (/ Om (* U (+ -2.0 (/ n (/ Om (- U* U))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= -2.2e-15) {
		tmp = sqrt(((2.0 * (n * (U * t))) + (2.0 * ((n / (Om / (U * l))) * ((l * -2.0) + ((n * (l * U_42_)) / Om))))));
	} else if (l <= 6.2e+103) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l / Om) * fma(l, -2.0, (n / (Om / (l * U_42_)))))))));
	} else {
		tmp = (l * sqrt(2.0)) * sqrt((n / (Om / (U * (-2.0 + (n / (Om / (U_42_ - U))))))));
	}
	return tmp;
}
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= -2.2e-15)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * Float64(U * t))) + Float64(2.0 * Float64(Float64(n / Float64(Om / Float64(U * l))) * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))))));
	elseif (l <= 6.2e+103)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l / Om) * fma(l, -2.0, Float64(n / Float64(Om / Float64(l * U_42_)))))))));
	else
		tmp = Float64(Float64(l * sqrt(2.0)) * sqrt(Float64(n / Float64(Om / Float64(U * Float64(-2.0 + Float64(n / Float64(Om / Float64(U_42_ - U)))))))));
	end
	return tmp
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, -2.2e-15], N[Sqrt[N[(N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(n / N[(Om / N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 6.2e+103], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l / Om), $MachinePrecision] * N[(l * -2.0 + N[(n / N[(Om / N[(l * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(n / N[(Om / N[(U * N[(-2.0 + N[(n / N[(Om / N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\

\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+103}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell}{Om} \cdot \mathsf{fma}\left(\ell, -2, \frac{n}{\frac{Om}{\ell \cdot U*}}\right)\right)\right)}\\

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


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

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

      \[\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 49.0%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv49.1%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*46.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999986e-15 < l < 6.2000000000000003e103

    1. Initial program 62.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. Simplified61.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 inf 65.0%

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

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

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

    if 6.2000000000000003e103 < l

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv45.9%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*45.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 59.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\\ t_2 := 2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\\ \mathbf{if}\;\ell \leq -3.9 \cdot 10^{-26}:\\ \;\;\;\;\sqrt{t_2 + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot t_1\right)}\\ \mathbf{elif}\;\ell \leq 10^{-112}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot t_1}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 2.65 \cdot 10^{+208}:\\ \;\;\;\;\sqrt{t_2 + 2 \cdot \left(\left(\ell \cdot -2 + \frac{n}{Om} \cdot \left(\ell \cdot \left(U* - U\right)\right)\right) \cdot \left(\left(n \cdot \left(U \cdot \ell\right)\right) \cdot \frac{1}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n}{\frac{Om}{U \cdot \left(-2 + U* \cdot \frac{n}{Om}\right)}}}\right)\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (+ (* l -2.0) (/ (* n (* l U*)) Om))) (t_2 (* 2.0 (* n (* U t)))))
   (if (<= l -3.9e-26)
     (sqrt (+ t_2 (* 2.0 (* (/ n (/ Om (* U l))) t_1))))
     (if (<= l 1e-112)
       (sqrt (* (* 2.0 n) (* U (+ t (/ (* l t_1) Om)))))
       (if (<= l 2.65e+208)
         (sqrt
          (+
           t_2
           (*
            2.0
            (*
             (+ (* l -2.0) (* (/ n Om) (* l (- U* U))))
             (* (* n (* U l)) (/ 1.0 Om))))))
         (*
          (sqrt 2.0)
          (* l (sqrt (/ n (/ Om (* U (+ -2.0 (* U* (/ n Om))))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om);
	double t_2 = 2.0 * (n * (U * t));
	double tmp;
	if (l <= -3.9e-26) {
		tmp = sqrt((t_2 + (2.0 * ((n / (Om / (U * l))) * t_1))));
	} else if (l <= 1e-112) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))));
	} else if (l <= 2.65e+208) {
		tmp = sqrt((t_2 + (2.0 * (((l * -2.0) + ((n / Om) * (l * (U_42_ - U)))) * ((n * (U * l)) * (1.0 / Om))))));
	} else {
		tmp = sqrt(2.0) * (l * sqrt((n / (Om / (U * (-2.0 + (U_42_ * (n / Om))))))));
	}
	return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (l * (-2.0d0)) + ((n * (l * u_42)) / om)
    t_2 = 2.0d0 * (n * (u * t))
    if (l <= (-3.9d-26)) then
        tmp = sqrt((t_2 + (2.0d0 * ((n / (om / (u * l))) * t_1))))
    else if (l <= 1d-112) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((l * t_1) / om)))))
    else if (l <= 2.65d+208) then
        tmp = sqrt((t_2 + (2.0d0 * (((l * (-2.0d0)) + ((n / om) * (l * (u_42 - u)))) * ((n * (u * l)) * (1.0d0 / om))))))
    else
        tmp = sqrt(2.0d0) * (l * sqrt((n / (om / (u * ((-2.0d0) + (u_42 * (n / om))))))))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om);
	double t_2 = 2.0 * (n * (U * t));
	double tmp;
	if (l <= -3.9e-26) {
		tmp = Math.sqrt((t_2 + (2.0 * ((n / (Om / (U * l))) * t_1))));
	} else if (l <= 1e-112) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))));
	} else if (l <= 2.65e+208) {
		tmp = Math.sqrt((t_2 + (2.0 * (((l * -2.0) + ((n / Om) * (l * (U_42_ - U)))) * ((n * (U * l)) * (1.0 / Om))))));
	} else {
		tmp = Math.sqrt(2.0) * (l * Math.sqrt((n / (Om / (U * (-2.0 + (U_42_ * (n / Om))))))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om)
	t_2 = 2.0 * (n * (U * t))
	tmp = 0
	if l <= -3.9e-26:
		tmp = math.sqrt((t_2 + (2.0 * ((n / (Om / (U * l))) * t_1))))
	elif l <= 1e-112:
		tmp = math.sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))))
	elif l <= 2.65e+208:
		tmp = math.sqrt((t_2 + (2.0 * (((l * -2.0) + ((n / Om) * (l * (U_42_ - U)))) * ((n * (U * l)) * (1.0 / Om))))))
	else:
		tmp = math.sqrt(2.0) * (l * math.sqrt((n / (Om / (U * (-2.0 + (U_42_ * (n / Om))))))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))
	t_2 = Float64(2.0 * Float64(n * Float64(U * t)))
	tmp = 0.0
	if (l <= -3.9e-26)
		tmp = sqrt(Float64(t_2 + Float64(2.0 * Float64(Float64(n / Float64(Om / Float64(U * l))) * t_1))));
	elseif (l <= 1e-112)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l * t_1) / Om)))));
	elseif (l <= 2.65e+208)
		tmp = sqrt(Float64(t_2 + Float64(2.0 * Float64(Float64(Float64(l * -2.0) + Float64(Float64(n / Om) * Float64(l * Float64(U_42_ - U)))) * Float64(Float64(n * Float64(U * l)) * Float64(1.0 / Om))))));
	else
		tmp = Float64(sqrt(2.0) * Float64(l * sqrt(Float64(n / Float64(Om / Float64(U * Float64(-2.0 + Float64(U_42_ * Float64(n / Om)))))))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om);
	t_2 = 2.0 * (n * (U * t));
	tmp = 0.0;
	if (l <= -3.9e-26)
		tmp = sqrt((t_2 + (2.0 * ((n / (Om / (U * l))) * t_1))));
	elseif (l <= 1e-112)
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))));
	elseif (l <= 2.65e+208)
		tmp = sqrt((t_2 + (2.0 * (((l * -2.0) + ((n / Om) * (l * (U_42_ - U)))) * ((n * (U * l)) * (1.0 / Om))))));
	else
		tmp = sqrt(2.0) * (l * sqrt((n / (Om / (U * (-2.0 + (U_42_ * (n / Om))))))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.9e-26], N[Sqrt[N[(t$95$2 + N[(2.0 * N[(N[(n / N[(Om / N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1e-112], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l * t$95$1), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.65e+208], N[Sqrt[N[(t$95$2 + N[(2.0 * N[(N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n / Om), $MachinePrecision] * N[(l * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(n * N[(U * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(n / N[(Om / N[(U * N[(-2.0 + N[(U$42$ * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

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

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


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

    1. Initial program 27.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. Simplified46.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 inf 50.5%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv50.6%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*47.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.89999999999999986e-26 < l < 9.9999999999999995e-113

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

    if 9.9999999999999995e-113 < l < 2.65e208

    1. Initial program 47.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. Simplified52.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 inf 51.0%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv51.0%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*54.4%

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

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

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

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

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

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

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

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

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

    if 2.65e208 < l

    1. Initial program 23.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. Simplified50.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 inf 49.0%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv49.0%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*44.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.9 \cdot 10^{-26}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\ \mathbf{elif}\;\ell \leq 10^{-112}:\\ \;\;\;\;\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.65 \cdot 10^{+208}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\left(\ell \cdot -2 + \frac{n}{Om} \cdot \left(\ell \cdot \left(U* - U\right)\right)\right) \cdot \left(\left(n \cdot \left(U \cdot \ell\right)\right) \cdot \frac{1}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{n}{\frac{Om}{U \cdot \left(-2 + U* \cdot \frac{n}{Om}\right)}}}\right)\\ \end{array} \]

Alternative 5: 59.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \ell \cdot \frac{\ell}{Om}\\ \mathbf{if}\;Om \leq -2.16 \cdot 10^{+83}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot t_1\right)\right)}\\ \mathbf{elif}\;Om \leq 5.6 \cdot 10^{+151}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(-2, t_1, t\right)\right)\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (* l (/ l Om))))
   (if (<= Om -2.16e+83)
     (sqrt (* (* 2.0 n) (* U (+ t (* -2.0 t_1)))))
     (if (<= Om 5.6e+151)
       (sqrt
        (+
         (* 2.0 (* n (* U t)))
         (*
          2.0
          (* (/ n (/ Om (* U l))) (+ (* l -2.0) (/ (* n (* l U*)) Om))))))
       (sqrt (* 2.0 (* U (* n (fma -2.0 t_1 t)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = l * (l / Om);
	double tmp;
	if (Om <= -2.16e+83) {
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * t_1)))));
	} else if (Om <= 5.6e+151) {
		tmp = sqrt(((2.0 * (n * (U * t))) + (2.0 * ((n / (Om / (U * l))) * ((l * -2.0) + ((n * (l * U_42_)) / Om))))));
	} else {
		tmp = sqrt((2.0 * (U * (n * fma(-2.0, t_1, t)))));
	}
	return tmp;
}
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l * Float64(l / Om))
	tmp = 0.0
	if (Om <= -2.16e+83)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * t_1)))));
	elseif (Om <= 5.6e+151)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * Float64(U * t))) + Float64(2.0 * Float64(Float64(n / Float64(Om / Float64(U * l))) * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))))));
	else
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * fma(-2.0, t_1, t)))));
	end
	return tmp
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Om, -2.16e+83], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 5.6e+151], N[Sqrt[N[(N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(n / N[(Om / N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
\mathbf{if}\;Om \leq -2.16 \cdot 10^{+83}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot t_1\right)\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \mathsf{fma}\left(-2, t_1, t\right)\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Om < -2.1599999999999999e83

    1. Initial program 53.6%

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

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

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

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

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

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

    if -2.1599999999999999e83 < Om < 5.59999999999999975e151

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

      \[\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 57.1%

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv57.1%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.59999999999999975e151 < Om

    1. Initial program 44.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. Simplified54.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 n around 0 44.3%

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

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

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

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

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

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

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

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

Alternative 6: 59.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Om \leq -1.1 \cdot 10^{+82} \lor \neg \left(Om \leq 4.5 \cdot 10^{+147}\right):\\ \;\;\;\;\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{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= Om -1.1e+82) (not (<= Om 4.5e+147)))
   (sqrt (* (* 2.0 n) (* U (+ t (* -2.0 (* l (/ l Om)))))))
   (sqrt
    (+
     (* 2.0 (* n (* U t)))
     (* 2.0 (* (/ n (/ Om (* U l))) (+ (* l -2.0) (/ (* n (* l U*)) Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -1.1e+82) || !(Om <= 4.5e+147)) {
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	} else {
		tmp = sqrt(((2.0 * (n * (U * t))) + (2.0 * ((n / (Om / (U * l))) * ((l * -2.0) + ((n * (l * U_42_)) / Om))))));
	}
	return tmp;
}
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 ((om <= (-1.1d+82)) .or. (.not. (om <= 4.5d+147))) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((-2.0d0) * (l * (l / om)))))))
    else
        tmp = sqrt(((2.0d0 * (n * (u * t))) + (2.0d0 * ((n / (om / (u * l))) * ((l * (-2.0d0)) + ((n * (l * u_42)) / om))))))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -1.1e+82) || !(Om <= 4.5e+147)) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	} else {
		tmp = Math.sqrt(((2.0 * (n * (U * t))) + (2.0 * ((n / (Om / (U * l))) * ((l * -2.0) + ((n * (l * U_42_)) / Om))))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (Om <= -1.1e+82) or not (Om <= 4.5e+147):
		tmp = math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))))
	else:
		tmp = math.sqrt(((2.0 * (n * (U * t))) + (2.0 * ((n / (Om / (U * l))) * ((l * -2.0) + ((n * (l * U_42_)) / Om))))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((Om <= -1.1e+82) || !(Om <= 4.5e+147))
		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 * Float64(n * Float64(U * t))) + Float64(2.0 * Float64(Float64(n / Float64(Om / Float64(U * l))) * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((Om <= -1.1e+82) || ~((Om <= 4.5e+147)))
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	else
		tmp = sqrt(((2.0 * (n * (U * t))) + (2.0 * ((n / (Om / (U * l))) * ((l * -2.0) + ((n * (l * U_42_)) / Om))))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[Om, -1.1e+82], N[Not[LessEqual[Om, 4.5e+147]], $MachinePrecision]], 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[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(n / N[(Om / N[(U * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.1 \cdot 10^{+82} \lor \neg \left(Om \leq 4.5 \cdot 10^{+147}\right):\\
\;\;\;\;\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{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -1.1000000000000001e82 or 4.50000000000000008e147 < Om

    1. Initial program 50.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. Simplified53.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 n around 0 47.9%

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

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

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

        \[\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)} \]
    5. Simplified58.4%

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

    if -1.1000000000000001e82 < Om < 4.50000000000000008e147

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \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. Step-by-step derivation
      1. div-inv56.9%

        \[\leadsto \sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right) + 2 \cdot \color{blue}{\left(\left(\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)\right) \cdot \frac{1}{Om}\right)}} \]
      2. associate-/l*53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -1.1 \cdot 10^{+82} \lor \neg \left(Om \leq 4.5 \cdot 10^{+147}\right):\\ \;\;\;\;\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{2 \cdot \left(n \cdot \left(U \cdot t\right)\right) + 2 \cdot \left(\frac{n}{\frac{Om}{U \cdot \ell}} \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)}\\ \end{array} \]

Alternative 7: 56.5% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\\ \mathbf{if}\;\ell \leq -1.15 \cdot 10^{+147}:\\ \;\;\;\;\sqrt{2 \cdot \frac{n \cdot \left(\ell \cdot \left(U \cdot t_1\right)\right)}{Om}}\\ \mathbf{elif}\;\ell \leq 8.8 \cdot 10^{+80}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{\ell \cdot t_1}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{n \cdot \frac{-2}{\frac{Om}{\ell \cdot \left(\ell \cdot \left(U \cdot \left(2 - U* \cdot \frac{n}{Om}\right)\right)\right)}}}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (+ (* l -2.0) (/ (* n (* l U*)) Om))))
   (if (<= l -1.15e+147)
     (sqrt (* 2.0 (/ (* n (* l (* U t_1))) Om)))
     (if (<= l 8.8e+80)
       (sqrt (* (* 2.0 n) (* U (+ t (/ (* l t_1) Om)))))
       (sqrt
        (* n (/ -2.0 (/ Om (* l (* l (* U (- 2.0 (* U* (/ n Om))))))))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om);
	double tmp;
	if (l <= -1.15e+147) {
		tmp = sqrt((2.0 * ((n * (l * (U * t_1))) / Om)));
	} else if (l <= 8.8e+80) {
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))));
	} else {
		tmp = sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))));
	}
	return tmp;
}
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 = (l * (-2.0d0)) + ((n * (l * u_42)) / om)
    if (l <= (-1.15d+147)) then
        tmp = sqrt((2.0d0 * ((n * (l * (u * t_1))) / om)))
    else if (l <= 8.8d+80) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((l * t_1) / om)))))
    else
        tmp = sqrt((n * ((-2.0d0) / (om / (l * (l * (u * (2.0d0 - (u_42 * (n / om))))))))))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om);
	double tmp;
	if (l <= -1.15e+147) {
		tmp = Math.sqrt((2.0 * ((n * (l * (U * t_1))) / Om)));
	} else if (l <= 8.8e+80) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))));
	} else {
		tmp = Math.sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om)
	tmp = 0
	if l <= -1.15e+147:
		tmp = math.sqrt((2.0 * ((n * (l * (U * t_1))) / Om)))
	elif l <= 8.8e+80:
		tmp = math.sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))))
	else:
		tmp = math.sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))
	tmp = 0.0
	if (l <= -1.15e+147)
		tmp = sqrt(Float64(2.0 * Float64(Float64(n * Float64(l * Float64(U * t_1))) / Om)));
	elseif (l <= 8.8e+80)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(Float64(l * t_1) / Om)))));
	else
		tmp = sqrt(Float64(n * Float64(-2.0 / Float64(Om / Float64(l * Float64(l * Float64(U * Float64(2.0 - Float64(U_42_ * Float64(n / Om))))))))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = (l * -2.0) + ((n * (l * U_42_)) / Om);
	tmp = 0.0;
	if (l <= -1.15e+147)
		tmp = sqrt((2.0 * ((n * (l * (U * t_1))) / Om)));
	elseif (l <= 8.8e+80)
		tmp = sqrt(((2.0 * n) * (U * (t + ((l * t_1) / Om)))));
	else
		tmp = sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.15e+147], N[Sqrt[N[(2.0 * N[(N[(n * N[(l * N[(U * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 8.8e+80], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t + N[(N[(l * t$95$1), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(n * N[(-2.0 / N[(Om / N[(l * N[(l * N[(U * N[(2.0 - N[(U$42$ * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\\
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+147}:\\
\;\;\;\;\sqrt{2 \cdot \frac{n \cdot \left(\ell \cdot \left(U \cdot t_1\right)\right)}{Om}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.15e147

    1. Initial program 12.6%

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

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

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

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

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

    if -1.15e147 < l < 8.80000000000000011e80

    1. Initial program 58.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. Simplified59.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 U around 0 62.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)}} \]

    if 8.80000000000000011e80 < l

    1. Initial program 28.7%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified48.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 34.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{-2 \cdot n}{\frac{\frac{\frac{Om}{U}}{2 - \color{blue}{\frac{n}{\frac{Om}{U* - U}}}}}{{\ell}^{2}}}} \]
      10. unpow233.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 51.4% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Om \leq -1.6 \cdot 10^{-67} \lor \neg \left(Om \leq 6 \cdot 10^{-48}\right):\\ \;\;\;\;\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{2 \cdot \frac{n \cdot \left(\ell \cdot \left(U \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)\right)}{Om}}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= Om -1.6e-67) (not (<= Om 6e-48)))
   (sqrt (* (* 2.0 n) (* U (+ t (* -2.0 (* l (/ l Om)))))))
   (sqrt
    (* 2.0 (/ (* n (* l (* U (+ (* l -2.0) (/ (* n (* l U*)) Om))))) Om)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -1.6e-67) || !(Om <= 6e-48)) {
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	} else {
		tmp = sqrt((2.0 * ((n * (l * (U * ((l * -2.0) + ((n * (l * U_42_)) / Om))))) / Om)));
	}
	return tmp;
}
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 ((om <= (-1.6d-67)) .or. (.not. (om <= 6d-48))) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((-2.0d0) * (l * (l / om)))))))
    else
        tmp = sqrt((2.0d0 * ((n * (l * (u * ((l * (-2.0d0)) + ((n * (l * u_42)) / om))))) / om)))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -1.6e-67) || !(Om <= 6e-48)) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	} else {
		tmp = Math.sqrt((2.0 * ((n * (l * (U * ((l * -2.0) + ((n * (l * U_42_)) / Om))))) / Om)));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (Om <= -1.6e-67) or not (Om <= 6e-48):
		tmp = math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))))
	else:
		tmp = math.sqrt((2.0 * ((n * (l * (U * ((l * -2.0) + ((n * (l * U_42_)) / Om))))) / Om)))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((Om <= -1.6e-67) || !(Om <= 6e-48))
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))))));
	else
		tmp = sqrt(Float64(2.0 * Float64(Float64(n * Float64(l * Float64(U * Float64(Float64(l * -2.0) + Float64(Float64(n * Float64(l * U_42_)) / Om))))) / Om)));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((Om <= -1.6e-67) || ~((Om <= 6e-48)))
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	else
		tmp = sqrt((2.0 * ((n * (l * (U * ((l * -2.0) + ((n * (l * U_42_)) / Om))))) / Om)));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[Om, -1.6e-67], N[Not[LessEqual[Om, 6e-48]], $MachinePrecision]], 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[(2.0 * N[(N[(n * N[(l * N[(U * N[(N[(l * -2.0), $MachinePrecision] + N[(N[(n * N[(l * U$42$), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.6 \cdot 10^{-67} \lor \neg \left(Om \leq 6 \cdot 10^{-48}\right):\\
\;\;\;\;\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{2 \cdot \frac{n \cdot \left(\ell \cdot \left(U \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)\right)}{Om}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -1.60000000000000011e-67 or 5.9999999999999998e-48 < Om

    1. Initial program 51.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. Simplified55.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 n around 0 49.0%

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)} \]
      3. associate-*r/55.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)} \]
    5. Simplified55.5%

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

    if -1.60000000000000011e-67 < Om < 5.9999999999999998e-48

    1. Initial program 37.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. Simplified53.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 U* around inf 54.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -1.6 \cdot 10^{-67} \lor \neg \left(Om \leq 6 \cdot 10^{-48}\right):\\ \;\;\;\;\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{2 \cdot \frac{n \cdot \left(\ell \cdot \left(U \cdot \left(\ell \cdot -2 + \frac{n \cdot \left(\ell \cdot U*\right)}{Om}\right)\right)\right)}{Om}}\\ \end{array} \]

Alternative 9: 48.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6.5 \cdot 10^{-52} \lor \neg \left(\ell \leq 3.5 \cdot 10^{-30}\right):\\ \;\;\;\;\sqrt{n \cdot \frac{-2}{\frac{Om}{\ell \cdot \left(\ell \cdot \left(U \cdot \left(2 - U* \cdot \frac{n}{Om}\right)\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= l -6.5e-52) (not (<= l 3.5e-30)))
   (sqrt (* n (/ -2.0 (/ Om (* l (* l (* U (- 2.0 (* U* (/ n Om))))))))))
   (pow (* 2.0 (* n (* U t))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((l <= -6.5e-52) || !(l <= 3.5e-30)) {
		tmp = sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))));
	} else {
		tmp = pow((2.0 * (n * (U * t))), 0.5);
	}
	return tmp;
}
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.5d-52)) .or. (.not. (l <= 3.5d-30))) then
        tmp = sqrt((n * ((-2.0d0) / (om / (l * (l * (u * (2.0d0 - (u_42 * (n / om))))))))))
    else
        tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((l <= -6.5e-52) || !(l <= 3.5e-30)) {
		tmp = Math.sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))));
	} else {
		tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (l <= -6.5e-52) or not (l <= 3.5e-30):
		tmp = math.sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))))
	else:
		tmp = math.pow((2.0 * (n * (U * t))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((l <= -6.5e-52) || !(l <= 3.5e-30))
		tmp = sqrt(Float64(n * Float64(-2.0 / Float64(Om / Float64(l * Float64(l * Float64(U * Float64(2.0 - Float64(U_42_ * Float64(n / Om))))))))));
	else
		tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((l <= -6.5e-52) || ~((l <= 3.5e-30)))
		tmp = sqrt((n * (-2.0 / (Om / (l * (l * (U * (2.0 - (U_42_ * (n / Om))))))))));
	else
		tmp = (2.0 * (n * (U * t))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[l, -6.5e-52], N[Not[LessEqual[l, 3.5e-30]], $MachinePrecision]], N[Sqrt[N[(n * N[(-2.0 / N[(Om / N[(l * N[(l * N[(U * N[(2.0 - N[(U$42$ * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{-52} \lor \neg \left(\ell \leq 3.5 \cdot 10^{-30}\right):\\
\;\;\;\;\sqrt{n \cdot \frac{-2}{\frac{Om}{\ell \cdot \left(\ell \cdot \left(U \cdot \left(2 - U* \cdot \frac{n}{Om}\right)\right)\right)}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -6.5e-52 or 3.5000000000000003e-30 < l

    1. Initial program 32.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{-2 \cdot n}{\frac{\frac{\frac{Om}{U}}{2 - \frac{n}{\frac{Om}{U* - U}}}}{\color{blue}{\ell \cdot \ell}}}} \]
    5. Simplified32.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5e-52 < l < 3.5000000000000003e-30

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
    6. Taylor expanded in n around 0 60.5%

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

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

Alternative 10: 49.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Om \leq -1.16 \cdot 10^{-96} \lor \neg \left(Om \leq 1.5 \cdot 10^{-48}\right):\\ \;\;\;\;\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(\ell \cdot \ell\right) \cdot \left(\left(U \cdot \left(2 - U* \cdot \frac{n}{Om}\right)\right) \cdot \frac{n \cdot -2}{Om}\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= Om -1.16e-96) (not (<= Om 1.5e-48)))
   (sqrt (* (* 2.0 n) (* U (+ t (* -2.0 (* l (/ l Om)))))))
   (sqrt (* (* l l) (* (* U (- 2.0 (* U* (/ n Om)))) (/ (* n -2.0) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -1.16e-96) || !(Om <= 1.5e-48)) {
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	} else {
		tmp = sqrt(((l * l) * ((U * (2.0 - (U_42_ * (n / Om)))) * ((n * -2.0) / Om))));
	}
	return tmp;
}
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 ((om <= (-1.16d-96)) .or. (.not. (om <= 1.5d-48))) then
        tmp = sqrt(((2.0d0 * n) * (u * (t + ((-2.0d0) * (l * (l / om)))))))
    else
        tmp = sqrt(((l * l) * ((u * (2.0d0 - (u_42 * (n / om)))) * ((n * (-2.0d0)) / om))))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((Om <= -1.16e-96) || !(Om <= 1.5e-48)) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	} else {
		tmp = Math.sqrt(((l * l) * ((U * (2.0 - (U_42_ * (n / Om)))) * ((n * -2.0) / Om))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (Om <= -1.16e-96) or not (Om <= 1.5e-48):
		tmp = math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))))
	else:
		tmp = math.sqrt(((l * l) * ((U * (2.0 - (U_42_ * (n / Om)))) * ((n * -2.0) / Om))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((Om <= -1.16e-96) || !(Om <= 1.5e-48))
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))))));
	else
		tmp = sqrt(Float64(Float64(l * l) * Float64(Float64(U * Float64(2.0 - Float64(U_42_ * Float64(n / Om)))) * Float64(Float64(n * -2.0) / Om))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((Om <= -1.16e-96) || ~((Om <= 1.5e-48)))
		tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
	else
		tmp = sqrt(((l * l) * ((U * (2.0 - (U_42_ * (n / Om)))) * ((n * -2.0) / Om))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[Om, -1.16e-96], N[Not[LessEqual[Om, 1.5e-48]], $MachinePrecision]], 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[(l * l), $MachinePrecision] * N[(N[(U * N[(2.0 - N[(U$42$ * N[(n / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(n * -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.16 \cdot 10^{-96} \lor \neg \left(Om \leq 1.5 \cdot 10^{-48}\right):\\
\;\;\;\;\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(\ell \cdot \ell\right) \cdot \left(\left(U \cdot \left(2 - U* \cdot \frac{n}{Om}\right)\right) \cdot \frac{n \cdot -2}{Om}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -1.16e-96 or 1.5e-48 < Om

    1. Initial program 50.6%

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{Om}\right)\right)} \]
      3. associate-*r/54.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)} \]
    5. Simplified54.5%

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

    if -1.16e-96 < Om < 1.5e-48

    1. Initial program 37.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. Simplified54.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 l around -inf 38.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{-2 \cdot n}{\frac{\frac{\frac{Om}{U}}{2 - \color{blue}{\frac{n}{\frac{Om}{U* - U}}}}}{{\ell}^{2}}}} \]
      10. unpow236.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -1.16 \cdot 10^{-96} \lor \neg \left(Om \leq 1.5 \cdot 10^{-48}\right):\\ \;\;\;\;\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(\ell \cdot \ell\right) \cdot \left(\left(U \cdot \left(2 - U* \cdot \frac{n}{Om}\right)\right) \cdot \frac{n \cdot -2}{Om}\right)}\\ \end{array} \]

Alternative 11: 39.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6 \cdot 10^{+129} \lor \neg \left(\ell \leq 1.85 \cdot 10^{+81}\right):\\ \;\;\;\;\sqrt{-4 \cdot \frac{n}{\frac{Om}{U \cdot \left(\ell \cdot \ell\right)}}}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (or (<= l -6e+129) (not (<= l 1.85e+81)))
   (sqrt (* -4.0 (/ n (/ Om (* U (* l l))))))
   (pow (* 2.0 (* n (* U t))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((l <= -6e+129) || !(l <= 1.85e+81)) {
		tmp = sqrt((-4.0 * (n / (Om / (U * (l * l))))));
	} else {
		tmp = pow((2.0 * (n * (U * t))), 0.5);
	}
	return tmp;
}
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 <= (-6d+129)) .or. (.not. (l <= 1.85d+81))) then
        tmp = sqrt(((-4.0d0) * (n / (om / (u * (l * l))))))
    else
        tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if ((l <= -6e+129) || !(l <= 1.85e+81)) {
		tmp = Math.sqrt((-4.0 * (n / (Om / (U * (l * l))))));
	} else {
		tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if (l <= -6e+129) or not (l <= 1.85e+81):
		tmp = math.sqrt((-4.0 * (n / (Om / (U * (l * l))))))
	else:
		tmp = math.pow((2.0 * (n * (U * t))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if ((l <= -6e+129) || !(l <= 1.85e+81))
		tmp = sqrt(Float64(-4.0 * Float64(n / Float64(Om / Float64(U * Float64(l * l))))));
	else
		tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if ((l <= -6e+129) || ~((l <= 1.85e+81)))
		tmp = sqrt((-4.0 * (n / (Om / (U * (l * l))))));
	else
		tmp = (2.0 * (n * (U * t))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[Or[LessEqual[l, -6e+129], N[Not[LessEqual[l, 1.85e+81]], $MachinePrecision]], N[Sqrt[N[(-4.0 * N[(n / N[(Om / N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6 \cdot 10^{+129} \lor \neg \left(\ell \leq 1.85 \cdot 10^{+81}\right):\\
\;\;\;\;\sqrt{-4 \cdot \frac{n}{\frac{Om}{U \cdot \left(\ell \cdot \ell\right)}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -6.0000000000000006e129 or 1.85e81 < l

    1. Initial program 22.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. Simplified44.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 l around -inf 31.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{-2 \cdot n}{\frac{\frac{\frac{Om}{U}}{2 - \color{blue}{\frac{n}{\frac{Om}{U* - U}}}}}{{\ell}^{2}}}} \]
      10. unpow230.6%

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

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

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

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

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

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

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

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

    if -6.0000000000000006e129 < l < 1.85e81

    1. Initial program 59.3%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
    6. Taylor expanded in n around 0 49.9%

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

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

Alternative 12: 39.5% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6.5 \cdot 10^{+129}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{n}{\frac{\frac{Om}{\ell \cdot \ell}}{U}}}\\ \mathbf{elif}\;\ell \leq 6.6 \cdot 10^{+80}:\\ \;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{n}{\frac{Om}{U \cdot \left(\ell \cdot \ell\right)}}}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= l -6.5e+129)
   (sqrt (* -4.0 (/ n (/ (/ Om (* l l)) U))))
   (if (<= l 6.6e+80)
     (pow (* 2.0 (* n (* U t))) 0.5)
     (sqrt (* -4.0 (/ n (/ Om (* U (* l l)))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= -6.5e+129) {
		tmp = sqrt((-4.0 * (n / ((Om / (l * l)) / U))));
	} else if (l <= 6.6e+80) {
		tmp = pow((2.0 * (n * (U * t))), 0.5);
	} else {
		tmp = sqrt((-4.0 * (n / (Om / (U * (l * l))))));
	}
	return tmp;
}
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.5d+129)) then
        tmp = sqrt(((-4.0d0) * (n / ((om / (l * l)) / u))))
    else if (l <= 6.6d+80) then
        tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
    else
        tmp = sqrt(((-4.0d0) * (n / (om / (u * (l * l))))))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= -6.5e+129) {
		tmp = Math.sqrt((-4.0 * (n / ((Om / (l * l)) / U))));
	} else if (l <= 6.6e+80) {
		tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
	} else {
		tmp = Math.sqrt((-4.0 * (n / (Om / (U * (l * l))))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= -6.5e+129:
		tmp = math.sqrt((-4.0 * (n / ((Om / (l * l)) / U))))
	elif l <= 6.6e+80:
		tmp = math.pow((2.0 * (n * (U * t))), 0.5)
	else:
		tmp = math.sqrt((-4.0 * (n / (Om / (U * (l * l))))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= -6.5e+129)
		tmp = sqrt(Float64(-4.0 * Float64(n / Float64(Float64(Om / Float64(l * l)) / U))));
	elseif (l <= 6.6e+80)
		tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5;
	else
		tmp = sqrt(Float64(-4.0 * Float64(n / Float64(Om / Float64(U * Float64(l * l))))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= -6.5e+129)
		tmp = sqrt((-4.0 * (n / ((Om / (l * l)) / U))));
	elseif (l <= 6.6e+80)
		tmp = (2.0 * (n * (U * t))) ^ 0.5;
	else
		tmp = sqrt((-4.0 * (n / (Om / (U * (l * l))))));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, -6.5e+129], N[Sqrt[N[(-4.0 * N[(n / N[(N[(Om / N[(l * l), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 6.6e+80], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(-4.0 * N[(n / N[(Om / N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{+129}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{n}{\frac{\frac{Om}{\ell \cdot \ell}}{U}}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -6.4999999999999995e129

    1. Initial program 16.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. Simplified41.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 l around -inf 27.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{-2 \cdot n}{\frac{\frac{\frac{Om}{U}}{2 - \color{blue}{\frac{n}{\frac{Om}{U* - U}}}}}{{\ell}^{2}}}} \]
      10. unpow227.2%

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

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

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

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

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

        \[\leadsto \sqrt{-4 \cdot \frac{n}{\frac{\frac{Om}{\color{blue}{\ell \cdot \ell}}}{U}}} \]
    8. Simplified17.1%

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

    if -6.4999999999999995e129 < l < 6.59999999999999982e80

    1. Initial program 59.3%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
    6. Taylor expanded in n around 0 49.9%

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

    if 6.59999999999999982e80 < l

    1. Initial program 28.7%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified48.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 34.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{-2 \cdot n}{\frac{\frac{\frac{Om}{U}}{2 - \color{blue}{\frac{n}{\frac{Om}{U* - U}}}}}{{\ell}^{2}}}} \]
      10. unpow233.6%

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

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

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

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

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

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

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

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

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

Alternative 13: 48.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (sqrt (* (* 2.0 n) (* U (+ t (* -2.0 (* l (/ l Om))))))))
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)))))));
}
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)))))))
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)))))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t + Float64(-2.0 * Float64(l * Float64(l / Om)))))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt(((2.0 * n) * (U * (t + (-2.0 * (l * (l / Om)))))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := 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]
\begin{array}{l}

\\
\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + -2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 46.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. Simplified55.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 n around 0 41.4%

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

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

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

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

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

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

Alternative 14: 37.4% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;n \leq -2 \cdot 10^{-105}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= n -2e-105)
   (pow (* 2.0 (* U (* n t))) 0.5)
   (pow (* 2.0 (* n (* U t))) 0.5)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= -2e-105) {
		tmp = pow((2.0 * (U * (n * t))), 0.5);
	} else {
		tmp = pow((2.0 * (n * (U * t))), 0.5);
	}
	return tmp;
}
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 <= (-2d-105)) then
        tmp = (2.0d0 * (u * (n * t))) ** 0.5d0
    else
        tmp = (2.0d0 * (n * (u * t))) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (n <= -2e-105) {
		tmp = Math.pow((2.0 * (U * (n * t))), 0.5);
	} else {
		tmp = Math.pow((2.0 * (n * (U * t))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if n <= -2e-105:
		tmp = math.pow((2.0 * (U * (n * t))), 0.5)
	else:
		tmp = math.pow((2.0 * (n * (U * t))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (n <= -2e-105)
		tmp = Float64(2.0 * Float64(U * Float64(n * t))) ^ 0.5;
	else
		tmp = Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (n <= -2e-105)
		tmp = (2.0 * (U * (n * t))) ^ 0.5;
	else
		tmp = (2.0 * (n * (U * t))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -2e-105], N[Power[N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 49.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. Simplified50.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 inf 32.5%

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

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

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

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

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

    if -1.99999999999999993e-105 < n

    1. Initial program 45.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. Simplified56.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 t around inf 36.0%

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

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

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

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

      \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
    6. Taylor expanded in n around 0 36.1%

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

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

Alternative 15: 37.3% accurate, 2.1× speedup?

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

\\
{\left(2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 46.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. Simplified55.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 inf 35.2%

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

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

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

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

    \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
  6. Taylor expanded in n around 0 35.3%

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

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

Alternative 16: 36.5% accurate, 2.1× speedup?

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

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

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

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

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

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

    \[\leadsto \color{blue}{{\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
  6. Step-by-step derivation
    1. *-un-lft-identity34.9%

      \[\leadsto \color{blue}{1 \cdot {\left(2 \cdot \left(\left(n \cdot t\right) \cdot U\right)\right)}^{0.5}} \]
    2. unpow1/234.8%

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

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

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

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

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

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

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

Alternative 17: 35.8% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)} \end{array} \]
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* 2.0 n) (* U t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt(((2.0 * n) * (U * t)));
}
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
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)));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt(((2.0 * n) * (U * t)))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(2.0 * n) * Float64(U * t)))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt(((2.0 * n) * (U * t)));
end
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}

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

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

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

Reproduce

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