Toniolo and Linder, Equation (13)

Percentage Accurate: 50.2% → 64.8%
Time: 27.3s
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.2% 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: 64.8% accurate, 0.3× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\ \mathbf{if}\;t_3 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{-2 \cdot \frac{U \cdot {\ell}^{2}}{Om} + U \cdot t}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot U*}{{Om}^{2}} - \frac{2}{Om}\right)\right)} \cdot \left(\ell \cdot \sqrt{2}\right)\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(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_3 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) t_1)))))
   (if (<= t_3 2e-157)
     (* (sqrt (* 2.0 n)) (sqrt (+ (* -2.0 (/ (* U (pow l 2.0)) Om)) (* U t))))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (- t (* 2.0 (* l (/ l Om)))) t_1)))
       (*
        (sqrt (* U (* n (- (/ (* n U*) (pow Om 2.0)) (/ 2.0 Om)))))
        (* l (sqrt 2.0)))))))
l = abs(l);
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;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 2e-157) {
		tmp = sqrt((2.0 * n)) * sqrt(((-2.0 * ((U * pow(l, 2.0)) / Om)) + (U * t)));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
	} else {
		tmp = sqrt((U * (n * (((n * U_42_) / pow(Om, 2.0)) - (2.0 / Om))))) * (l * sqrt(2.0));
	}
	return tmp;
}
l = Math.abs(l);
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;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 2e-157) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt(((-2.0 * ((U * Math.pow(l, 2.0)) / Om)) + (U * t)));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
	} else {
		tmp = Math.sqrt((U * (n * (((n * U_42_) / Math.pow(Om, 2.0)) - (2.0 / Om))))) * (l * Math.sqrt(2.0));
	}
	return tmp;
}
l = abs(l)
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_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)))
	tmp = 0
	if t_3 <= 2e-157:
		tmp = math.sqrt((2.0 * n)) * math.sqrt(((-2.0 * ((U * math.pow(l, 2.0)) / Om)) + (U * t)))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)))
	else:
		tmp = math.sqrt((U * (n * (((n * U_42_) / math.pow(Om, 2.0)) - (2.0 / Om))))) * (l * math.sqrt(2.0))
	return tmp
l = abs(l)
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(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1)))
	tmp = 0.0
	if (t_3 <= 2e-157)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(Float64(-2.0 * Float64(Float64(U * (l ^ 2.0)) / Om)) + Float64(U * t))));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_1)));
	else
		tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * U_42_) / (Om ^ 2.0)) - Float64(2.0 / Om))))) * Float64(l * sqrt(2.0)));
	end
	return tmp
end
l = abs(l)
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_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
	tmp = 0.0;
	if (t_3 <= 2e-157)
		tmp = sqrt((2.0 * n)) * sqrt(((-2.0 * ((U * (l ^ 2.0)) / Om)) + (U * t)));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
	else
		tmp = sqrt((U * (n * (((n * U_42_) / (Om ^ 2.0)) - (2.0 / Om))))) * (l * sqrt(2.0));
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-157], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(-2.0 * N[(N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * U$42$), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_3 \leq 2 \cdot 10^{-157}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{-2 \cdot \frac{U \cdot {\ell}^{2}}{Om} + U \cdot t}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\

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


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

    1. Initial program 11.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. Simplified13.0%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999989e-157 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0

    1. Initial program 65.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. Step-by-step derivation
      1. associate-*l/68.5%

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

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

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

    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. Simplified14.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.0% accurate, 0.3× speedup?

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

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_2\right)}\\

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


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

    1. Initial program 11.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. Simplified13.0%

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

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

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

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

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

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

    if 1.99999999999999989e-157 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0

    1. Initial program 65.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. Step-by-step derivation
      1. associate-*l/68.5%

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

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

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

    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. Simplified7.2%

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

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

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

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv30.7%

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

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

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

Alternative 3: 61.0% accurate, 0.3× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\ t_2 := \left(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\ \mathbf{if}\;t_3 \leq 2 \cdot 10^{-157}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{-2 \cdot \frac{U \cdot {\ell}^{2}}{Om} + U \cdot t}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(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_3 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) t_1)))))
   (if (<= t_3 2e-157)
     (* (sqrt (* 2.0 n)) (sqrt (+ (* -2.0 (/ (* U (pow l 2.0)) Om)) (* U t))))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (- t (* 2.0 (* l (/ l Om)))) t_1)))
       (pow (* 2.0 (* (* n U) (+ t (* -2.0 (/ (pow l 2.0) Om))))) 0.5)))))
l = abs(l);
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;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 2e-157) {
		tmp = sqrt((2.0 * n)) * sqrt(((-2.0 * ((U * pow(l, 2.0)) / Om)) + (U * t)));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
	} else {
		tmp = pow((2.0 * ((n * U) * (t + (-2.0 * (pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
l = Math.abs(l);
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;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 2e-157) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt(((-2.0 * ((U * Math.pow(l, 2.0)) / Om)) + (U * t)));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
	} else {
		tmp = Math.pow((2.0 * ((n * U) * (t + (-2.0 * (Math.pow(l, 2.0) / Om))))), 0.5);
	}
	return tmp;
}
l = abs(l)
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_3 = math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)))
	tmp = 0
	if t_3 <= 2e-157:
		tmp = math.sqrt((2.0 * n)) * math.sqrt(((-2.0 * ((U * math.pow(l, 2.0)) / Om)) + (U * t)))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)))
	else:
		tmp = math.pow((2.0 * ((n * U) * (t + (-2.0 * (math.pow(l, 2.0) / Om))))), 0.5)
	return tmp
l = abs(l)
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(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_1)))
	tmp = 0.0
	if (t_3 <= 2e-157)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(Float64(-2.0 * Float64(Float64(U * (l ^ 2.0)) / Om)) + Float64(U * t))));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) + t_1)));
	else
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(-2.0 * Float64((l ^ 2.0) / Om))))) ^ 0.5;
	end
	return tmp
end
l = abs(l)
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_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + t_1)));
	tmp = 0.0;
	if (t_3 <= 2e-157)
		tmp = sqrt((2.0 * n)) * sqrt(((-2.0 * ((U * (l ^ 2.0)) / Om)) + (U * t)));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) + t_1)));
	else
		tmp = (2.0 * ((n * U) * (t + (-2.0 * ((l ^ 2.0) / Om))))) ^ 0.5;
	end
	tmp_2 = tmp;
end
NOTE: l should be positive before calling this function
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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-157], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(-2.0 * N[(N[(U * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(-2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_3 \leq 2 \cdot 10^{-157}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{-2 \cdot \frac{U \cdot {\ell}^{2}}{Om} + U \cdot t}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + t_1\right)}\\

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


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

    1. Initial program 11.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. Simplified13.0%

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

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

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

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

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

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

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

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

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

    if 1.99999999999999989e-157 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < +inf.0

    1. Initial program 65.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. Step-by-step derivation
      1. associate-*l/68.5%

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

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

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

    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. Simplified7.2%

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

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

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

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv30.7%

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

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

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

Alternative 4: 61.6% accurate, 0.5× speedup?

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

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(t_1 + t_2\right)}\\

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


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

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

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

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

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

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

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

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

    1. Initial program 65.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. Step-by-step derivation
      1. associate-*l/68.5%

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

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

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

    1. Initial program 0.0%

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

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

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

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

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv31.6%

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

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

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

    \[\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 \left(\ell \cdot \frac{\ell}{Om}\right)\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(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{0.5}\\ \end{array} \]

Alternative 5: 55.9% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -3.84999999999999979e-112 or 2.9499999999999999e-95 < n

    1. Initial program 53.7%

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

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

    if -3.84999999999999979e-112 < n < 2.9499999999999999e-95

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -3.85 \cdot 10^{-112} \lor \neg \left(n \leq 2.95 \cdot 10^{-95}\right):\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) + n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \end{array} \]

Alternative 6: 53.5% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.05e10 or 1.75999999999999989e-81 < n

    1. Initial program 54.8%

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

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

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

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

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right)}^{0.5} \]
      3. cancel-sign-sub-inv53.0%

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

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

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

    if -1.05e10 < n < 1.75999999999999989e-81

    1. Initial program 34.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. Simplified39.5%

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

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

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

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

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

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

Alternative 7: 46.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 54.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. Simplified51.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999952e257 < U* < -9.20000000000000007e163

    1. Initial program 28.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. Simplified24.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.20000000000000007e163 < U*

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U* \leq -8.5 \cdot 10^{+257}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\ \mathbf{elif}\;U* \leq -9.2 \cdot 10^{+163}:\\ \;\;\;\;\frac{1}{\frac{\frac{Om}{\ell}}{\sqrt{U \cdot U*} \cdot \left(n \cdot \sqrt{2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \end{array} \]

Alternative 8: 48.3% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -1.6499999999999999e-197 or 2.5500000000000002e-152 < Om

    1. Initial program 46.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. Simplified45.8%

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

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

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

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

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

    if -1.6499999999999999e-197 < Om < 2.5500000000000002e-152

    1. Initial program 34.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. Simplified34.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -1.65 \cdot 10^{-197} \lor \neg \left(Om \leq 2.55 \cdot 10^{-152}\right):\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{U \cdot U*} \cdot \frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om}\\ \end{array} \]

Alternative 9: 46.7% accurate, 1.1× speedup?

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

\mathbf{elif}\;U* \leq -9.2 \cdot 10^{+163}:\\
\;\;\;\;\sqrt{U \cdot U*} \cdot \frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}\\

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


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

    1. Initial program 54.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. Simplified51.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e258 < U* < -9.20000000000000007e163

    1. Initial program 28.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. Simplified24.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{U \cdot U*} \cdot \frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}} \]

    if -9.20000000000000007e163 < U*

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U* \leq -2.3 \cdot 10^{+258}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\ \mathbf{elif}\;U* \leq -9.2 \cdot 10^{+163}:\\ \;\;\;\;\sqrt{U \cdot U*} \cdot \frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \end{array} \]

Alternative 10: 46.7% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 54.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. Simplified51.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000005e258 < U* < -9.20000000000000007e163

    1. Initial program 28.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. Simplified24.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.20000000000000007e163 < U*

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U* \leq -1.6 \cdot 10^{+258}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\ \mathbf{elif}\;U* \leq -9.2 \cdot 10^{+163}:\\ \;\;\;\;\frac{\ell \cdot \left(\sqrt{U \cdot U*} \cdot \left(n \cdot \sqrt{2}\right)\right)}{Om}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \end{array} \]

Alternative 11: 48.3% accurate, 2.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (sqrt (* 2.0 (* U (* n (- t (* 2.0 (* l (/ l Om)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
}
NOTE: l should be positive before calling this function
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 - (2.0d0 * (l * (l / om))))))))
end function
l = Math.abs(l);
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 - (2.0 * (l * (l / Om))))))));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * Float64(l * Float64(l / Om))))))))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (U * (n * (t - (2.0 * (l * (l / Om))))))));
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 44.3%

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

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

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

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

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

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

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

Alternative 12: 38.4% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ {\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*) :precision binary64 (pow (* (* n t) (* 2.0 U)) 0.5))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return pow(((n * t) * (2.0 * U)), 0.5);
}
NOTE: l should be positive before calling this function
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 = ((n * t) * (2.0d0 * u)) ** 0.5d0
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.pow(((n * t) * (2.0 * U)), 0.5);
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.pow(((n * t) * (2.0 * U)), 0.5)
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return Float64(Float64(n * t) * Float64(2.0 * U)) ^ 0.5
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = ((n * t) * (2.0 * U)) ^ 0.5;
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Power[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
{\left(\left(n \cdot t\right) \cdot \left(2 \cdot U\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 44.3%

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

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

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

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

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

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

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

Alternative 13: 36.4% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* 2.0 (* U (* n t)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (U * (n * t))));
}
NOTE: l should be positive before calling this function
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
l = Math.abs(l);
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))));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (U * (n * t))))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(n * t))))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (U * (n * t))));
end
NOTE: l should be positive before calling this function
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}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 44.3%

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

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

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

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

Alternative 14: 36.4% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{\left(n \cdot t\right) \cdot \left(2 \cdot U\right)} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* n t) (* 2.0 U))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt(((n * t) * (2.0 * U)));
}
NOTE: l should be positive before calling this function
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(((n * t) * (2.0d0 * u)))
end function
l = Math.abs(l);
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt(((n * t) * (2.0 * U)));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt(((n * t) * (2.0 * U)))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(n * t) * Float64(2.0 * U)))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt(((n * t) * (2.0 * U)));
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(n * t), $MachinePrecision] * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{\left(n \cdot t\right) \cdot \left(2 \cdot U\right)}
\end{array}
Derivation
  1. Initial program 44.3%

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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