Toniolo and Linder, Equation (13)

Percentage Accurate: 50.7% → 64.9%
Time: 27.8s
Alternatives: 13
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 13 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 64.9% accurate, 0.2× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\ t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_1 \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_2 \leq 0:\\ \;\;\;\;e^{\left(\log \left(-2 \cdot \left(n \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right) - \log \left(\frac{-1}{U}\right)\right) \cdot 0.5}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_1 \cdot \left(U - U*\right) + 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(e^{0.16666666666666666 \cdot \left(\log \left(U \cdot \left(n \cdot \left(2 \cdot \frac{-1}{Om} + \frac{n \cdot \left(U* - U\right)}{{Om}^{2}}\right)\right)\right) + -2 \cdot \log \left(\frac{1}{l\_m}\right)\right)} \cdot \sqrt[3]{\sqrt{2}}\right)}^{3}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* n (pow (/ l_m Om) 2.0)))
        (t_2
         (sqrt
          (*
           (* (* 2.0 n) U)
           (+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_1 (- U* U)))))))
   (if (<= t_2 0.0)
     (exp
      (*
       (-
        (log (* -2.0 (* n (+ t (* -2.0 (/ (pow l_m 2.0) Om))))))
        (log (/ -1.0 U)))
       0.5))
     (if (<= t_2 INFINITY)
       (sqrt
        (*
         (* 2.0 (* n U))
         (- t (+ (* t_1 (- U U*)) (* 2.0 (* l_m (/ l_m Om)))))))
       (pow
        (*
         (exp
          (*
           0.16666666666666666
           (+
            (log
             (*
              U
              (* n (+ (* 2.0 (/ -1.0 Om)) (/ (* n (- U* U)) (pow Om 2.0))))))
            (* -2.0 (log (/ 1.0 l_m))))))
         (cbrt (sqrt 2.0)))
        3.0)))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = n * pow((l_m / Om), 2.0);
	double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U)))));
	double tmp;
	if (t_2 <= 0.0) {
		tmp = exp(((log((-2.0 * (n * (t + (-2.0 * (pow(l_m, 2.0) / Om)))))) - log((-1.0 / U))) * 0.5));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = pow((exp((0.16666666666666666 * (log((U * (n * ((2.0 * (-1.0 / Om)) + ((n * (U_42_ - U)) / pow(Om, 2.0)))))) + (-2.0 * log((1.0 / l_m)))))) * cbrt(sqrt(2.0))), 3.0);
	}
	return tmp;
}
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = n * Math.pow((l_m / Om), 2.0);
	double t_2 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_1 * (U_42_ - U)))));
	double tmp;
	if (t_2 <= 0.0) {
		tmp = Math.exp(((Math.log((-2.0 * (n * (t + (-2.0 * (Math.pow(l_m, 2.0) / Om)))))) - Math.log((-1.0 / U))) * 0.5));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_1 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = Math.pow((Math.exp((0.16666666666666666 * (Math.log((U * (n * ((2.0 * (-1.0 / Om)) + ((n * (U_42_ - U)) / Math.pow(Om, 2.0)))))) + (-2.0 * Math.log((1.0 / l_m)))))) * Math.cbrt(Math.sqrt(2.0))), 3.0);
	}
	return tmp;
}
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(n * (Float64(l_m / Om) ^ 2.0))
	t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_1 * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_2 <= 0.0)
		tmp = exp(Float64(Float64(log(Float64(-2.0 * Float64(n * Float64(t + Float64(-2.0 * Float64((l_m ^ 2.0) / Om)))))) - log(Float64(-1.0 / U))) * 0.5));
	elseif (t_2 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_1 * Float64(U - U_42_)) + Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = Float64(exp(Float64(0.16666666666666666 * Float64(log(Float64(U * Float64(n * Float64(Float64(2.0 * Float64(-1.0 / Om)) + Float64(Float64(n * Float64(U_42_ - U)) / (Om ^ 2.0)))))) + Float64(-2.0 * log(Float64(1.0 / l_m)))))) * cbrt(sqrt(2.0))) ^ 3.0;
	end
	return tmp
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], N[Exp[N[(N[(N[Log[N[(-2.0 * N[(n * N[(t + N[(-2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[Exp[N[(0.16666666666666666 * N[(N[Log[N[(U * N[(n * N[(N[(2.0 * N[(-1.0 / Om), $MachinePrecision]), $MachinePrecision] + N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-2.0 * N[Log[N[(1.0 / l$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

\mathbf{else}:\\
\;\;\;\;{\left(e^{0.16666666666666666 \cdot \left(\log \left(U \cdot \left(n \cdot \left(2 \cdot \frac{-1}{Om} + \frac{n \cdot \left(U* - U\right)}{{Om}^{2}}\right)\right)\right) + -2 \cdot \log \left(\frac{1}{l\_m}\right)\right)} \cdot \sqrt[3]{\sqrt{2}}\right)}^{3}\\


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

    1. Initial program 11.9%

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

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

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

        \[\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. pow-to-exp29.8%

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

        \[\leadsto e^{\log \left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right) \cdot 0.5} \]
      4. *-commutative11.9%

        \[\leadsto e^{\log \left(2 \cdot \left(\color{blue}{\left(n \cdot U\right)} \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) \cdot 0.5} \]
      5. cancel-sign-sub-inv11.9%

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

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

      \[\leadsto \color{blue}{e^{\log \left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) \cdot 0.5}} \]
    7. Taylor expanded in U around -inf 40.0%

      \[\leadsto e^{\color{blue}{\left(\log \left(-2 \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) + -1 \cdot \log \left(\frac{-1}{U}\right)\right)} \cdot 0.5} \]
    8. Step-by-step derivation
      1. mul-1-neg40.0%

        \[\leadsto e^{\left(\log \left(-2 \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) + \color{blue}{\left(-\log \left(\frac{-1}{U}\right)\right)}\right) \cdot 0.5} \]
    9. Simplified40.0%

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

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

    1. Initial program 68.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. Simplified74.1%

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

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

    1. Initial program 0.0%

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

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

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

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

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

Alternative 2: 62.5% accurate, 0.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(2 \cdot \left(n \cdot \left(U \cdot \left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right)\right)}^{1.5}}\\


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

    1. Initial program 11.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 68.1%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/333.7%

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

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

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

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

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

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

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

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

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

Alternative 3: 61.8% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := t + -2 \cdot \frac{{l\_m}^{2}}{Om}\\ t_2 := n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\\ t_3 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2 \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;e^{\left(\log \left(-2 \cdot \left(n \cdot t\_1\right)\right) - \log \left(\frac{-1}{U}\right)\right) \cdot 0.5}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_2 \cdot \left(U - U*\right) + 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{{\left(2 \cdot \left(n \cdot \left(U \cdot t\_1\right)\right)\right)}^{1.5}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (+ t (* -2.0 (/ (pow l_m 2.0) Om))))
        (t_2 (* n (pow (/ l_m Om) 2.0)))
        (t_3
         (sqrt
          (*
           (* (* 2.0 n) U)
           (+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_2 (- U* U)))))))
   (if (<= t_3 0.0)
     (exp (* (- (log (* -2.0 (* n t_1))) (log (/ -1.0 U))) 0.5))
     (if (<= t_3 INFINITY)
       (sqrt
        (*
         (* 2.0 (* n U))
         (- t (+ (* t_2 (- U U*)) (* 2.0 (* l_m (/ l_m Om)))))))
       (cbrt (pow (* 2.0 (* n (* U t_1))) 1.5))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = t + (-2.0 * (pow(l_m, 2.0) / Om));
	double t_2 = n * pow((l_m / Om), 2.0);
	double t_3 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = exp(((log((-2.0 * (n * t_1))) - log((-1.0 / U))) * 0.5));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = cbrt(pow((2.0 * (n * (U * t_1))), 1.5));
	}
	return tmp;
}
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = t + (-2.0 * (Math.pow(l_m, 2.0) / Om));
	double t_2 = n * Math.pow((l_m / Om), 2.0);
	double t_3 = Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_2 * (U_42_ - U)))));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.exp(((Math.log((-2.0 * (n * t_1))) - Math.log((-1.0 / U))) * 0.5));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t - ((t_2 * (U - U_42_)) + (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = Math.cbrt(Math.pow((2.0 * (n * (U * t_1))), 1.5));
	}
	return tmp;
}
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(t + Float64(-2.0 * Float64((l_m ^ 2.0) / Om)))
	t_2 = Float64(n * (Float64(l_m / Om) ^ 2.0))
	t_3 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_2 * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = exp(Float64(Float64(log(Float64(-2.0 * Float64(n * t_1))) - log(Float64(-1.0 / U))) * 0.5));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_2 * Float64(U - U_42_)) + Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = cbrt((Float64(2.0 * Float64(n * Float64(U * t_1))) ^ 1.5));
	end
	return tmp
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(t + N[(-2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(n * N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Exp[N[(N[(N[Log[N[(-2.0 * N[(n * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[Log[N[(-1.0 / U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[N[(2.0 * N[(n * N[(U * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(2 \cdot \left(n \cdot \left(U \cdot t\_1\right)\right)\right)}^{1.5}}\\


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

    1. Initial program 11.9%

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

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

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

        \[\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. pow-to-exp29.8%

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

        \[\leadsto e^{\log \left(2 \cdot \color{blue}{\left(\left(U \cdot n\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}\right) \cdot 0.5} \]
      4. *-commutative11.9%

        \[\leadsto e^{\log \left(2 \cdot \left(\color{blue}{\left(n \cdot U\right)} \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) \cdot 0.5} \]
      5. cancel-sign-sub-inv11.9%

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

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

      \[\leadsto \color{blue}{e^{\log \left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) \cdot 0.5}} \]
    7. Taylor expanded in U around -inf 40.0%

      \[\leadsto e^{\color{blue}{\left(\log \left(-2 \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) + -1 \cdot \log \left(\frac{-1}{U}\right)\right)} \cdot 0.5} \]
    8. Step-by-step derivation
      1. mul-1-neg40.0%

        \[\leadsto e^{\left(\log \left(-2 \cdot \left(n \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right) + \color{blue}{\left(-\log \left(\frac{-1}{U}\right)\right)}\right) \cdot 0.5} \]
    9. Simplified40.0%

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

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

    1. Initial program 68.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. Simplified74.1%

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(2 \cdot \left(\left(n \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    7. Step-by-step derivation
      1. unpow1/333.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 61.4% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 11.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 68.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. Simplified74.1%

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

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

    1. Initial program 0.0%

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

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*33.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. *-commutative33.7%

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

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

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

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

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

Alternative 5: 62.0% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 11.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 68.1%

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

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

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

    1. Initial program 0.0%

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

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)\right)}^{0.5}} \]
      2. associate-*r*33.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. *-commutative33.7%

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

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

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

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

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

Alternative 6: 62.2% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 10.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 68.1%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 53.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.7 \cdot 10^{-119} \lor \neg \left(n \leq 2.05 \cdot 10^{-30}\right):\\
\;\;\;\;{\left(2 \cdot \left(\left(t + -2 \cdot \frac{{l\_m}^{2}}{Om}\right) \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.70000000000000012e-119 or 2.0500000000000002e-30 < n

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}} \]
    5. 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. associate-*r*55.6%

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

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

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

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

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

    if -1.70000000000000012e-119 < n < 2.0500000000000002e-30

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

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

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

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

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

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

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

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

Alternative 8: 47.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 3.70000000000000002e229

    1. Initial program 53.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. Simplified54.9%

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

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

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

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

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

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

    if 3.70000000000000002e229 < n

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 47.4% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < 1.7e229

    1. Initial program 53.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. Simplified54.9%

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

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

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

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

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

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

    if 1.7e229 < n

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 48.2% accurate, 2.0× speedup?

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

\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 52.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. Simplified53.9%

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

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

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

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

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

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

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

Alternative 11: 37.3% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U* < 6.5000000000000002e-200

    1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

    if 6.5000000000000002e-200 < U*

    1. Initial program 50.3%

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

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

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

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

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

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

Alternative 12: 36.3% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U* < 7.69999999999999992e-199

    1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

    if 7.69999999999999992e-199 < U*

    1. Initial program 50.3%

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

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

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

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

Alternative 13: 36.2% accurate, 2.1× speedup?

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

\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
\end{array}
Derivation
  1. Initial program 52.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. Simplified53.9%

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

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

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

Reproduce

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