Toniolo and Linder, Equation (13)

Percentage Accurate: 50.4% → 63.2%
Time: 28.9s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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: 50.4% accurate, 1.0× speedup?

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

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

Alternative 1: 63.2% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 18.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. Simplified60.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. Applied egg-rr18.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\sqrt{n \cdot \left(2 \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)\right)}\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-define63.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{n \cdot \left(2 \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)\right)}\right)\right)} \]
      2. associate-*r*63.2%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{n \cdot \color{blue}{\left(\left(2 \cdot U\right) \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)}}\right)\right) \]
      3. *-commutative63.2%

        \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{n \cdot \left(\color{blue}{\left(U \cdot 2\right)} \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)}\right)\right) \]
      4. associate-*r/63.2%

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 63.2% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 18.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. Simplified60.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. Applied egg-rr63.2%

      \[\leadsto \color{blue}{{\left({\left(n \cdot \left(2 \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)\right)\right)}^{0.25}\right)}^{2}} \]

    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 68.9%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 62.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_3 - 2 \cdot t\_1\right)\right)}\\

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


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

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

    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 68.9%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 62.8% accurate, 0.5× speedup?

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

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

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


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

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\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 68.9%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 51.3% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U* < -6.00000000000000005e-28 or 7.8e11 < U*

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.00000000000000005e-28 < U* < 7.8e11

    1. Initial program 51.0%

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

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

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

Alternative 6: 51.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -2.4000000000000001e-83

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000001e-83 < n < 6.0000000000000001e-138

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

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

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

    if 6.0000000000000001e-138 < n

    1. Initial program 51.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 45.7% accurate, 1.0× speedup?

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

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

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


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

    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. Simplified60.7%

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

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt40.1%

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

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000016e-155 < l

    1. Initial program 35.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 40.4% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.60000000000000018e171 < U* < 1.1e135

    1. Initial program 55.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. Simplified60.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 n around 0 53.5%

      \[\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.1e135 < U*

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

      \[\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. Step-by-step derivation
      1. add-cube-cbrt40.2%

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

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

      \[\leadsto \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right) + \color{blue}{{\left(\sqrt[3]{n \cdot {\left(\frac{\ell}{Om}\right)}^{2}}\right)}^{3}} \cdot \left(U - U*\right)\right)\right)} \]
    6. 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)} \]
    7. 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. distribute-rgt-neg-in0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 36.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;U* \leq 1.8 \cdot 10^{+186}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999982e171 < U* < 1.8000000000000001e186

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8000000000000001e186 < U*

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

      \[\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. Step-by-step derivation
      1. add-cube-cbrt41.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 36.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;U* \leq 1.02 \cdot 10^{+186}:\\
\;\;\;\;\sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.59999999999999982e171 < U* < 1.01999999999999999e186

    1. Initial program 54.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.01999999999999999e186 < U*

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

      \[\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. Step-by-step derivation
      1. add-cube-cbrt41.7%

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

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

      \[\leadsto \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right) + \color{blue}{{\left(\sqrt[3]{n \cdot {\left(\frac{\ell}{Om}\right)}^{2}}\right)}^{3}} \cdot \left(U - U*\right)\right)\right)} \]
    6. 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)} \]
    7. 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. distribute-rgt-neg-in0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 50.4%

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

      \[\leadsto \color{blue}{\sqrt{\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.8%

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

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot t\right)}} \]
      2. add-sqr-sqrt39.2%

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

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

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

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

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

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

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

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

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

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

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

    if 1.8000000000000001e186 < U*

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

      \[\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. Step-by-step derivation
      1. add-cube-cbrt41.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 38.9% accurate, 1.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 (fabs (* U (* n t))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * fabs((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 * abs((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 * Math.abs((U * (n * t)))));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * math.fabs((U * (n * t)))))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * abs(Float64(U * Float64(n * t)))))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * abs((U * (n * t)))));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[Abs[N[(U * N[(n * t), $MachinePrecision]), $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 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{2 \cdot \color{blue}{\left|U \cdot \left(n \cdot t\right)\right|}} \]
  9. Final simplification40.7%

    \[\leadsto \sqrt{2 \cdot \left|U \cdot \left(n \cdot t\right)\right|} \]
  10. Add Preprocessing

Alternative 13: 38.1% accurate, 2.1× speedup?

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

\\
{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 48.1%

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

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

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

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

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

Alternative 14: 36.2% accurate, 2.1× speedup?

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

\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 48.1%

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

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

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

Reproduce

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