Toniolo and Linder, Equation (13)

Percentage Accurate: 49.9% → 64.3%
Time: 34.1s
Alternatives: 23
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 23 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 64.3% accurate, 0.3× 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(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{l_m \cdot l_m}{Om}\right) + t_1\right)}\\ \mathbf{if}\;t_3 \leq 0:\\ \;\;\;\;\sqrt{n \cdot \left(t + -2 \cdot \frac{{l_m}^{2}}{Om}\right)} \cdot \sqrt{2 \cdot U}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(l_m \cdot \frac{l_m}{Om}\right)\right) + t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{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 (* (* 2.0 n) U))
        (t_3 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1)))))
   (if (<= t_3 0.0)
     (* (sqrt (* n (+ t (* -2.0 (/ (pow l_m 2.0) Om))))) (sqrt (* 2.0 U)))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (- t (* 2.0 (* l_m (/ l_m Om)))) t_1)))
       (*
        (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 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((n * (t + (-2.0 * (pow(l_m, 2.0) / Om))))) * sqrt((2.0 * U));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)));
	} 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 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((n * (t + (-2.0 * (Math.pow(l_m, 2.0) / Om))))) * Math.sqrt((2.0 * U));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)));
	} 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 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((n * (t + (-2.0 * (math.pow(l_m, 2.0) / Om))))) * math.sqrt((2.0 * U))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)))
	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(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_1)))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(n * Float64(t + Float64(-2.0 * Float64((l_m ^ 2.0) / Om))))) * sqrt(Float64(2.0 * U)));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))) + t_1)));
	else
		tmp = Float64(sqrt(Float64(U * Float64(n * Float64(Float64(Float64(n * 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 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((n * (t + (-2.0 * ((l_m ^ 2.0) / Om))))) * sqrt((2.0 * U));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)));
	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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(n * N[(t + N[(-2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U * N[(n * N[(N[(N[(n * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision] - N[(2.0 / 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(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{l_m \cdot l_m}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\sqrt{n \cdot \left(t + -2 \cdot \frac{{l_m}^{2}}{Om}\right)} \cdot \sqrt{2 \cdot U}\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{U \cdot \left(n \cdot \left(\frac{n \cdot \left(U* - U\right)}{{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 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 0.0

    1. Initial program 13.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. Simplified52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/76.4%

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 9.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-*r/9.0%

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

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

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

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

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

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

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


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

    1. Initial program 13.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. Simplified52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/76.4%

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around inf 9.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. sub-neg9.0%

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 17.0%

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

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

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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/76.1%

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in n around inf 24.3%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om}\right)\right)} \cdot \sqrt{U \cdot \left(U* - U\right)} \]
      2. expm1-udef20.1%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}}\right)} - 1\right) \cdot \sqrt{U \cdot \left(U* - U\right)} \]
    6. Applied egg-rr20.6%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}\right)} - 1\right)} \cdot \sqrt{U \cdot \left(U* - U\right)} \]
    7. Step-by-step derivation
      1. expm1-def24.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}\right)\right)} \cdot \sqrt{U \cdot \left(U* - U\right)} \]
      2. expm1-log1p24.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 62.3% accurate, 0.3× 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(2 \cdot n\right) \cdot U\\ t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{l_m \cdot l_m}{Om}\right) + t_1\right)}\\ \mathbf{if}\;t_3 \leq 0:\\ \;\;\;\;\sqrt{n \cdot \left(t + -2 \cdot \frac{{l_m}^{2}}{Om}\right)} \cdot \sqrt{2 \cdot U}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(l_m \cdot \frac{l_m}{Om}\right)\right) + t_1\right)}\\ \mathbf{else}:\\ \;\;\;\;\left|\left(n \cdot \sqrt{2}\right) \cdot \left(\frac{l_m}{Om} \cdot \sqrt{U \cdot \left(U* - U\right)}\right)\right|\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* (* n (pow (/ l_m Om) 2.0)) (- U* U)))
        (t_2 (* (* 2.0 n) U))
        (t_3 (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l_m l_m) Om))) t_1)))))
   (if (<= t_3 0.0)
     (* (sqrt (* n (+ t (* -2.0 (/ (pow l_m 2.0) Om))))) (sqrt (* 2.0 U)))
     (if (<= t_3 INFINITY)
       (sqrt (* t_2 (+ (- t (* 2.0 (* l_m (/ l_m Om)))) t_1)))
       (fabs (* (* n (sqrt 2.0)) (* (/ l_m Om) (sqrt (* U (- 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 = (2.0 * n) * U;
	double t_3 = sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = sqrt((n * (t + (-2.0 * (pow(l_m, 2.0) / Om))))) * sqrt((2.0 * U));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)));
	} else {
		tmp = fabs(((n * sqrt(2.0)) * ((l_m / Om) * sqrt((U * (U_42_ - U))))));
	}
	return tmp;
}
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = (n * Math.pow((l_m / Om), 2.0)) * (U_42_ - U);
	double t_2 = (2.0 * n) * U;
	double t_3 = Math.sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	double tmp;
	if (t_3 <= 0.0) {
		tmp = Math.sqrt((n * (t + (-2.0 * (Math.pow(l_m, 2.0) / Om))))) * Math.sqrt((2.0 * U));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)));
	} else {
		tmp = Math.abs(((n * Math.sqrt(2.0)) * ((l_m / Om) * Math.sqrt((U * (U_42_ - U))))));
	}
	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 = (2.0 * n) * U
	t_3 = math.sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)))
	tmp = 0
	if t_3 <= 0.0:
		tmp = math.sqrt((n * (t + (-2.0 * (math.pow(l_m, 2.0) / Om))))) * math.sqrt((2.0 * U))
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)))
	else:
		tmp = math.fabs(((n * math.sqrt(2.0)) * ((l_m / Om) * math.sqrt((U * (U_42_ - U))))))
	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(2.0 * n) * U)
	t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + t_1)))
	tmp = 0.0
	if (t_3 <= 0.0)
		tmp = Float64(sqrt(Float64(n * Float64(t + Float64(-2.0 * Float64((l_m ^ 2.0) / Om))))) * sqrt(Float64(2.0 * U)));
	elseif (t_3 <= Inf)
		tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l_m * Float64(l_m / Om)))) + t_1)));
	else
		tmp = abs(Float64(Float64(n * sqrt(2.0)) * Float64(Float64(l_m / Om) * sqrt(Float64(U * Float64(U_42_ - U))))));
	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 = (2.0 * n) * U;
	t_3 = sqrt((t_2 * ((t - (2.0 * ((l_m * l_m) / Om))) + t_1)));
	tmp = 0.0;
	if (t_3 <= 0.0)
		tmp = sqrt((n * (t + (-2.0 * ((l_m ^ 2.0) / Om))))) * sqrt((2.0 * U));
	elseif (t_3 <= Inf)
		tmp = sqrt((t_2 * ((t - (2.0 * (l_m * (l_m / Om)))) + t_1)));
	else
		tmp = abs(((n * sqrt(2.0)) * ((l_m / Om) * sqrt((U * (U_42_ - U))))));
	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[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(n * N[(t + N[(-2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(n * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m / Om), $MachinePrecision] * N[Sqrt[N[(U * N[(U$42$ - U), $MachinePrecision]), $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(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{l_m \cdot l_m}{Om}\right) + t_1\right)}\\
\mathbf{if}\;t_3 \leq 0:\\
\;\;\;\;\sqrt{n \cdot \left(t + -2 \cdot \frac{{l_m}^{2}}{Om}\right)} \cdot \sqrt{2 \cdot U}\\

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

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


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

    1. Initial program 13.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. Simplified52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/76.4%

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

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

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

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in n around inf 24.3%

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\ell \cdot \left(n \cdot \sqrt{2}\right)}{Om}\right)\right)} \cdot \sqrt{U \cdot \left(U* - U\right)} \]
      2. expm1-udef20.1%

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

        \[\leadsto \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}}\right)} - 1\right) \cdot \sqrt{U \cdot \left(U* - U\right)} \]
    6. Applied egg-rr20.6%

      \[\leadsto \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}\right)} - 1\right)} \cdot \sqrt{U \cdot \left(U* - U\right)} \]
    7. Step-by-step derivation
      1. expm1-def24.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\ell}{\frac{Om}{n \cdot \sqrt{2}}}\right)\right)} \cdot \sqrt{U \cdot \left(U* - U\right)} \]
      2. expm1-log1p24.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 17.0%

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

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

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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/76.1%

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 6: 52.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -5.2 \cdot 10^{+135} \lor \neg \left(U \leq 7 \cdot 10^{-27}\right):\\
\;\;\;\;{\left(2 \cdot \left(\left(t + -2 \cdot \frac{{l_m}^{2}}{Om}\right) \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -5.2e135 or 7.0000000000000003e-27 < U

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

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

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

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

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

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

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

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

    if -5.2e135 < U < 7.0000000000000003e-27

    1. Initial program 50.3%

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

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

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

Alternative 7: 52.7% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := n \cdot \left({\left(\frac{l_m}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;n \leq -2.1 \cdot 10^{-133}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - \frac{2 \cdot \left(l_m \cdot l_m\right)}{Om}\right) + t_1\right)\right)}\\ \mathbf{elif}\;n \leq 5.1 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {l_m}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t_1 - \left(2 \cdot \left(l_m \cdot \frac{l_m}{Om}\right) - t\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* n (* (pow (/ l_m Om) 2.0) (- U* U)))))
   (if (<= n -2.1e-133)
     (sqrt (* (* 2.0 n) (* U (+ (- t (/ (* 2.0 (* l_m l_m)) Om)) t_1))))
     (if (<= n 5.1e-247)
       (sqrt
        (+ (* -4.0 (/ (* U (* n (pow l_m 2.0))) Om)) (* 2.0 (* U (* n t)))))
       (sqrt (* (* (* 2.0 n) U) (- t_1 (- (* 2.0 (* l_m (/ l_m Om))) t))))))))
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 tmp;
	if (n <= -2.1e-133) {
		tmp = sqrt(((2.0 * n) * (U * ((t - ((2.0 * (l_m * l_m)) / Om)) + t_1))));
	} else if (n <= 5.1e-247) {
		tmp = sqrt(((-4.0 * ((U * (n * pow(l_m, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
	} else {
		tmp = sqrt((((2.0 * n) * U) * (t_1 - ((2.0 * (l_m * (l_m / Om))) - t))));
	}
	return tmp;
}
l_m = abs(l)
real(8) function code(n, u, t, l_m, om, u_42)
    real(8), intent (in) :: n
    real(8), intent (in) :: u
    real(8), intent (in) :: t
    real(8), intent (in) :: l_m
    real(8), intent (in) :: om
    real(8), intent (in) :: u_42
    real(8) :: t_1
    real(8) :: tmp
    t_1 = n * (((l_m / om) ** 2.0d0) * (u_42 - u))
    if (n <= (-2.1d-133)) then
        tmp = sqrt(((2.0d0 * n) * (u * ((t - ((2.0d0 * (l_m * l_m)) / om)) + t_1))))
    else if (n <= 5.1d-247) then
        tmp = sqrt((((-4.0d0) * ((u * (n * (l_m ** 2.0d0))) / om)) + (2.0d0 * (u * (n * t)))))
    else
        tmp = sqrt((((2.0d0 * n) * u) * (t_1 - ((2.0d0 * (l_m * (l_m / om))) - t))))
    end if
    code = tmp
end function
l_m = Math.abs(l);
public static double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = n * (Math.pow((l_m / Om), 2.0) * (U_42_ - U));
	double tmp;
	if (n <= -2.1e-133) {
		tmp = Math.sqrt(((2.0 * n) * (U * ((t - ((2.0 * (l_m * l_m)) / Om)) + t_1))));
	} else if (n <= 5.1e-247) {
		tmp = Math.sqrt(((-4.0 * ((U * (n * Math.pow(l_m, 2.0))) / Om)) + (2.0 * (U * (n * t)))));
	} else {
		tmp = Math.sqrt((((2.0 * n) * U) * (t_1 - ((2.0 * (l_m * (l_m / Om))) - t))));
	}
	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))
	tmp = 0
	if n <= -2.1e-133:
		tmp = math.sqrt(((2.0 * n) * (U * ((t - ((2.0 * (l_m * l_m)) / Om)) + t_1))))
	elif n <= 5.1e-247:
		tmp = math.sqrt(((-4.0 * ((U * (n * math.pow(l_m, 2.0))) / Om)) + (2.0 * (U * (n * t)))))
	else:
		tmp = math.sqrt((((2.0 * n) * U) * (t_1 - ((2.0 * (l_m * (l_m / Om))) - t))))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(n * Float64((Float64(l_m / Om) ^ 2.0) * Float64(U_42_ - U)))
	tmp = 0.0
	if (n <= -2.1e-133)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(t - Float64(Float64(2.0 * Float64(l_m * l_m)) / Om)) + t_1))));
	elseif (n <= 5.1e-247)
		tmp = sqrt(Float64(Float64(-4.0 * Float64(Float64(U * Float64(n * (l_m ^ 2.0))) / Om)) + Float64(2.0 * Float64(U * Float64(n * t)))));
	else
		tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(t_1 - Float64(Float64(2.0 * Float64(l_m * Float64(l_m / Om))) - t))));
	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));
	tmp = 0.0;
	if (n <= -2.1e-133)
		tmp = sqrt(((2.0 * n) * (U * ((t - ((2.0 * (l_m * l_m)) / Om)) + t_1))));
	elseif (n <= 5.1e-247)
		tmp = sqrt(((-4.0 * ((U * (n * (l_m ^ 2.0))) / Om)) + (2.0 * (U * (n * t)))));
	else
		tmp = sqrt((((2.0 * n) * U) * (t_1 - ((2.0 * (l_m * (l_m / Om))) - t))));
	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] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[n, -2.1e-133], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(t - N[(N[(2.0 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 5.1e-247], N[Sqrt[N[(N[(-4.0 * N[(N[(U * N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t$95$1 - N[(N[(2.0 * N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := n \cdot \left({\left(\frac{l_m}{Om}\right)}^{2} \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;n \leq -2.1 \cdot 10^{-133}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(t - \frac{2 \cdot \left(l_m \cdot l_m\right)}{Om}\right) + t_1\right)\right)}\\

\mathbf{elif}\;n \leq 5.1 \cdot 10^{-247}:\\
\;\;\;\;\sqrt{-4 \cdot \frac{U \cdot \left(n \cdot {l_m}^{2}\right)}{Om} + 2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -2.1000000000000001e-133

    1. Initial program 57.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. Simplified61.5%

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

    if -2.1000000000000001e-133 < n < 5.1000000000000002e-247

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

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

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

    if 5.1000000000000002e-247 < n

    1. Initial program 59.6%

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

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

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

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \left(\frac{\ell}{Om} \cdot \ell\right)\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U - U*\right)\right)}\right)} - 1\right)\right)} \]
    6. Applied egg-rr50.9%

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

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

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

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

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

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

Alternative 8: 39.3% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\ \mathbf{if}\;l_m \leq 2.25 \cdot 10^{+53}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;l_m \leq 1.65 \cdot 10^{+90}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(n \cdot \frac{{l_m}^{2}}{Om}\right)\right)\right)}\\ \mathbf{elif}\;l_m \leq 8.5 \cdot 10^{+141}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(-2 \cdot \frac{U \cdot \left(n \cdot {l_m}^{2}\right)}{Om}\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 (fabs (* n (* U t)))))))
   (if (<= l_m 2.25e+53)
     t_1
     (if (<= l_m 1.65e+90)
       (sqrt (* 2.0 (* U (* -2.0 (* n (/ (pow l_m 2.0) Om))))))
       (if (<= l_m 8.5e+141)
         t_1
         (sqrt (* 2.0 (* -2.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 t_1 = sqrt((2.0 * fabs((n * (U * t)))));
	double tmp;
	if (l_m <= 2.25e+53) {
		tmp = t_1;
	} else if (l_m <= 1.65e+90) {
		tmp = sqrt((2.0 * (U * (-2.0 * (n * (pow(l_m, 2.0) / Om))))));
	} else if (l_m <= 8.5e+141) {
		tmp = t_1;
	} else {
		tmp = sqrt((2.0 * (-2.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) :: t_1
    real(8) :: tmp
    t_1 = sqrt((2.0d0 * abs((n * (u * t)))))
    if (l_m <= 2.25d+53) then
        tmp = t_1
    else if (l_m <= 1.65d+90) then
        tmp = sqrt((2.0d0 * (u * ((-2.0d0) * (n * ((l_m ** 2.0d0) / om))))))
    else if (l_m <= 8.5d+141) then
        tmp = t_1
    else
        tmp = sqrt((2.0d0 * ((-2.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 t_1 = Math.sqrt((2.0 * Math.abs((n * (U * t)))));
	double tmp;
	if (l_m <= 2.25e+53) {
		tmp = t_1;
	} else if (l_m <= 1.65e+90) {
		tmp = Math.sqrt((2.0 * (U * (-2.0 * (n * (Math.pow(l_m, 2.0) / Om))))));
	} else if (l_m <= 8.5e+141) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt((2.0 * (-2.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_):
	t_1 = math.sqrt((2.0 * math.fabs((n * (U * t)))))
	tmp = 0
	if l_m <= 2.25e+53:
		tmp = t_1
	elif l_m <= 1.65e+90:
		tmp = math.sqrt((2.0 * (U * (-2.0 * (n * (math.pow(l_m, 2.0) / Om))))))
	elif l_m <= 8.5e+141:
		tmp = t_1
	else:
		tmp = math.sqrt((2.0 * (-2.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_)
	t_1 = sqrt(Float64(2.0 * abs(Float64(n * Float64(U * t)))))
	tmp = 0.0
	if (l_m <= 2.25e+53)
		tmp = t_1;
	elseif (l_m <= 1.65e+90)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(-2.0 * Float64(n * Float64((l_m ^ 2.0) / Om))))));
	elseif (l_m <= 8.5e+141)
		tmp = t_1;
	else
		tmp = sqrt(Float64(2.0 * Float64(-2.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_)
	t_1 = sqrt((2.0 * abs((n * (U * t)))));
	tmp = 0.0;
	if (l_m <= 2.25e+53)
		tmp = t_1;
	elseif (l_m <= 1.65e+90)
		tmp = sqrt((2.0 * (U * (-2.0 * (n * ((l_m ^ 2.0) / Om))))));
	elseif (l_m <= 8.5e+141)
		tmp = t_1;
	else
		tmp = sqrt((2.0 * (-2.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$_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * N[Abs[N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l$95$m, 2.25e+53], t$95$1, If[LessEqual[l$95$m, 1.65e+90], N[Sqrt[N[(2.0 * N[(U * N[(-2.0 * N[(n * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 8.5e+141], t$95$1, N[Sqrt[N[(2.0 * N[(-2.0 * N[(N[(U * N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\
\mathbf{if}\;l_m \leq 2.25 \cdot 10^{+53}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;l_m \leq 1.65 \cdot 10^{+90}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(n \cdot \frac{{l_m}^{2}}{Om}\right)\right)\right)}\\

\mathbf{elif}\;l_m \leq 8.5 \cdot 10^{+141}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.2500000000000001e53 or 1.65000000000000004e90 < l < 8.4999999999999996e141

    1. Initial program 57.6%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 44.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.2500000000000001e53 < l < 1.65000000000000004e90

    1. Initial program 72.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. Simplified31.2%

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

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

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

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

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

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

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

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

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

    if 8.4999999999999996e141 < l

    1. Initial program 34.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.25 \cdot 10^{+53}:\\ \;\;\;\;\sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\ \mathbf{elif}\;\ell \leq 1.65 \cdot 10^{+90}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(n \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\ \mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+141}:\\ \;\;\;\;\sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(-2 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 39.9% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\ \mathbf{if}\;l_m \leq 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;l_m \leq 6.5 \cdot 10^{+89}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(n \cdot \frac{{l_m}^{2}}{Om}\right)\right)\right)}\\ \mathbf{elif}\;l_m \leq 1.45 \cdot 10^{+124}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \frac{n \cdot {l_m}^{2}}{Om}\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (sqrt (* 2.0 (fabs (* n (* U t)))))))
   (if (<= l_m 1e+52)
     t_1
     (if (<= l_m 6.5e+89)
       (sqrt (* 2.0 (* U (* -2.0 (* n (/ (pow l_m 2.0) Om))))))
       (if (<= l_m 1.45e+124)
         t_1
         (sqrt (* 2.0 (* U (* -2.0 (/ (* 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 t_1 = sqrt((2.0 * fabs((n * (U * t)))));
	double tmp;
	if (l_m <= 1e+52) {
		tmp = t_1;
	} else if (l_m <= 6.5e+89) {
		tmp = sqrt((2.0 * (U * (-2.0 * (n * (pow(l_m, 2.0) / Om))))));
	} else if (l_m <= 1.45e+124) {
		tmp = t_1;
	} else {
		tmp = sqrt((2.0 * (U * (-2.0 * ((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) :: t_1
    real(8) :: tmp
    t_1 = sqrt((2.0d0 * abs((n * (u * t)))))
    if (l_m <= 1d+52) then
        tmp = t_1
    else if (l_m <= 6.5d+89) then
        tmp = sqrt((2.0d0 * (u * ((-2.0d0) * (n * ((l_m ** 2.0d0) / om))))))
    else if (l_m <= 1.45d+124) then
        tmp = t_1
    else
        tmp = sqrt((2.0d0 * (u * ((-2.0d0) * ((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 t_1 = Math.sqrt((2.0 * Math.abs((n * (U * t)))));
	double tmp;
	if (l_m <= 1e+52) {
		tmp = t_1;
	} else if (l_m <= 6.5e+89) {
		tmp = Math.sqrt((2.0 * (U * (-2.0 * (n * (Math.pow(l_m, 2.0) / Om))))));
	} else if (l_m <= 1.45e+124) {
		tmp = t_1;
	} else {
		tmp = Math.sqrt((2.0 * (U * (-2.0 * ((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_):
	t_1 = math.sqrt((2.0 * math.fabs((n * (U * t)))))
	tmp = 0
	if l_m <= 1e+52:
		tmp = t_1
	elif l_m <= 6.5e+89:
		tmp = math.sqrt((2.0 * (U * (-2.0 * (n * (math.pow(l_m, 2.0) / Om))))))
	elif l_m <= 1.45e+124:
		tmp = t_1
	else:
		tmp = math.sqrt((2.0 * (U * (-2.0 * ((n * math.pow(l_m, 2.0)) / Om)))))
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = sqrt(Float64(2.0 * abs(Float64(n * Float64(U * t)))))
	tmp = 0.0
	if (l_m <= 1e+52)
		tmp = t_1;
	elseif (l_m <= 6.5e+89)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(-2.0 * Float64(n * Float64((l_m ^ 2.0) / Om))))));
	elseif (l_m <= 1.45e+124)
		tmp = t_1;
	else
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(-2.0 * Float64(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_)
	t_1 = sqrt((2.0 * abs((n * (U * t)))));
	tmp = 0.0;
	if (l_m <= 1e+52)
		tmp = t_1;
	elseif (l_m <= 6.5e+89)
		tmp = sqrt((2.0 * (U * (-2.0 * (n * ((l_m ^ 2.0) / Om))))));
	elseif (l_m <= 1.45e+124)
		tmp = t_1;
	else
		tmp = sqrt((2.0 * (U * (-2.0 * ((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$_] := Block[{t$95$1 = N[Sqrt[N[(2.0 * N[Abs[N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l$95$m, 1e+52], t$95$1, If[LessEqual[l$95$m, 6.5e+89], N[Sqrt[N[(2.0 * N[(U * N[(-2.0 * N[(n * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1.45e+124], t$95$1, N[Sqrt[N[(2.0 * N[(U * N[(-2.0 * N[(N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := \sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\
\mathbf{if}\;l_m \leq 10^{+52}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;l_m \leq 6.5 \cdot 10^{+89}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(-2 \cdot \left(n \cdot \frac{{l_m}^{2}}{Om}\right)\right)\right)}\\

\mathbf{elif}\;l_m \leq 1.45 \cdot 10^{+124}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 9.9999999999999999e51 or 6.4999999999999996e89 < l < 1.45000000000000011e124

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999999e51 < l < 6.4999999999999996e89

    1. Initial program 72.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. Simplified31.2%

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

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

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

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

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

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

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

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

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

    if 1.45000000000000011e124 < l

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

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

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

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

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

Alternative 10: 39.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;U \leq 1.6 \cdot 10^{-131} \lor \neg \left(U \leq 9 \cdot 10^{+103}\right):\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < 1.79999999999999999e-261

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 40.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.79999999999999999e-261 < U < 1.6e-131 or 9.00000000000000002e103 < U

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 40.9%

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

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

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

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

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

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

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

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

    if 1.6e-131 < U < 9.00000000000000002e103

    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq 1.8 \cdot 10^{-261}:\\ \;\;\;\;\sqrt{2 \cdot \left|n \cdot \left(U \cdot t\right)\right|}\\ \mathbf{elif}\;U \leq 1.6 \cdot 10^{-131} \lor \neg \left(U \leq 9 \cdot 10^{+103}\right):\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left|U \cdot \left(n \cdot \left(2 \cdot t\right)\right)\right|}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 48.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;l_m \leq 1.6 \cdot 10^{-149}:\\
\;\;\;\;\sqrt{\left|U \cdot \left(n \cdot \left(2 \cdot t\right)\right)\right|}\\

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


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

    1. Initial program 57.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.60000000000000001e-149 < l

    1. Initial program 53.6%

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

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

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

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

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

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

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

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

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

Alternative 12: 44.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{{l_m}^{2}}{Om}\\
\mathbf{if}\;Om \leq -1.06 \cdot 10^{+87}:\\
\;\;\;\;\sqrt{2 \cdot \left(\left(t + -2 \cdot t_1\right) \cdot \left(n \cdot U\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -1.0600000000000001e87

    1. Initial program 62.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. Simplified68.6%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in n around 0 61.0%

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

    if -1.0600000000000001e87 < Om

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

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

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

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

Alternative 13: 39.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;n \leq 9 \cdot 10^{+175}:\\
\;\;\;\;\sqrt{n} \cdot \sqrt{U \cdot \left(2 \cdot t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < 9.20000000000000011e-263

    1. Initial program 53.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/53.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.20000000000000011e-263 < n < 8.99999999999999979e175

    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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999979e175 < n

    1. Initial program 73.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. Simplified77.2%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 39.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 58.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. Simplified58.5%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999996e141 < l

    1. Initial program 34.6%

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

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

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

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

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

Alternative 15: 44.5% accurate, 1.1× speedup?

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

\\
\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{l_m}^{2}}{Om}\right)\right)\right)}
\end{array}
Derivation
  1. Initial program 55.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. Simplified61.7%

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

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

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

Alternative 16: 37.5% accurate, 1.1× speedup?

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

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

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


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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 40.3%

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000013e-228 < U

    1. Initial program 58.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 38.0% accurate, 1.1× speedup?

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

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

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


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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 40.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999956e-227 < U

    1. Initial program 58.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 35.8% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -4.79999999999999993e85

    1. Initial program 62.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. Simplified68.6%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 46.4%

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

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

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

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

    if -4.79999999999999993e85 < Om

    1. Initial program 53.5%

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 38.7%

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

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

Alternative 19: 35.8% accurate, 2.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -8.8000000000000007e85

    1. Initial program 62.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. Simplified68.6%

      \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
    3. Add Preprocessing
    4. Taylor expanded in l around 0 46.4%

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

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

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

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

    if -8.8000000000000007e85 < Om

    1. Initial program 53.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/55.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 35.8% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 52.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/56.4%

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

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

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

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

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

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

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

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

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

    if 4.1999999999999998e-134 < U

    1. Initial program 62.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l/64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 21: 36.4% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ {\left(2 \cdot \left(n \cdot \left(U \cdot t\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 (* n (* U t))) 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 * (n * (U * t))), 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 * (n * (u * t))) ** 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 * (n * (U * t))), 0.5);
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	return math.pow((2.0 * (n * (U * t))), 0.5)
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	return Float64(2.0 * Float64(n * Float64(U * t))) ^ 0.5
end
l_m = abs(l);
function tmp = code(n, U, t, l_m, Om, U_42_)
	tmp = (2.0 * (n * (U * t))) ^ 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[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
  3. Add Preprocessing
  4. Taylor expanded in l around 0 40.7%

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

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

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

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

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

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

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

Alternative 22: 36.4% accurate, 2.1× speedup?

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

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

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
  3. Add Preprocessing
  4. Taylor expanded in l around 0 40.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 23: 35.8% 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 55.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. Simplified58.4%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(\left(n \cdot U\right) \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)}} \]
  3. Add Preprocessing
  4. Taylor expanded in l around 0 40.7%

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

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

Reproduce

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