Toniolo and Linder, Equation (13)

Percentage Accurate: 49.0% → 65.1%
Time: 23.7s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 49.0% 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: 65.1% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{n \cdot \left(-2 \cdot \frac{U}{Om} + \frac{U \cdot \left(n \cdot \left(\frac{U*}{Om} - \frac{U}{Om}\right)\right)}{Om}\right)} \cdot \left(l\_m \cdot \sqrt{2}\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 5.1%

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

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

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

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

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

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

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

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

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

    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. Simplified8.8%

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

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

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

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

Alternative 2: 60.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 54.7%

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

      \[\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 4.00000000000000007e151 < l

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

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

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

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

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

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

Alternative 3: 54.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 54.7%

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

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

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

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

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

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

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

    if 5.40000000000000015e150 < l

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

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

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

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

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

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

Alternative 4: 44.1% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;t \leq -3.8 \cdot 10^{+169}:\\ \;\;\;\;\sqrt[3]{{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{1.5}}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{+117}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + \frac{\left(l\_m \cdot l\_m\right) \cdot -2}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t} \cdot \sqrt{2 \cdot \left(n \cdot U\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (if (<= t -3.8e+169)
   (cbrt (pow (* (* 2.0 U) (* n t)) 1.5))
   (if (<= t 1.9e+117)
     (sqrt (* 2.0 (* n (* U (+ t (/ (* (* l_m l_m) -2.0) Om))))))
     (* (sqrt t) (sqrt (* 2.0 (* n U)))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double tmp;
	if (t <= -3.8e+169) {
		tmp = cbrt(pow(((2.0 * U) * (n * t)), 1.5));
	} else if (t <= 1.9e+117) {
		tmp = sqrt((2.0 * (n * (U * (t + (((l_m * l_m) * -2.0) / Om))))));
	} else {
		tmp = sqrt(t) * sqrt((2.0 * (n * U)));
	}
	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 tmp;
	if (t <= -3.8e+169) {
		tmp = Math.cbrt(Math.pow(((2.0 * U) * (n * t)), 1.5));
	} else if (t <= 1.9e+117) {
		tmp = Math.sqrt((2.0 * (n * (U * (t + (((l_m * l_m) * -2.0) / Om))))));
	} else {
		tmp = Math.sqrt(t) * Math.sqrt((2.0 * (n * U)));
	}
	return tmp;
}
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (t <= -3.8e+169)
		tmp = cbrt((Float64(Float64(2.0 * U) * Float64(n * t)) ^ 1.5));
	elseif (t <= 1.9e+117)
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(Float64(Float64(l_m * l_m) * -2.0) / Om))))));
	else
		tmp = Float64(sqrt(t) * sqrt(Float64(2.0 * Float64(n * U))));
	end
	return tmp
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := If[LessEqual[t, -3.8e+169], N[Power[N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[t, 1.9e+117], N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+169}:\\
\;\;\;\;\sqrt[3]{{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{1.5}}\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{+117}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + \frac{\left(l\_m \cdot l\_m\right) \cdot -2}{Om}\right)\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.79999999999999992e169

    1. Initial program 48.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. Simplified58.2%

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\color{blue}{{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{1}} \cdot \sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)}\right)}^{0.3333333333333333} \]
      8. pow1/254.9%

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

        \[\leadsto {\left({\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{1} \cdot {\left(2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right)}^{0.5}\right)}^{0.3333333333333333} \]
      10. *-commutative56.9%

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

        \[\leadsto {\left({\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{1} \cdot {\left(2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}\right)}^{0.5}\right)}^{0.3333333333333333} \]
      12. pow-prod-up58.7%

        \[\leadsto {\color{blue}{\left({\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333} \]
      13. metadata-eval58.7%

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

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

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

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

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

    if -3.79999999999999992e169 < t < 1.9000000000000001e117

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

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

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

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

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

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

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

    if 1.9000000000000001e117 < t

    1. Initial program 45.3%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified48.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. Step-by-step derivation
      1. associate-*r*49.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 48.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 54.7%

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

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

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

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

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

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

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

    if 4.2000000000000003e152 < l

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

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

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

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

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

Alternative 6: 44.6% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.8499999999999999e117

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

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

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

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

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

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

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

    if 1.8499999999999999e117 < t

    1. Initial program 45.3%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified48.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. Step-by-step derivation
      1. associate-*r*49.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 43.5% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + \frac{\left(l\_m \cdot l\_m\right) \cdot -2}{Om}\right)\right)\right)} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (sqrt (* 2.0 (* n (* U (+ t (/ (* (* l_m l_m) -2.0) 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 * (n * (U * (t + (((l_m * l_m) * -2.0) / 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 * (n * (u * (t + (((l_m * l_m) * (-2.0d0)) / 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 * (n * (U * (t + (((l_m * l_m) * -2.0) / Om))))));
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.sqrt((2.0 * (n * (U * (t + (((l_m * l_m) * -2.0) / Om))))))
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(n * Float64(U * Float64(t + Float64(Float64(Float64(l_m * l_m) * -2.0) / Om))))))
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = sqrt((2.0 * (n * (U * (t + (((l_m * l_m) * -2.0) / Om))))));
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(n * N[(U * N[(t + N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * -2.0), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\sqrt{2 \cdot \left(n \cdot \left(U \cdot \left(t + \frac{\left(l\_m \cdot l\_m\right) \cdot -2}{Om}\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 50.5%

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

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

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

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

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

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

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

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

Alternative 8: 37.8% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 4.4 \cdot 10^{-73}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\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 (<= l_m 4.4e-73)
   (sqrt (* 2.0 (* n (* U t))))
   (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 (l_m <= 4.4e-73) {
		tmp = sqrt((2.0 * (n * (U * t))));
	} 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 (l_m <= 4.4d-73) then
        tmp = sqrt((2.0d0 * (n * (u * t))))
    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 (l_m <= 4.4e-73) {
		tmp = Math.sqrt((2.0 * (n * (U * t))));
	} 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 l_m <= 4.4e-73:
		tmp = math.sqrt((2.0 * (n * (U * t))))
	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 (l_m <= 4.4e-73)
		tmp = sqrt(Float64(2.0 * Float64(n * Float64(U * t))));
	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 (l_m <= 4.4e-73)
		tmp = sqrt((2.0 * (n * (U * t))));
	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[l$95$m, 4.4e-73], N[Sqrt[N[(2.0 * N[(n * N[(U * t), $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}\;l\_m \leq 4.4 \cdot 10^{-73}:\\
\;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(U \cdot t\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 l < 4.4e-73

    1. Initial program 55.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. Simplified61.3%

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

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

    if 4.4e-73 < l

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

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

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

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

        \[\leadsto {\left(2 \cdot \color{blue}{\left(\left(n \cdot U\right) \cdot t\right)}\right)}^{0.5} \]
      3. *-commutative15.1%

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

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

      \[\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. Add Preprocessing

Alternative 9: 35.4% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{2 \cdot \left(n \cdot \left(U \cdot t\right)\right)} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*) :precision binary64 (sqrt (* 2.0 (* n (* U 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 * (n * (U * 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 * (n * (u * 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 * (n * (U * t))));
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.sqrt((2.0 * (n * (U * t))))
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return sqrt(Float64(2.0 * Float64(n * Float64(U * t))))
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = sqrt((2.0 * (n * (U * t))));
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := N[Sqrt[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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

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

Reproduce

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