Toniolo and Linder, Equation (13)

Percentage Accurate: 49.5% → 63.4%
Time: 26.4s
Alternatives: 16
Speedup: 0.5×

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

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

Initial Program: 49.5% accurate, 1.0× speedup?

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

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

Alternative 1: 63.4% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := {\left(\frac{l\_m}{Om}\right)}^{2}\\ t_2 := \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\\ t_3 := \sqrt{\left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2\right) \cdot \left(\left(2 \cdot n\right) \cdot U\right)}\\ \mathbf{if}\;t\_3 \leq 0:\\ \;\;\;\;\sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{l\_m}^{2}}{Om}, n \cdot \left(t\_1 \cdot \left(-U*\right)\right)\right)\right)} \cdot \sqrt{2 \cdot n}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_2 - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{U \cdot \left(n \cdot \left(n \cdot \frac{U* - U}{{Om}^{2}} - \frac{2}{Om}\right)\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 (* (* n t_1) (- U* U)))
        (t_3
         (sqrt (* (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_2) (* (* 2.0 n) U)))))
   (if (<= t_3 0.0)
     (*
      (sqrt (* U (- t (fma 2.0 (/ (pow l_m 2.0) Om) (* n (* t_1 (- U*)))))))
      (sqrt (* 2.0 n)))
     (if (<= t_3 INFINITY)
       (sqrt (* (* 2.0 (* n U)) (+ t (- t_2 (* 2.0 (* l_m (/ l_m Om)))))))
       (*
        (sqrt (* U (* n (- (* n (/ (- U* U) (pow Om 2.0))) (/ 2.0 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 = (n * t_1) * (U_42_ - U);
	double t_3 = sqrt((((t - (2.0 * ((l_m * l_m) / Om))) + t_2) * ((2.0 * n) * U)));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((U * (t - fma(2.0, (pow(l_m, 2.0) / Om), (n * (t_1 * -U_42_)))))) * sqrt((2.0 * n));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t + (t_2 - (2.0 * (l_m * (l_m / Om)))))));
	} else {
		tmp = sqrt((U * (n * ((n * ((U_42_ - U) / pow(Om, 2.0))) - (2.0 / Om))))) * (l_m * 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(n * t_1) * Float64(U_42_ - U))
	t_3 = sqrt(Float64(Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_2) * Float64(Float64(2.0 * n) * U)))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(U * Float64(t - fma(2.0, Float64((l_m ^ 2.0) / Om), Float64(n * Float64(t_1 * Float64(-U_42_))))))) * sqrt(Float64(2.0 * n)));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_2 - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))))));
	else
		tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(n * Float64(Float64(U_42_ - U) / (Om ^ 2.0))) - Float64(2.0 / Om))))) * Float64(l_m * sqrt(2.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[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] * N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(U * N[(t - N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision] + N[(n * N[(t$95$1 * (-U$42$)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(t$95$2 - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(n * N[(N[(U$42$ - U), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $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(n \cdot t\_1\right) \cdot \left(U* - U\right)\\
t_3 := \sqrt{\left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2\right) \cdot \left(\left(2 \cdot n\right) \cdot U\right)}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{U \cdot \left(t - \mathsf{fma}\left(2, \frac{{l\_m}^{2}}{Om}, n \cdot \left(t\_1 \cdot \left(-U*\right)\right)\right)\right)} \cdot \sqrt{2 \cdot n}\\

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

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


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

    1. Initial program 13.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. Simplified33.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 31.2%

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

        \[\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(-\frac{U* \cdot {\ell}^{2}}{{Om}^{2}}\right)}\right)\right)\right)} \]
      2. associate-/l*31.5%

        \[\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(-\color{blue}{U* \cdot \frac{{\ell}^{2}}{{Om}^{2}}}\right)\right)\right)\right)} \]
      3. unpow231.5%

        \[\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(-U* \cdot \frac{\color{blue}{\ell \cdot \ell}}{{Om}^{2}}\right)\right)\right)\right)} \]
      4. unpow231.5%

        \[\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(-U* \cdot \frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)\right)} \]
      5. times-frac33.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(-U* \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)\right)\right)} \]
      6. unpow233.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(-U* \cdot \color{blue}{{\left(\frac{\ell}{Om}\right)}^{2}}\right)\right)\right)\right)} \]
    6. Simplified33.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. Step-by-step derivation
      1. pow1/233.8%

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

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

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

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

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

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

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

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

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

    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 66.8%

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

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

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

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

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

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

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

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

Alternative 2: 63.4% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := {\left(\frac{l\_m}{Om}\right)}^{2}\\ t_2 := \left(n \cdot t\_1\right) \cdot \left(U* - U\right)\\ t_3 := \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2\right) \cdot \left(\left(2 \cdot n\right) \cdot U\right)\\ t_4 := l\_m \cdot \frac{l\_m}{Om}\\ \mathbf{if}\;t\_3 \leq 10^{-305}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, t\_4, n \cdot \left(t\_1 \cdot \left(-U*\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_2 - 2 \cdot t\_4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{U \cdot \left(n \cdot \left(n \cdot \frac{U* - U}{{Om}^{2}} - \frac{2}{Om}\right)\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 (* (* n t_1) (- U* U)))
        (t_3 (* (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_2) (* (* 2.0 n) U)))
        (t_4 (* l_m (/ l_m Om))))
   (if (<= t_3 1e-305)
     (sqrt (* (* 2.0 n) (* U (- t (fma 2.0 t_4 (* n (* t_1 (- U*))))))))
     (if (<= t_3 INFINITY)
       (sqrt (* (* 2.0 (* n U)) (+ t (- t_2 (* 2.0 t_4)))))
       (*
        (sqrt (* U (* n (- (* n (/ (- U* U) (pow Om 2.0))) (/ 2.0 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 = (n * t_1) * (U_42_ - U);
	double t_3 = ((t - (2.0 * ((l_m * l_m) / Om))) + t_2) * ((2.0 * n) * U);
	double t_4 = l_m * (l_m / Om);
	double tmp;
	if (t_3 <= 1e-305) {
		tmp = sqrt(((2.0 * n) * (U * (t - fma(2.0, t_4, (n * (t_1 * -U_42_)))))));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t + (t_2 - (2.0 * t_4)))));
	} else {
		tmp = sqrt((U * (n * ((n * ((U_42_ - U) / pow(Om, 2.0))) - (2.0 / Om))))) * (l_m * 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(n * t_1) * Float64(U_42_ - U))
	t_3 = Float64(Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_2) * Float64(Float64(2.0 * n) * U))
	t_4 = Float64(l_m * Float64(l_m / Om))
	tmp = 0.0
	if (t_3 <= 1e-305)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - fma(2.0, t_4, Float64(n * Float64(t_1 * Float64(-U_42_))))))));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_2 - Float64(2.0 * t_4)))));
	else
		tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(n * Float64(Float64(U_42_ - U) / (Om ^ 2.0))) - Float64(2.0 / Om))))) * Float64(l_m * sqrt(2.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[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(n * t$95$1), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] * N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 1e-305], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * t$95$4 + N[(n * N[(t$95$1 * (-U$42$)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(t$95$2 - N[(2.0 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(n * N[(N[(U$42$ - U), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $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(n \cdot t\_1\right) \cdot \left(U* - U\right)\\
t_3 := \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_2\right) \cdot \left(\left(2 \cdot n\right) \cdot U\right)\\
t_4 := l\_m \cdot \frac{l\_m}{Om}\\
\mathbf{if}\;t\_3 \leq 10^{-305}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, t\_4, n \cdot \left(t\_1 \cdot \left(-U*\right)\right)\right)\right)\right)}\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_2 - 2 \cdot t\_4\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(n \cdot \frac{U* - U}{{Om}^{2}} - \frac{2}{Om}\right)\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*)))) < 9.99999999999999996e-306

    1. Initial program 17.2%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified34.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 U around 0 32.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. mul-1-neg32.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(-\frac{U* \cdot {\ell}^{2}}{{Om}^{2}}\right)}\right)\right)\right)} \]
      2. associate-/l*32.2%

        \[\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(-\color{blue}{U* \cdot \frac{{\ell}^{2}}{{Om}^{2}}}\right)\right)\right)\right)} \]
      3. unpow232.2%

        \[\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(-U* \cdot \frac{\color{blue}{\ell \cdot \ell}}{{Om}^{2}}\right)\right)\right)\right)} \]
      4. unpow232.2%

        \[\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(-U* \cdot \frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)\right)} \]
      5. times-frac34.4%

        \[\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(-U* \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)\right)\right)} \]
      6. unpow234.4%

        \[\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(-U* \cdot \color{blue}{{\left(\frac{\ell}{Om}\right)}^{2}}\right)\right)\right)\right)} \]
    6. Simplified34.4%

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

    if 9.99999999999999996e-306 < (*.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 66.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. Simplified72.4%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(n \cdot \left(U \cdot \mathsf{fma}\left(n, {\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right), \mathsf{fma}\left(\ell \cdot \frac{\ell}{Om}, -2, t\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 32.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. Step-by-step derivation
      1. associate-/l*32.4%

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

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

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

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

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

Alternative 3: 63.2% accurate, 0.4× speedup?

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

\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(n \cdot \frac{U* - U}{{Om}^{2}} - \frac{2}{Om}\right)\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*)))) < 9.99999999999999996e-306

    1. Initial program 17.2%

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

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

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

    if 9.99999999999999996e-306 < (*.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 66.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. Simplified72.4%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(n \cdot \left(U \cdot \mathsf{fma}\left(n, {\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right), \mathsf{fma}\left(\ell \cdot \frac{\ell}{Om}, -2, t\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 32.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. Step-by-step derivation
      1. associate-/l*32.4%

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

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

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

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

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

Alternative 4: 60.1% accurate, 0.4× speedup?

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

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

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

    1. Initial program 17.2%

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

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

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

    if 9.99999999999999996e-306 < (*.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 66.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. Simplified72.4%

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

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

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

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

Alternative 5: 58.8% accurate, 0.5× speedup?

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

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

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


\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*)))) < 9.99999999999999996e-306

    1. Initial program 17.2%

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

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

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

    if 9.99999999999999996e-306 < (*.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 66.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. Simplified72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\frac{Om}{\ell \cdot \left(\left(n \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(U* - U\right)} - Om \cdot \left({2}^{0.5} \cdot \color{blue}{{\left(\frac{U}{U* - U}\right)}^{0.5}}\right)\right)}\right)}^{-1} \]
      7. pow-prod-down29.4%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{Om}{\ell}}{\left(n \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot \left(U* - U\right)} - Om \cdot {\left(2 \cdot \frac{U}{U* - U}\right)}^{0.5}}}} \]
      3. unpow1/225.3%

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

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

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

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

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

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

Alternative 6: 45.8% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;t \leq -1.08 \cdot 10^{+73}:\\ \;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{+151}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{{l\_m}^{2}}{Om}\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.08e+73)
   (pow (* (* 2.0 U) (* n t)) 0.5)
   (if (<= t 5.2e+151)
     (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (/ (pow 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.08e+73) {
		tmp = pow(((2.0 * U) * (n * t)), 0.5);
	} else if (t <= 5.2e+151) {
		tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * (pow(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.08d+73)) then
        tmp = ((2.0d0 * u) * (n * t)) ** 0.5d0
    else if (t <= 5.2d+151) then
        tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * ((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.08e+73) {
		tmp = Math.pow(((2.0 * U) * (n * t)), 0.5);
	} else if (t <= 5.2e+151) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * (Math.pow(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.08e+73:
		tmp = math.pow(((2.0 * U) * (n * t)), 0.5)
	elif t <= 5.2e+151:
		tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * (math.pow(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.08e+73)
		tmp = Float64(Float64(2.0 * U) * Float64(n * t)) ^ 0.5;
	elseif (t <= 5.2e+151)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64((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.08e+73)
		tmp = ((2.0 * U) * (n * t)) ^ 0.5;
	elseif (t <= 5.2e+151)
		tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((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.08e+73], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], If[LessEqual[t, 5.2e+151], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(N[Power[l$95$m, 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.08 \cdot 10^{+73}:\\
\;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{0.5}\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{+151}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{{l\_m}^{2}}{Om}\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 < -1.08e73

    1. Initial program 60.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. Simplified56.6%

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

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

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(n \cdot t\right)\right)}\right)} \]
    6. Applied egg-rr29.2%

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

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

        \[\leadsto {\color{blue}{\left(\left(2 \cdot U\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(n \cdot t\right)\right)\right)}}^{0.5} \]
      3. log1p-expm1-u60.6%

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

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

    if -1.08e73 < t < 5.20000000000000026e151

    1. Initial program 51.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. Simplified55.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 Om around inf 44.6%

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

    if 5.20000000000000026e151 < t

    1. Initial program 27.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. Simplified32.6%

      \[\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*34.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. fma-undefine34.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 45.3% accurate, 1.0× speedup?

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

    1. Initial program 52.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. Simplified55.5%

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

      \[\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. associate-*r*45.2%

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

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

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

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

    if 4.4e169 < t

    1. Initial program 27.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. Simplified33.3%

      \[\leadsto \color{blue}{\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, \ell \cdot \frac{\ell}{Om}, n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*35.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. fma-undefine35.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 40.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.7 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(\left(2 \cdot n\right) \cdot U\right)\right|}\\

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


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

    1. Initial program 56.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. Simplified57.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 39.5%

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(2 \cdot \left(\left(n \cdot U\right) \cdot t\right)\right)}^{1}}} \]
      3. metadata-eval42.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7e18 < l

    1. Initial program 23.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. Simplified35.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 Om around inf 32.6%

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

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

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

Alternative 9: 39.0% accurate, 1.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 2.5 \cdot 10^{+174}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(\left(2 \cdot n\right) \cdot U\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 2.5e+174)
   (sqrt (fabs (* t (* (* 2.0 n) U))))
   (* (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 <= 2.5e+174) {
		tmp = sqrt(fabs((t * ((2.0 * n) * U))));
	} 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 <= 2.5d+174) then
        tmp = sqrt(abs((t * ((2.0d0 * n) * u))))
    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 <= 2.5e+174) {
		tmp = Math.sqrt(Math.abs((t * ((2.0 * n) * U))));
	} 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 <= 2.5e+174:
		tmp = math.sqrt(math.fabs((t * ((2.0 * n) * U))))
	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 <= 2.5e+174)
		tmp = sqrt(abs(Float64(t * Float64(Float64(2.0 * n) * U))));
	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 <= 2.5e+174)
		tmp = sqrt(abs((t * ((2.0 * n) * U))));
	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, 2.5e+174], N[Sqrt[N[Abs[N[(t * N[(N[(2.0 * n), $MachinePrecision] * U), $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 2.5 \cdot 10^{+174}:\\
\;\;\;\;\sqrt{\left|t \cdot \left(\left(2 \cdot n\right) \cdot U\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 < 2.4999999999999998e174

    1. Initial program 52.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. Simplified55.0%

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(2 \cdot \left(\left(n \cdot U\right) \cdot t\right)\right)}^{1}}} \]
      3. metadata-eval35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4999999999999998e174 < t

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

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

        \[\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. fma-undefine37.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.0% accurate, 1.1× speedup?

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{{\left(2 \cdot \left(\left(n \cdot U\right) \cdot t\right)\right)}^{1}}} \]
    3. metadata-eval36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.8% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 1.15 \cdot 10^{-43}:\\ \;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\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 1.15e-43)
   (pow (* t (* 2.0 (* n U))) 0.5)
   (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 <= 1.15e-43) {
		tmp = pow((t * (2.0 * (n * U))), 0.5);
	} 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 <= 1.15d-43) then
        tmp = (t * (2.0d0 * (n * u))) ** 0.5d0
    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 <= 1.15e-43) {
		tmp = Math.pow((t * (2.0 * (n * U))), 0.5);
	} 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 <= 1.15e-43:
		tmp = math.pow((t * (2.0 * (n * U))), 0.5)
	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 <= 1.15e-43)
		tmp = Float64(t * Float64(2.0 * Float64(n * U))) ^ 0.5;
	else
		tmp = Float64(Float64(2.0 * 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 <= 1.15e-43)
		tmp = (t * (2.0 * (n * U))) ^ 0.5;
	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, 1.15e-43], N[Power[N[(t * N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.15 \cdot 10^{-43}:\\
\;\;\;\;{\left(t \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\

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


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

    1. Initial program 55.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. Simplified56.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 l around 0 38.5%

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

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

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

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

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

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

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

    if 1.1499999999999999e-43 < l

    1. Initial program 30.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. Simplified40.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 23.3%

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

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(n \cdot t\right)\right)}\right)} \]
    6. Applied egg-rr22.6%

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

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

        \[\leadsto {\color{blue}{\left(\left(2 \cdot U\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(n \cdot t\right)\right)\right)}}^{0.5} \]
      3. log1p-expm1-u25.0%

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

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

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

Alternative 12: 37.8% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 1.3 \cdot 10^{-43}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\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 1.3e-43)
   (pow (* 2.0 (* t (* n U))) 0.5)
   (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 <= 1.3e-43) {
		tmp = pow((2.0 * (t * (n * U))), 0.5);
	} 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 <= 1.3d-43) then
        tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
    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 <= 1.3e-43) {
		tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
	} 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 <= 1.3e-43:
		tmp = math.pow((2.0 * (t * (n * U))), 0.5)
	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 <= 1.3e-43)
		tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5;
	else
		tmp = Float64(Float64(2.0 * 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 <= 1.3e-43)
		tmp = (2.0 * (t * (n * U))) ^ 0.5;
	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, 1.3e-43], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Power[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.3 \cdot 10^{-43}:\\
\;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\

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


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

    1. Initial program 55.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. Simplified56.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 l around 0 39.4%

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

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

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

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

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

    if 1.3e-43 < l

    1. Initial program 30.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. Simplified40.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 23.3%

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

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(n \cdot t\right)\right)}\right)} \]
    6. Applied egg-rr22.6%

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

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

        \[\leadsto {\color{blue}{\left(\left(2 \cdot U\right) \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(n \cdot t\right)\right)\right)}}^{0.5} \]
      3. log1p-expm1-u25.0%

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

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

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

Alternative 13: 37.2% accurate, 2.1× speedup?

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

\\
{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.4%

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

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

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

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

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

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

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

Alternative 14: 35.3% accurate, 2.1× speedup?

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

\\
\sqrt{t \cdot \left(\left(2 \cdot n\right) \cdot U\right)}
\end{array}
Derivation
  1. Initial program 49.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. Simplified52.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 U around 0 42.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(-1 \cdot \frac{U* \cdot {\ell}^{2}}{{Om}^{2}}\right)}\right)\right)\right)} \]
  5. Step-by-step derivation
    1. mul-1-neg42.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(-\frac{U* \cdot {\ell}^{2}}{{Om}^{2}}\right)}\right)\right)\right)} \]
    2. associate-/l*43.5%

      \[\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(-\color{blue}{U* \cdot \frac{{\ell}^{2}}{{Om}^{2}}}\right)\right)\right)\right)} \]
    3. unpow243.5%

      \[\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(-U* \cdot \frac{\color{blue}{\ell \cdot \ell}}{{Om}^{2}}\right)\right)\right)\right)} \]
    4. unpow243.5%

      \[\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(-U* \cdot \frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}}\right)\right)\right)\right)} \]
    5. times-frac52.2%

      \[\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(-U* \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)}\right)\right)\right)\right)} \]
    6. unpow252.2%

      \[\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(-U* \cdot \color{blue}{{\left(\frac{\ell}{Om}\right)}^{2}}\right)\right)\right)\right)} \]
  6. Simplified52.2%

    \[\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. Step-by-step derivation
    1. clear-num52.2%

      \[\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(-U* \cdot {\color{blue}{\left(\frac{1}{\frac{Om}{\ell}}\right)}}^{2}\right)\right)\right)\right)} \]
    2. inv-pow52.2%

      \[\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(-U* \cdot {\color{blue}{\left({\left(\frac{Om}{\ell}\right)}^{-1}\right)}}^{2}\right)\right)\right)\right)} \]
  8. Applied egg-rr52.2%

    \[\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(-U* \cdot {\color{blue}{\left({\left(\frac{Om}{\ell}\right)}^{-1}\right)}}^{2}\right)\right)\right)\right)} \]
  9. Step-by-step derivation
    1. unpow-152.2%

      \[\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(-U* \cdot {\color{blue}{\left(\frac{1}{\frac{Om}{\ell}}\right)}}^{2}\right)\right)\right)\right)} \]
  10. Simplified52.2%

    \[\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(-U* \cdot {\color{blue}{\left(\frac{1}{\frac{Om}{\ell}}\right)}}^{2}\right)\right)\right)\right)} \]
  11. Taylor expanded in t around inf 35.3%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 35.3% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 35.6% 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 49.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. Simplified52.4%

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

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

Reproduce

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