Toniolo and Linder, Equation (13)

Percentage Accurate: 49.5% → 71.5%
Time: 23.5s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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.5% 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: 71.5% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_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 t\_1\right) \cdot \left(U* - U\right)\right)}\\
t_3 := \sqrt{2 \cdot \left|n\right|}\\
\mathbf{if}\;t\_2 \leq 0:\\
\;\;\;\;t\_3 \cdot \sqrt{\left|U \cdot \left(t + \left(n \cdot U*\right) \cdot t\_1\right)\right|}\\

\mathbf{elif}\;t\_2 \leq 10^{+147}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \left(\sqrt{\left|U\right|} \cdot \sqrt{\left|\mathsf{fma}\left(n, U* \cdot t\_1, t\right)\right|}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left|2 \cdot n\right| \cdot \left|U \cdot \left(t - U* \cdot \left(n \cdot \left(-{\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right)\right|\right)}}^{0.5} \]
      3. unpow-prod-down81.7%

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

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

      \[\leadsto \color{blue}{{\left(\left|2 \cdot n\right|\right)}^{0.5} \cdot {\left(\left|U \cdot \left(t - \left(U* \cdot n\right) \cdot \left(-{\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right|\right)}^{0.5}} \]
    13. Simplified81.7%

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 9.9999999999999998e146

    1. Initial program 99.3%

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

    if 9.9999999999999998e146 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))))

    1. Initial program 26.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left|\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - U* \cdot \left(n \cdot \left(-\frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)\right)\right|} \]
      10. times-frac38.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{2 \cdot \left|n\right|} \cdot \left(\color{blue}{\sqrt{\left|U\right|}} \cdot {\left(\left|\mathsf{fma}\left(n, U* \cdot {\left(\frac{\ell}{Om}\right)}^{2}, t\right)\right|\right)}^{0.5}\right) \]
      2. unpow1/252.3%

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

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

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

Alternative 2: 65.7% accurate, 0.2× speedup?

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

\\
\begin{array}{l}
t_1 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_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 t\_1\right) \cdot \left(U* - U\right)\right)}\\
\mathbf{if}\;t\_2 \leq 0 \lor \neg \left(t\_2 \leq 2 \cdot 10^{+147}\right):\\
\;\;\;\;\sqrt{2 \cdot \left|n\right|} \cdot \sqrt{\left|U \cdot \left(t + \left(n \cdot U*\right) \cdot t\_1\right)\right|}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 2e147

    1. Initial program 99.3%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification72.3%

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

Alternative 3: 61.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 65.6% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\left|\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - U* \cdot \left(n \cdot \left(-{\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right)\right)\right|\right)}^{0.5}} \]
      2. fabs-mul26.5%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 61.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_1 - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 44.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 68.3%

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

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

    if 1.15e-103 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 44.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 68.3%

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

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

    if 1.15e-103 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -7.2 \cdot 10^{+18} \lor \neg \left(Om \leq 1.9 \cdot 10^{-14}\right):\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -7.2e18 or 1.9000000000000001e-14 < Om

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

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

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

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

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

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

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

    if -7.2e18 < Om < 1.9000000000000001e-14

    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. Simplified49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left|\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - U* \cdot \left(n \cdot \left(-\frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)\right)\right|} \]
      10. times-frac57.0%

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

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

      \[\leadsto \sqrt{\color{blue}{\left|\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - U* \cdot \left(n \cdot \left(-{\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right)\right)\right|}} \]
    11. Step-by-step derivation
      1. *-un-lft-identity57.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -7.2 \cdot 10^{+18} \lor \neg \left(Om \leq 1.9 \cdot 10^{-14}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 42.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 68.1%

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

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

    if 5.19999999999999988e-94 < l

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

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

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

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

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

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

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

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

Alternative 11: 37.0% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 68.1%

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

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

    if 4.5000000000000002e-94 < l

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

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

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

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

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

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

Alternative 12: 36.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 68.1%

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

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

    if 4.8e-94 < l

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

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

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

Alternative 13: 36.2% 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 57.5%

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

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

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

Reproduce

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