Toniolo and Linder, Equation (13)

Percentage Accurate: 49.6% → 62.7%
Time: 22.7s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 49.6% 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: 62.7% accurate, 0.4× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 98.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. Simplified98.4%

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

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

    1. Initial program 19.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. Simplified29.2%

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 17.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. Simplified45.0%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 54.9% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;n \leq 1.35 \cdot 10^{-97}:\\
\;\;\;\;\sqrt{U \cdot \left(t - t\_1\right)} \cdot \sqrt{2 \cdot n}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if n < -1.74999999999999989e29 or 1.34999999999999993e-97 < n

    1. Initial program 56.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. Simplified62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.74999999999999989e29 < n < -1.999999999999994e-310

    1. Initial program 40.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. Simplified47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < n < 1.34999999999999993e-97

    1. Initial program 43.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. Simplified51.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 54.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -8.2 \cdot 10^{+113} \lor \neg \left(Om \leq 4.7 \cdot 10^{+68}\right):\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(n \cdot \left({\left(\frac{l\_m}{Om}\right)}^{2} \cdot U*\right) - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -8.19999999999999985e113 or 4.6999999999999996e68 < Om

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.19999999999999985e113 < Om < 4.6999999999999996e68

    1. Initial program 44.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. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 51.9% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;l\_m \leq 3.2 \cdot 10^{-197}:\\ \;\;\;\;\sqrt{\left|2 \cdot \left(n \cdot \left(U \cdot t\right)\right)\right|}\\ \mathbf{elif}\;l\_m \leq 4.6 \cdot 10^{+213}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left({\left(\frac{l\_m}{Om}\right)}^{2} \cdot \left(n \cdot U*\right) - \frac{l\_m}{Om} \cdot \left(2 \cdot l\_m\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\left(U \cdot -4\right) \cdot \frac{n \cdot {l\_m}^{2}}{Om}\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 3.2e-197)
   (sqrt (fabs (* 2.0 (* n (* U t)))))
   (if (<= l_m 4.6e+213)
     (sqrt
      (*
       (* 2.0 (* n U))
       (+ t (- (* (pow (/ l_m Om) 2.0) (* n U*)) (* (/ l_m Om) (* 2.0 l_m))))))
     (pow (* (* U -4.0) (/ (* n (pow l_m 2.0)) Om)) 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 <= 3.2e-197) {
		tmp = sqrt(fabs((2.0 * (n * (U * t)))));
	} else if (l_m <= 4.6e+213) {
		tmp = sqrt(((2.0 * (n * U)) * (t + ((pow((l_m / Om), 2.0) * (n * U_42_)) - ((l_m / Om) * (2.0 * l_m))))));
	} else {
		tmp = pow(((U * -4.0) * ((n * pow(l_m, 2.0)) / Om)), 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 <= 3.2d-197) then
        tmp = sqrt(abs((2.0d0 * (n * (u * t)))))
    else if (l_m <= 4.6d+213) then
        tmp = sqrt(((2.0d0 * (n * u)) * (t + ((((l_m / om) ** 2.0d0) * (n * u_42)) - ((l_m / om) * (2.0d0 * l_m))))))
    else
        tmp = ((u * (-4.0d0)) * ((n * (l_m ** 2.0d0)) / om)) ** 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 <= 3.2e-197) {
		tmp = Math.sqrt(Math.abs((2.0 * (n * (U * t)))));
	} else if (l_m <= 4.6e+213) {
		tmp = Math.sqrt(((2.0 * (n * U)) * (t + ((Math.pow((l_m / Om), 2.0) * (n * U_42_)) - ((l_m / Om) * (2.0 * l_m))))));
	} else {
		tmp = Math.pow(((U * -4.0) * ((n * Math.pow(l_m, 2.0)) / Om)), 0.5);
	}
	return tmp;
}
l_m = math.fabs(l)
def code(n, U, t, l_m, Om, U_42_):
	tmp = 0
	if l_m <= 3.2e-197:
		tmp = math.sqrt(math.fabs((2.0 * (n * (U * t)))))
	elif l_m <= 4.6e+213:
		tmp = math.sqrt(((2.0 * (n * U)) * (t + ((math.pow((l_m / Om), 2.0) * (n * U_42_)) - ((l_m / Om) * (2.0 * l_m))))))
	else:
		tmp = math.pow(((U * -4.0) * ((n * math.pow(l_m, 2.0)) / Om)), 0.5)
	return tmp
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	tmp = 0.0
	if (l_m <= 3.2e-197)
		tmp = sqrt(abs(Float64(2.0 * Float64(n * Float64(U * t)))));
	elseif (l_m <= 4.6e+213)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(Float64((Float64(l_m / Om) ^ 2.0) * Float64(n * U_42_)) - Float64(Float64(l_m / Om) * Float64(2.0 * l_m))))));
	else
		tmp = Float64(Float64(U * -4.0) * Float64(Float64(n * (l_m ^ 2.0)) / Om)) ^ 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 <= 3.2e-197)
		tmp = sqrt(abs((2.0 * (n * (U * t)))));
	elseif (l_m <= 4.6e+213)
		tmp = sqrt(((2.0 * (n * U)) * (t + ((((l_m / Om) ^ 2.0) * (n * U_42_)) - ((l_m / Om) * (2.0 * l_m))))));
	else
		tmp = ((U * -4.0) * ((n * (l_m ^ 2.0)) / Om)) ^ 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, 3.2e-197], N[Sqrt[N[Abs[N[(2.0 * N[(n * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 4.6e+213], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(N[(N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision] * N[(n * U$42$), $MachinePrecision]), $MachinePrecision] - N[(N[(l$95$m / Om), $MachinePrecision] * N[(2.0 * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(N[(U * -4.0), $MachinePrecision] * N[(N[(n * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 3.1999999999999997e-197

    1. Initial program 48.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. Simplified54.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999997e-197 < l < 4.59999999999999996e213

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999996e213 < l

    1. Initial program 6.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. Simplified12.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(U \cdot -4\right) \cdot \frac{\color{blue}{n \cdot {\ell}^{2}}}{Om}\right)}^{0.5} \]
    11. Applied egg-rr26.5%

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

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

Alternative 6: 52.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.999999999999994e-310

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < n

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 46.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 54.2%

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

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

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

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

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

    if 2.1000000000000001e105 < l

    1. Initial program 20.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. Simplified32.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 42.5% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

    if 2e113 < l

    1. Initial program 17.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 42.2% accurate, 1.9× speedup?

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

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

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


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

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

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

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

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

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

    if 2.45000000000000011e113 < l

    1. Initial program 17.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.8% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;l\_m \leq 1.26 \cdot 10^{+113}:\\
\;\;\;\;\sqrt{\frac{\left(U \cdot -4\right) \cdot \left(n \cdot \left(l\_m \cdot l\_m\right)\right)}{Om}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.7000000000000001e42

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

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

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

    if 2.7000000000000001e42 < l < 1.2599999999999999e113

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2599999999999999e113 < l

    1. Initial program 17.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 39.4% accurate, 1.9× speedup?

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

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

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


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

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

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

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

    if 5.39999999999999992e38 < l

    1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 35.1% accurate, 2.1× speedup?

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

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

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

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

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

Alternative 13: 35.5% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\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(Float64(2.0 * 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[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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

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

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

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

Reproduce

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