Toniolo and Linder, Equation (13)

Percentage Accurate: 49.2% → 64.0%
Time: 30.5s
Alternatives: 14
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 14 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.2% accurate, 1.0× speedup?

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

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

Alternative 1: 64.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 1.99999999999999996e150

    1. Initial program 97.9%

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

    if 1.99999999999999996e150 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 64.3% accurate, 0.3× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.8%

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 64.9% accurate, 0.3× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 66.8%

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

Alternative 4: 62.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 9.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. Simplified9.2%

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

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

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

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

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

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

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

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

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 1.99999999999999996e150

    1. Initial program 97.9%

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

    if 1.99999999999999996e150 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*))))) < 1.99999999999999996e150

    1. Initial program 97.9%

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

    if 1.99999999999999996e150 < (sqrt.f64 (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 50.1% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;U \leq -1 \cdot 10^{-312} \lor \neg \left(U \leq 2 \cdot 10^{-147}\right) \land U \leq 8.5 \cdot 10^{+178}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(n \cdot \left({\left(\frac{l\_m}{Om}\right)}^{2} \cdot \left(U* - U\right)\right) - \left(\frac{2 \cdot \left(l\_m \cdot l\_m\right)}{Om} - t\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


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

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

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

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

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

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

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

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

    if -4.99999999999999968e-50 < U < -9.9999999999847e-313 or 1.9999999999999999e-147 < U < 8.49999999999999991e178

    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. Simplified52.0%

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

    if -9.9999999999847e-313 < U < 1.9999999999999999e-147 or 8.49999999999999991e178 < U

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -5 \cdot 10^{-50}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \mathbf{elif}\;U \leq -1 \cdot 10^{-312} \lor \neg \left(U \leq 2 \cdot 10^{-147}\right) \land U \leq 8.5 \cdot 10^{+178}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(n \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(U* - U\right)\right) - \left(\frac{2 \cdot \left(\ell \cdot \ell\right)}{Om} - t\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 52.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -1 \cdot 10^{-312} \lor \neg \left(U \leq 4.5 \cdot 10^{-150}\right) \land U \leq 5.8 \cdot 10^{+210}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right) + \left(n \cdot {\left(\frac{l\_m}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -9.9999999999847e-313 or 4.5000000000000002e-150 < U < 5.79999999999999984e210

    1. Initial program 48.8%

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

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

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

    if -9.9999999999847e-313 < U < 4.5000000000000002e-150 or 5.79999999999999984e210 < U

    1. Initial program 37.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. Simplified39.4%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 52.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;Om \leq 5.5 \cdot 10^{-123}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;Om \leq 11500000000000:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Om < -4.5000000000000001e-97 or 1.15e13 < Om

    1. Initial program 49.8%

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

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

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

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

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

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

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

    if -4.5000000000000001e-97 < Om < 5.5e-123 or 1.20000000000000007e-76 < Om < 1.15e13

    1. Initial program 37.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. Simplified36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5e-123 < Om < 1.20000000000000007e-76

    1. Initial program 55.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Om \leq -4.5 \cdot 10^{-97}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \mathbf{elif}\;Om \leq 5.5 \cdot 10^{-123}:\\ \;\;\;\;\left|\frac{n \cdot \ell}{\frac{Om}{\sqrt{\left(U* - U\right) \cdot \left(2 \cdot U\right)}}}\right|\\ \mathbf{elif}\;Om \leq 1.2 \cdot 10^{-76}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)\right)}\\ \mathbf{elif}\;Om \leq 11500000000000:\\ \;\;\;\;\left|\frac{n \cdot \ell}{\frac{Om}{\sqrt{\left(U* - U\right) \cdot \left(2 \cdot U\right)}}}\right|\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 50.1% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;U \leq 4.5 \cdot 10^{-148} \lor \neg \left(U \leq 1.35 \cdot 10^{+160}\right):\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if U < -1.80000000000000007e64 or 4.50000000000000015e-148 < U < 1.35e160

    1. Initial program 59.8%

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

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

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

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

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

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

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

    if -1.80000000000000007e64 < U < 1.000000000000002e-309

    1. Initial program 37.1%

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

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

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

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

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

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

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

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

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

    if 1.000000000000002e-309 < U < 4.50000000000000015e-148 or 1.35e160 < U

    1. Initial program 41.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -1.8 \cdot 10^{+64}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \mathbf{elif}\;U \leq 10^{-309}:\\ \;\;\;\;{\left(\left(2 \cdot n\right) \cdot \left(U \cdot \left(t + \frac{{\ell}^{2}}{Om} \cdot -2\right)\right)\right)}^{0.5}\\ \mathbf{elif}\;U \leq 4.5 \cdot 10^{-148} \lor \neg \left(U \leq 1.35 \cdot 10^{+160}\right):\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 52.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Om \leq -1.35 \cdot 10^{-95} \lor \neg \left(Om \leq 10000000000000\right):\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Om < -1.35e-95 or 1e13 < Om

    1. Initial program 49.8%

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

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

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

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

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

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

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

    if -1.35e-95 < Om < 1e13

    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. Simplified39.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 47.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;U \leq -1 \cdot 10^{-312} \lor \neg \left(U \leq 2.3 \cdot 10^{-148}\right) \land U \leq 1.3 \cdot 10^{+160}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < -9.9999999999847e-313 or 2.29999999999999997e-148 < U < 1.3e160

    1. Initial program 48.1%

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

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

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

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

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

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

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

    if -9.9999999999847e-313 < U < 2.29999999999999997e-148 or 1.3e160 < U

    1. Initial program 41.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -1 \cdot 10^{-312} \lor \neg \left(U \leq 2.3 \cdot 10^{-148}\right) \land U \leq 1.3 \cdot 10^{+160}:\\ \;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot U} \cdot \sqrt{n \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 47.0% accurate, 2.0× speedup?

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

\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \left(l\_m \cdot \frac{l\_m}{Om}\right)\right)}
\end{array}
Derivation
  1. Initial program 46.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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-*l/51.0%

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

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

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

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

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

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

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

Alternative 13: 37.8% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

Alternative 14: 35.6% accurate, 2.1× speedup?

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

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

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

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

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

Reproduce

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