Toniolo and Linder, Equation (13)

Percentage Accurate: 50.9% → 71.5%
Time: 26.1s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 50.9% accurate, 1.0× speedup?

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

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

Alternative 1: 71.5% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := U \cdot \left(2 \cdot n\right)\\ t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_3 := \left(U* - U\right) \cdot \left(n \cdot t_2\right)\\ t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\ t_5 := \ell \cdot \frac{\ell}{Om}\\ t_6 := \sqrt{\left|2 \cdot \left(n \cdot U\right)\right|} \cdot \sqrt{\left|t - \mathsf{fma}\left(2, t_5, t_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right|}\\ \mathbf{if}\;t_4 \leq 0:\\ \;\;\;\;t_6\\ \mathbf{elif}\;t_4 \leq 10^{+305}:\\ \;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot t_5\right) + t_3\right)}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;t_6\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \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 (* U (* 2.0 n)))
        (t_2 (pow (/ l Om) 2.0))
        (t_3 (* (- U* U) (* n t_2)))
        (t_4 (* t_1 (+ (- t (* 2.0 (/ (* l l) Om))) t_3)))
        (t_5 (* l (/ l Om)))
        (t_6
         (*
          (sqrt (fabs (* 2.0 (* n U))))
          (sqrt (fabs (- t (fma 2.0 t_5 (* t_2 (* n (- U U*))))))))))
   (if (<= t_4 0.0)
     t_6
     (if (<= t_4 1e+305)
       (sqrt (* t_1 (+ (- t (* 2.0 t_5)) t_3)))
       (if (<= t_4 INFINITY)
         t_6
         (*
          (sqrt
           (* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.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 = U * (2.0 * n);
	double t_2 = pow((l / Om), 2.0);
	double t_3 = (U_42_ - U) * (n * t_2);
	double t_4 = t_1 * ((t - (2.0 * ((l * l) / Om))) + t_3);
	double t_5 = l * (l / Om);
	double t_6 = sqrt(fabs((2.0 * (n * U)))) * sqrt(fabs((t - fma(2.0, t_5, (t_2 * (n * (U - U_42_)))))));
	double tmp;
	if (t_4 <= 0.0) {
		tmp = t_6;
	} else if (t_4 <= 1e+305) {
		tmp = sqrt((t_1 * ((t - (2.0 * t_5)) + t_3)));
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = t_6;
	} else {
		tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
	}
	return tmp;
}
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(U * Float64(2.0 * n))
	t_2 = Float64(l / Om) ^ 2.0
	t_3 = Float64(Float64(U_42_ - U) * Float64(n * t_2))
	t_4 = Float64(t_1 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3))
	t_5 = Float64(l * Float64(l / Om))
	t_6 = Float64(sqrt(abs(Float64(2.0 * Float64(n * U)))) * sqrt(abs(Float64(t - fma(2.0, t_5, Float64(t_2 * Float64(n * Float64(U - U_42_))))))))
	tmp = 0.0
	if (t_4 <= 0.0)
		tmp = t_6;
	elseif (t_4 <= 1e+305)
		tmp = sqrt(Float64(t_1 * Float64(Float64(t - Float64(2.0 * t_5)) + t_3)));
	elseif (t_4 <= Inf)
		tmp = t_6;
	else
		tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * Float64(l * sqrt(2.0)));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(2.0 * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(U$42$ - U), $MachinePrecision] * N[(n * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[N[Abs[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[N[(t - N[(2.0 * t$95$5 + N[(t$95$2 * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], t$95$6, If[LessEqual[t$95$4, 1e+305], N[Sqrt[N[(t$95$1 * N[(N[(t - N[(2.0 * t$95$5), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$6, N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := U \cdot \left(2 \cdot n\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(U* - U\right) \cdot \left(n \cdot t_2\right)\\
t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_3\right)\\
t_5 := \ell \cdot \frac{\ell}{Om}\\
t_6 := \sqrt{\left|2 \cdot \left(n \cdot U\right)\right|} \cdot \sqrt{\left|t - \mathsf{fma}\left(2, t_5, t_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right|}\\
\mathbf{if}\;t_4 \leq 0:\\
\;\;\;\;t_6\\

\mathbf{elif}\;t_4 \leq 10^{+305}:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot t_5\right) + t_3\right)}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t_6\\

\mathbf{else}:\\
\;\;\;\;\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)\\


\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 or 9.9999999999999994e304 < (*.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 26.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. Simplified42.1%

      \[\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)}} \]
    3. Applied egg-rr23.4%

      \[\leadsto \sqrt{\color{blue}{{\left({\left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right)}^{2}\right)}^{0.5}}} \]
    4. Step-by-step derivation
      1. unpow1/223.4%

        \[\leadsto \sqrt{\color{blue}{\sqrt{{\left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right)}^{2}}}} \]
      2. unpow223.4%

        \[\leadsto \sqrt{\sqrt{\color{blue}{\left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right) \cdot \left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right)}}} \]
      3. rem-sqrt-square23.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.4%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Step-by-step derivation
      1. associate-*l/98.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-rr98.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. Simplified8.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 inf 22.8%

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.8%

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

Alternative 2: 67.4% accurate, 0.2× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 1.06 \cdot 10^{+86}:\\ \;\;\;\;{\left(\sqrt[3]{\sqrt{\left|t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(\left(U - U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right|}}\right)}^{3} \cdot \sqrt{\left|2 \cdot \left(n \cdot U\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\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)\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= l 1.06e+86)
   (*
    (pow
     (cbrt
      (sqrt
       (fabs
        (-
         t
         (fma 2.0 (/ (pow l 2.0) Om) (* n (* (- U U*) (pow (/ l Om) 2.0))))))))
     3.0)
    (sqrt (fabs (* 2.0 (* n U)))))
   (*
    (sqrt (* U (* n (+ (/ (* n (- U* U)) (pow Om 2.0)) (* 2.0 (/ -1.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 tmp;
	if (l <= 1.06e+86) {
		tmp = pow(cbrt(sqrt(fabs((t - fma(2.0, (pow(l, 2.0) / Om), (n * ((U - U_42_) * pow((l / Om), 2.0)))))))), 3.0) * sqrt(fabs((2.0 * (n * U))));
	} else {
		tmp = sqrt((U * (n * (((n * (U_42_ - U)) / pow(Om, 2.0)) + (2.0 * (-1.0 / Om)))))) * (l * sqrt(2.0));
	}
	return tmp;
}
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 1.06e+86)
		tmp = Float64((cbrt(sqrt(abs(Float64(t - fma(2.0, Float64((l ^ 2.0) / Om), Float64(n * Float64(Float64(U - U_42_) * (Float64(l / Om) ^ 2.0)))))))) ^ 3.0) * sqrt(abs(Float64(2.0 * Float64(n * U)))));
	else
		tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)) + Float64(2.0 * Float64(-1.0 / Om)))))) * Float64(l * sqrt(2.0)));
	end
	return tmp
end
NOTE: l should be positive before calling this function
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.06e+86], N[(N[Power[N[Power[N[Sqrt[N[Abs[N[(t - N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(n * N[(N[(U - U$42$), $MachinePrecision] * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[Sqrt[N[Abs[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.06 \cdot 10^{+86}:\\
\;\;\;\;{\left(\sqrt[3]{\sqrt{\left|t - \mathsf{fma}\left(2, \frac{{\ell}^{2}}{Om}, n \cdot \left(\left(U - U*\right) \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)\right|}}\right)}^{3} \cdot \sqrt{\left|2 \cdot \left(n \cdot U\right)\right|}\\

\mathbf{else}:\\
\;\;\;\;\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)\\


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

    1. Initial program 54.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. Simplified57.3%

      \[\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)}} \]
    3. Applied egg-rr34.2%

      \[\leadsto \sqrt{\color{blue}{{\left({\left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right)}^{2}\right)}^{0.5}}} \]
    4. Step-by-step derivation
      1. unpow1/234.2%

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right) \cdot \left(\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) \cdot \left(U \cdot \left(2 \cdot n\right)\right)\right)}}} \]
      3. rem-sqrt-square49.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.06e86 < l

    1. Initial program 29.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. Simplified44.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 inf 61.9%

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.4%

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

Alternative 3: 66.3% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\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)\\


\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 12.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. Simplified38.1%

      \[\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 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 68.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. Step-by-step derivation
      1. associate-*l/74.6%

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

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

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.5%

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

Alternative 4: 66.3% accurate, 0.4× speedup?

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

\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot t_1\right) + t_4\right)}\\

\mathbf{else}:\\
\;\;\;\;\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)\\


\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 12.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. Simplified38.1%

      \[\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)}} \]

    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 68.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. Step-by-step derivation
      1. associate-*l/74.6%

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

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

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.5%

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

Alternative 5: 65.8% accurate, 0.4× speedup?

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

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

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


\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 12.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. Simplified38.1%

      \[\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 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 68.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. Step-by-step derivation
      1. associate-*l/74.6%

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

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

      \[\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*22.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/22.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-eval22.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. Simplified22.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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.5%

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

Alternative 6: 61.4% accurate, 0.5× speedup?

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

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

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


\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 12.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. Simplified38.1%

      \[\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 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 68.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. Step-by-step derivation
      1. associate-*l/74.6%

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

      \[\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. Simplified8.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 n around inf 25.4%

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

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

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

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

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

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

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

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

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

Alternative 7: 55.4% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;U \leq -7.5 \cdot 10^{+94}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\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)}\\ \end{array} \end{array} \]
NOTE: l should be positive before calling this function
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= U -7.5e+94)
   (pow (* 2.0 (* (* n U) (+ t (* (/ (pow l 2.0) Om) -2.0)))) 0.5)
   (sqrt
    (*
     (* 2.0 n)
     (*
      U
      (+
       (+ t (* -2.0 (/ l (/ Om l))))
       (* n (* (pow (/ l Om) 2.0) (- U* U)))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -7.5e+94) {
		tmp = pow((2.0 * ((n * U) * (t + ((pow(l, 2.0) / Om) * -2.0)))), 0.5);
	} else {
		tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (pow((l / Om), 2.0) * (U_42_ - U)))))));
	}
	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 <= (-7.5d+94)) then
        tmp = (2.0d0 * ((n * u) * (t + (((l ** 2.0d0) / om) * (-2.0d0))))) ** 0.5d0
    else
        tmp = sqrt(((2.0d0 * n) * (u * ((t + ((-2.0d0) * (l / (om / l)))) + (n * (((l / om) ** 2.0d0) * (u_42 - u)))))))
    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 <= -7.5e+94) {
		tmp = Math.pow((2.0 * ((n * U) * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))), 0.5);
	} else {
		tmp = Math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (Math.pow((l / Om), 2.0) * (U_42_ - U)))))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= -7.5e+94:
		tmp = math.pow((2.0 * ((n * U) * (t + ((math.pow(l, 2.0) / Om) * -2.0)))), 0.5)
	else:
		tmp = math.sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (math.pow((l / Om), 2.0) * (U_42_ - U)))))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= -7.5e+94)
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0)))) ^ 0.5;
	else
		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)))))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= -7.5e+94)
		tmp = (2.0 * ((n * U) * (t + (((l ^ 2.0) / Om) * -2.0)))) ^ 0.5;
	else
		tmp = sqrt(((2.0 * n) * (U * ((t + (-2.0 * (l / (Om / l)))) + (n * (((l / Om) ^ 2.0) * (U_42_ - U)))))));
	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, -7.5e+94], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -7.5 \cdot 10^{+94}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\

\mathbf{else}:\\
\;\;\;\;\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)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -7.49999999999999978e94

    1. Initial program 56.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. Simplified47.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 53.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. pow1/262.2%

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

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

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

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

      \[\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 -7.49999999999999978e94 < U

    1. Initial program 49.2%

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

      \[\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)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.9%

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

Alternative 8: 51.4% accurate, 1.0× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} t_1 := \ell \cdot \frac{\ell}{Om}\\ \mathbf{if}\;n \leq -450:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\ \mathbf{elif}\;n \leq 7 \cdot 10^{-287}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot t_1\right)\right)\right)}\\ \mathbf{elif}\;n \leq 3.3 \cdot 10^{-175}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{t \cdot U}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \sqrt{\left(n \cdot U\right) \cdot \left(t + t_1 \cdot -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 (* l (/ l Om))))
   (if (<= n -450.0)
     (pow (* 2.0 (* (* n U) (+ t (* (/ (pow l 2.0) Om) -2.0)))) 0.5)
     (if (<= n 7e-287)
       (sqrt (* 2.0 (* U (* n (- t (* 2.0 t_1))))))
       (if (<= n 3.3e-175)
         (* (sqrt (* 2.0 n)) (sqrt (* t U)))
         (* (sqrt 2.0) (sqrt (* (* n U) (+ t (* t_1 -2.0))))))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = l * (l / Om);
	double tmp;
	if (n <= -450.0) {
		tmp = pow((2.0 * ((n * U) * (t + ((pow(l, 2.0) / Om) * -2.0)))), 0.5);
	} else if (n <= 7e-287) {
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * t_1))))));
	} else if (n <= 3.3e-175) {
		tmp = sqrt((2.0 * n)) * sqrt((t * U));
	} else {
		tmp = sqrt(2.0) * sqrt(((n * U) * (t + (t_1 * -2.0))));
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = l * (l / om)
    if (n <= (-450.0d0)) then
        tmp = (2.0d0 * ((n * u) * (t + (((l ** 2.0d0) / om) * (-2.0d0))))) ** 0.5d0
    else if (n <= 7d-287) then
        tmp = sqrt((2.0d0 * (u * (n * (t - (2.0d0 * t_1))))))
    else if (n <= 3.3d-175) then
        tmp = sqrt((2.0d0 * n)) * sqrt((t * u))
    else
        tmp = sqrt(2.0d0) * sqrt(((n * u) * (t + (t_1 * (-2.0d0)))))
    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 t_1 = l * (l / Om);
	double tmp;
	if (n <= -450.0) {
		tmp = Math.pow((2.0 * ((n * U) * (t + ((Math.pow(l, 2.0) / Om) * -2.0)))), 0.5);
	} else if (n <= 7e-287) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - (2.0 * t_1))))));
	} else if (n <= 3.3e-175) {
		tmp = Math.sqrt((2.0 * n)) * Math.sqrt((t * U));
	} else {
		tmp = Math.sqrt(2.0) * Math.sqrt(((n * U) * (t + (t_1 * -2.0))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	t_1 = l * (l / Om)
	tmp = 0
	if n <= -450.0:
		tmp = math.pow((2.0 * ((n * U) * (t + ((math.pow(l, 2.0) / Om) * -2.0)))), 0.5)
	elif n <= 7e-287:
		tmp = math.sqrt((2.0 * (U * (n * (t - (2.0 * t_1))))))
	elif n <= 3.3e-175:
		tmp = math.sqrt((2.0 * n)) * math.sqrt((t * U))
	else:
		tmp = math.sqrt(2.0) * math.sqrt(((n * U) * (t + (t_1 * -2.0))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l * Float64(l / Om))
	tmp = 0.0
	if (n <= -450.0)
		tmp = Float64(2.0 * Float64(Float64(n * U) * Float64(t + Float64(Float64((l ^ 2.0) / Om) * -2.0)))) ^ 0.5;
	elseif (n <= 7e-287)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(2.0 * t_1))))));
	elseif (n <= 3.3e-175)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(t * U)));
	else
		tmp = Float64(sqrt(2.0) * sqrt(Float64(Float64(n * U) * Float64(t + Float64(t_1 * -2.0)))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = l * (l / Om);
	tmp = 0.0;
	if (n <= -450.0)
		tmp = (2.0 * ((n * U) * (t + (((l ^ 2.0) / Om) * -2.0)))) ^ 0.5;
	elseif (n <= 7e-287)
		tmp = sqrt((2.0 * (U * (n * (t - (2.0 * t_1))))));
	elseif (n <= 3.3e-175)
		tmp = sqrt((2.0 * n)) * sqrt((t * U));
	else
		tmp = sqrt(2.0) * sqrt(((n * U) * (t + (t_1 * -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[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -450.0], N[Power[N[(2.0 * N[(N[(n * U), $MachinePrecision] * N[(t + N[(N[(N[Power[l, 2.0], $MachinePrecision] / Om), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[n, 7e-287], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 3.3e-175], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(t + N[(t$95$1 * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \ell \cdot \frac{\ell}{Om}\\
\mathbf{if}\;n \leq -450:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\

\mathbf{elif}\;n \leq 7 \cdot 10^{-287}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot t_1\right)\right)\right)}\\

\mathbf{elif}\;n \leq 3.3 \cdot 10^{-175}:\\
\;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{t \cdot U}\\

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


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

    1. Initial program 59.5%

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

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

      \[\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/258.1%

        \[\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*59.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-inv59.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-eval59.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-rr59.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}} \]

    if -450 < n < 7e-287

    1. Initial program 41.4%

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

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

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

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

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

      \[\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 7e-287 < n < 3.29999999999999999e-175

    1. Initial program 32.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. Simplified44.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 l around 0 40.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}} \]
    6. Step-by-step derivation
      1. *-commutative62.6%

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

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

    if 3.29999999999999999e-175 < n

    1. Initial program 57.4%

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

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

      \[\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/251.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 48.9% 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 50.2%

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

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

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

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

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

    \[\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 10: 37.1% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;U \leq -6.5 \cdot 10^{-182}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\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 -6.5e-182)
   (pow (* 2.0 (* U (* t n))) 0.5)
   (sqrt (* 2.0 (* t (* n U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -6.5e-182) {
		tmp = pow((2.0 * (U * (t * n))), 0.5);
	} else {
		tmp = sqrt((2.0 * (t * (n * U))));
	}
	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 <= (-6.5d-182)) then
        tmp = (2.0d0 * (u * (t * n))) ** 0.5d0
    else
        tmp = sqrt((2.0d0 * (t * (n * u))))
    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 <= -6.5e-182) {
		tmp = Math.pow((2.0 * (U * (t * n))), 0.5);
	} else {
		tmp = Math.sqrt((2.0 * (t * (n * U))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= -6.5e-182:
		tmp = math.pow((2.0 * (U * (t * n))), 0.5)
	else:
		tmp = math.sqrt((2.0 * (t * (n * U))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= -6.5e-182)
		tmp = Float64(2.0 * Float64(U * Float64(t * n))) ^ 0.5;
	else
		tmp = sqrt(Float64(2.0 * Float64(t * Float64(n * U))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= -6.5e-182)
		tmp = (2.0 * (U * (t * n))) ^ 0.5;
	else
		tmp = sqrt((2.0 * (t * (n * U))));
	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, -6.5e-182], N[Power[N[(2.0 * N[(U * N[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -6.5 \cdot 10^{-182}:\\
\;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -6.49999999999999997e-182

    1. Initial program 58.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. Simplified59.3%

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\log \left(2 \cdot \left(\left(U \cdot n\right) \cdot t\right)\right) \cdot 0.5}} \]
    6. Taylor expanded in t around 0 29.4%

      \[\leadsto e^{\color{blue}{\left(\log t + \log \left(2 \cdot \left(U \cdot n\right)\right)\right)} \cdot 0.5} \]
    7. Step-by-step derivation
      1. *-commutative29.4%

        \[\leadsto e^{\left(\log t + \log \left(2 \cdot \color{blue}{\left(n \cdot U\right)}\right)\right) \cdot 0.5} \]
      2. +-commutative29.4%

        \[\leadsto e^{\color{blue}{\left(\log \left(2 \cdot \left(n \cdot U\right)\right) + \log t\right)} \cdot 0.5} \]
      3. log-prod42.5%

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

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

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

        \[\leadsto e^{\log \left(2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}\right) \cdot 0.5} \]
    8. Simplified45.7%

      \[\leadsto e^{\color{blue}{\log \left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)} \cdot 0.5} \]
    9. Step-by-step derivation
      1. exp-to-pow49.5%

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

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

    if -6.49999999999999997e-182 < U

    1. Initial program 44.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. Simplified52.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 l around 0 27.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -6.5 \cdot 10^{-182}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(t \cdot \left(n \cdot U\right)\right)}\\ \end{array} \]

Alternative 11: 37.8% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;U \leq -3 \cdot 10^{-179}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\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
 (if (<= U -3e-179)
   (pow (* 2.0 (* U (* t n))) 0.5)
   (pow (* 2.0 (* t (* n U))) 0.5)))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -3e-179) {
		tmp = pow((2.0 * (U * (t * n))), 0.5);
	} else {
		tmp = pow((2.0 * (t * (n * U))), 0.5);
	}
	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 <= (-3d-179)) then
        tmp = (2.0d0 * (u * (t * n))) ** 0.5d0
    else
        tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
    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 <= -3e-179) {
		tmp = Math.pow((2.0 * (U * (t * n))), 0.5);
	} else {
		tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= -3e-179:
		tmp = math.pow((2.0 * (U * (t * n))), 0.5)
	else:
		tmp = math.pow((2.0 * (t * (n * U))), 0.5)
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= -3e-179)
		tmp = Float64(2.0 * Float64(U * Float64(t * n))) ^ 0.5;
	else
		tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5;
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= -3e-179)
		tmp = (2.0 * (U * (t * n))) ^ 0.5;
	else
		tmp = (2.0 * (t * (n * U))) ^ 0.5;
	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, -3e-179], N[Power[N[(2.0 * N[(U * N[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -3 \cdot 10^{-179}:\\
\;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -3.00000000000000006e-179

    1. Initial program 58.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. Simplified59.3%

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

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

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

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

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

      \[\leadsto \color{blue}{e^{\log \left(2 \cdot \left(\left(U \cdot n\right) \cdot t\right)\right) \cdot 0.5}} \]
    6. Taylor expanded in t around 0 29.4%

      \[\leadsto e^{\color{blue}{\left(\log t + \log \left(2 \cdot \left(U \cdot n\right)\right)\right)} \cdot 0.5} \]
    7. Step-by-step derivation
      1. *-commutative29.4%

        \[\leadsto e^{\left(\log t + \log \left(2 \cdot \color{blue}{\left(n \cdot U\right)}\right)\right) \cdot 0.5} \]
      2. +-commutative29.4%

        \[\leadsto e^{\color{blue}{\left(\log \left(2 \cdot \left(n \cdot U\right)\right) + \log t\right)} \cdot 0.5} \]
      3. log-prod42.5%

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

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

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

        \[\leadsto e^{\log \left(2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}\right) \cdot 0.5} \]
    8. Simplified45.7%

      \[\leadsto e^{\color{blue}{\log \left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)} \cdot 0.5} \]
    9. Step-by-step derivation
      1. exp-to-pow49.5%

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

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

    if -3.00000000000000006e-179 < U

    1. Initial program 44.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. Simplified52.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 l around 0 27.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -3 \cdot 10^{-179}:\\ \;\;\;\;{\left(2 \cdot \left(U \cdot \left(t \cdot n\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \end{array} \]

Alternative 12: 36.9% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \begin{array}{l} \mathbf{if}\;U \leq -2.8 \cdot 10^{-58}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(t \cdot n\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t \cdot U\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.8e-58)
   (sqrt (* 2.0 (* U (* t n))))
   (sqrt (* 2.0 (* n (* t U))))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -2.8e-58) {
		tmp = sqrt((2.0 * (U * (t * n))));
	} else {
		tmp = sqrt((2.0 * (n * (t * U))));
	}
	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 <= (-2.8d-58)) then
        tmp = sqrt((2.0d0 * (u * (t * n))))
    else
        tmp = sqrt((2.0d0 * (n * (t * u))))
    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 <= -2.8e-58) {
		tmp = Math.sqrt((2.0 * (U * (t * n))));
	} else {
		tmp = Math.sqrt((2.0 * (n * (t * U))));
	}
	return tmp;
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= -2.8e-58:
		tmp = math.sqrt((2.0 * (U * (t * n))))
	else:
		tmp = math.sqrt((2.0 * (n * (t * U))))
	return tmp
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= -2.8e-58)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(t * n))));
	else
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(t * U))));
	end
	return tmp
end
l = abs(l)
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= -2.8e-58)
		tmp = sqrt((2.0 * (U * (t * n))));
	else
		tmp = sqrt((2.0 * (n * (t * U))));
	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, -2.8e-58], N[Sqrt[N[(2.0 * N[(U * N[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(2.0 * N[(n * N[(t * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;U \leq -2.8 \cdot 10^{-58}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(t \cdot n\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -2.8000000000000001e-58

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

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

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

    if -2.8000000000000001e-58 < U

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -2.8 \cdot 10^{-58}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(t \cdot n\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right)}\\ \end{array} \]

Alternative 13: 36.7% accurate, 2.1× speedup?

\[\begin{array}{l} l = |l|\\ \\ \sqrt{2 \cdot \left(U \cdot \left(t \cdot n\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 (* t n)))))
l = abs(l);
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt((2.0 * (U * (t * n))));
}
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 * (t * n))))
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 * (t * n))));
}
l = abs(l)
def code(n, U, t, l, Om, U_42_):
	return math.sqrt((2.0 * (U * (t * n))))
l = abs(l)
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(U * Float64(t * n))))
end
l = abs(l)
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt((2.0 * (U * (t * n))));
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[(t * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l = |l|\\
\\
\sqrt{2 \cdot \left(U \cdot \left(t \cdot n\right)\right)}
\end{array}
Derivation
  1. Initial program 50.2%

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

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

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

Alternative 14: 36.8% accurate, 2.1× speedup?

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

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

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

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

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

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

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

Alternative 15: 36.9% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

Reproduce

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