Toniolo and Linder, Equation (13)

Percentage Accurate: 49.5% → 63.5%
Time: 32.8s
Alternatives: 10
Speedup: 0.3×

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 10 alternatives:

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

Initial Program: 49.5% accurate, 1.0× speedup?

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

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

Alternative 1: 63.5% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 15.4%

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{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)}} \]
      2. fma-undefine46.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{n \cdot 2} \cdot \sqrt{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)}} \]
    8. Taylor expanded in n around 0 49.8%

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

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

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

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

    1. Initial program 75.5%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 62.8% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 15.4%

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{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)}} \]
      2. fma-undefine46.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{n \cdot 2} \cdot \sqrt{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)}} \]
    8. Taylor expanded in t around inf 43.5%

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

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

    1. Initial program 75.5%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 42.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.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. Add Preprocessing
    3. Taylor expanded in t around inf 54.0%

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

    if 4.50000000000000023e-139 < l < 2.9499999999999999e53

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9499999999999999e53 < l

    1. Initial program 30.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 41.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.1%

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

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

    if 4.5999999999999999e-94 < l < 1.65e18

    1. Initial program 63.6%

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

      \[\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.65e18 < l

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 44.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 67.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. Add Preprocessing
    3. Taylor expanded in t around inf 53.5%

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

    if 6.4999999999999997e-168 < l

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 42.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\ell \leq 1.3 \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 \frac{\left(\ell \cdot \ell\right) \cdot \left(\frac{U \cdot \left(n \cdot \left(U* - U\right)\right)}{Om} - 2 \cdot U\right)}{Om}}\\


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

    1. Initial program 68.1%

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

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

    if 5.49999999999999989e-94 < l < 1.3e138

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

      \[\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.3e138 < l

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

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

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

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

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

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

Alternative 7: 41.0% accurate, 1.8× speedup?

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

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

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


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

    1. Initial program 67.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. Add Preprocessing
    3. Taylor expanded in t around inf 54.0%

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

    if 6.2e17 < l

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

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

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

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

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

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

Alternative 8: 37.0% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 68.1%

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

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

    if 4.5000000000000002e-94 < l

    1. Initial program 40.1%

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

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

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

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

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

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

Alternative 9: 36.1% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 68.1%

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

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

    if 6.4999999999999996e-94 < l

    1. Initial program 40.1%

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

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

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

Alternative 10: 36.2% accurate, 2.1× speedup?

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024110 
(FPCore (n U t l Om U*)
  :name "Toniolo and Linder, Equation (13)"
  :precision binary64
  (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))