Toniolo and Linder, Equation (13)

Percentage Accurate: 49.6% → 62.0%
Time: 24.0s
Alternatives: 15
Speedup: 1.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 49.6% 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: 62.0% accurate, 0.3× speedup?

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

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

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

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


\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 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. Simplified48.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. Step-by-step derivation
      1. sub-neg48.5%

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

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

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

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

        \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t + U \cdot \left(-\color{blue}{\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)\right)} \]
      6. *-commutative54.6%

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \color{blue}{\left(U \cdot \left(t - \mathsf{fma}\left(U - U*, n \cdot {\left(\frac{\ell}{Om}\right)}^{2}, \frac{2 \cdot {\ell}^{2}}{Om}\right)\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*))))) < +inf.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.8% accurate, 0.3× speedup?

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

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

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


\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 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. Simplified48.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 Om around -inf 54.4%

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t - \color{blue}{\frac{U \cdot \left(-1 \cdot \frac{U* \cdot \left({\ell}^{2} \cdot n\right)}{Om} + 2 \cdot {\ell}^{2}\right)}{Om}}\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*))))) < +inf.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 62.6% accurate, 0.3× speedup?

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

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

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


\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 +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 6.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. Simplified23.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 Om around -inf 29.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t - \frac{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \left(2 \cdot U + \frac{U \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}\right)}{Om}\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*))))) < +inf.0

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

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

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

Alternative 4: 62.5% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t - \frac{\left(\ell \cdot \ell\right) \cdot \left(2 \cdot U + \frac{U \cdot \left(n \cdot \left(U - U*\right)\right)}{Om}\right)}{Om}\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 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. Simplified48.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 Om around -inf 54.4%

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t - \color{blue}{\frac{U \cdot \left(-1 \cdot \frac{U* \cdot \left({\ell}^{2} \cdot n\right)}{Om} + 2 \cdot {\ell}^{2}\right)}{Om}}\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*))))) < +inf.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 61.4% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0 - \sqrt{U \cdot U*} \cdot \left(0 - {\left({\left(\ell \cdot \frac{n \cdot \sqrt{2}}{Om}\right)}^{3}\right)}^{0.3333333333333333}\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 12.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t - \frac{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \left(2 \cdot U + \frac{U \cdot \left(n \cdot \left(U - U*\right)\right)}{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 73.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. Simplified78.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 52.6% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -3.6e62

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

      \[\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
    4. Taylor expanded in Om around inf 59.5%

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

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

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

    if -3.6e62 < U < 3.6999999999999997e144

    1. Initial program 50.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6999999999999997e144 < U

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot U}} \cdot \sqrt{n \cdot t} \]
    8. Simplified69.7%

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

Alternative 7: 51.5% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -1.35000000000000007e152

    1. Initial program 56.6%

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

    if -1.35000000000000007e152 < U < 3.80000000000000026e144

    1. Initial program 52.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. Simplified56.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 Om around -inf 53.7%

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

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000026e144 < U

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot U}} \cdot \sqrt{n \cdot t} \]
    8. Simplified69.7%

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

Alternative 8: 52.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -5.8 \cdot 10^{+63} \lor \neg \left(U \leq 3.8 \cdot 10^{+121}\right):\\
\;\;\;\;\sqrt{\left|t \cdot \left(\left(2 \cdot n\right) \cdot U\right)\right|}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -5.7999999999999999e63 or 3.8e121 < U

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.7999999999999999e63 < U < 3.8e121

    1. Initial program 50.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 52.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -5.4 \cdot 10^{+62}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(\left(2 \cdot n\right) \cdot U\right)\right|}\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -5.4e62

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left|\color{blue}{t \cdot \left(\left(2 \cdot n\right) \cdot U\right)}\right|} \]
      5. *-commutative55.1%

        \[\leadsto \sqrt{\left|t \cdot \color{blue}{\left(U \cdot \left(2 \cdot n\right)\right)}\right|} \]
      6. *-commutative55.1%

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

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

    if -5.4e62 < U < 3.6999999999999997e144

    1. Initial program 50.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6999999999999997e144 < U

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot U}} \cdot \sqrt{n \cdot t} \]
    8. Simplified69.7%

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

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

Alternative 10: 51.4% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -6.6 \cdot 10^{+150} \lor \neg \left(U \leq 4.8 \cdot 10^{+121}\right):\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -6.59999999999999962e150 or 4.8e121 < U

    1. Initial program 64.5%

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

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

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

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

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

    if -6.59999999999999962e150 < U < 4.8e121

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 36.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U* \leq -6.2 \cdot 10^{+125} \lor \neg \left(U* \leq 9.2 \cdot 10^{-42}\right):\\
\;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U* < -6.2e125 or 9.20000000000000015e-42 < U*

    1. Initial program 51.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. Simplified44.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 t around inf 35.0%

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

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

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

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

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

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

    if -6.2e125 < U* < 9.20000000000000015e-42

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U* \leq -6.2 \cdot 10^{+125} \lor \neg \left(U* \leq 9.2 \cdot 10^{-42}\right):\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 36.9% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;U* \leq 470:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\

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


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

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

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

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

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

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

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

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

    if -2.8e115 < U* < 470

    1. Initial program 56.6%

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

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

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

    if 470 < U*

    1. Initial program 57.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U* \leq -2.8 \cdot 10^{+115}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}\\ \mathbf{elif}\;U* \leq 470:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 35.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U* \leq 1000:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U* < 1e3

    1. Initial program 53.4%

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

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

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

    if 1e3 < U*

    1. Initial program 57.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U* \leq 1000:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 35.7% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -3.34999999999999996e128

    1. Initial program 53.2%

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

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

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

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

    if -3.34999999999999996e128 < n

    1. Initial program 54.8%

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

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

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

Alternative 15: 35.1% 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 54.6%

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

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

Reproduce

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