Toniolo and Linder, Equation (13)

Percentage Accurate: 49.4% → 65.2%
Time: 27.2s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 49.4% accurate, 1.0× speedup?

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

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

Alternative 1: 65.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\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 2 \cdot 10^{-311}:\\
\;\;\;\;\sqrt{2 \cdot \left|n \cdot U\right|} \cdot \sqrt{\left|t\right|}\\

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

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


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

    1. Initial program 15.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. Taylor expanded in n around 0 17.7%

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

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

        \[\leadsto \sqrt{\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}} \cdot \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)}} \]
      3. pow1/217.9%

        \[\leadsto \sqrt{{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}^{0.5} \cdot \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}}} \]
      4. pow-prod-down15.2%

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

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

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

        \[\leadsto \sqrt{{\left({\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)}^{2}\right)}^{0.5}} \]
      8. metadata-eval12.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\left|2 \cdot \left(n \cdot U\right)\right|\right)}^{0.5} \cdot {\left(\left|\color{blue}{\mathsf{fma}\left({\ell}^{2}, \frac{-2}{Om}, t\right)}\right|\right)}^{0.5} \]
    9. Applied egg-rr44.3%

      \[\leadsto \color{blue}{{\left(\left|2 \cdot \left(n \cdot U\right)\right|\right)}^{0.5} \cdot {\left(\left|\mathsf{fma}\left({\ell}^{2}, \frac{-2}{Om}, t\right)\right|\right)}^{0.5}} \]
    10. Step-by-step derivation
      1. unpow1/244.3%

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

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

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

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

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

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

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

    if 1.9999999999999e-311 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.9999999999999999e305

    1. Initial program 97.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 63.0% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 14.3%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around 0 14.3%

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

        \[\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*31.2%

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

        \[\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/233.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 64.5% accurate, 0.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := l\_m \cdot \frac{l\_m}{Om}\\ t_2 := {\left(\frac{l\_m}{Om}\right)}^{2}\\ t_3 := n \cdot t\_2\\ t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_3 \cdot \left(U* - U\right)\right)\\ \mathbf{if}\;t\_4 \leq 5 \cdot 10^{-156}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, t\_1, n \cdot \left(t\_2 \cdot \left(U - U*\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+305}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_3 \cdot \left(U - U*\right) + 2 \cdot t\_1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(n \cdot U\right) \cdot \left(U* \cdot \frac{n}{{Om}^{2}} - \frac{2}{Om}\right)} \cdot \left(l\_m \cdot \sqrt{2}\right)\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*)
 :precision binary64
 (let* ((t_1 (* l_m (/ l_m Om)))
        (t_2 (pow (/ l_m Om) 2.0))
        (t_3 (* n t_2))
        (t_4
         (*
          (* (* 2.0 n) U)
          (+ (- t (* 2.0 (/ (* l_m l_m) Om))) (* t_3 (- U* U))))))
   (if (<= t_4 5e-156)
     (sqrt (* (* 2.0 n) (* U (- t (fma 2.0 t_1 (* n (* t_2 (- U U*))))))))
     (if (<= t_4 2e+305)
       (sqrt (* (* 2.0 (* n U)) (- t (+ (* t_3 (- U U*)) (* 2.0 t_1)))))
       (*
        (sqrt (* (* n U) (- (* U* (/ n (pow Om 2.0))) (/ 2.0 Om))))
        (* l_m (sqrt 2.0)))))))
l_m = fabs(l);
double code(double n, double U, double t, double l_m, double Om, double U_42_) {
	double t_1 = l_m * (l_m / Om);
	double t_2 = pow((l_m / Om), 2.0);
	double t_3 = n * t_2;
	double t_4 = ((2.0 * n) * U) * ((t - (2.0 * ((l_m * l_m) / Om))) + (t_3 * (U_42_ - U)));
	double tmp;
	if (t_4 <= 5e-156) {
		tmp = sqrt(((2.0 * n) * (U * (t - fma(2.0, t_1, (n * (t_2 * (U - U_42_))))))));
	} else if (t_4 <= 2e+305) {
		tmp = sqrt(((2.0 * (n * U)) * (t - ((t_3 * (U - U_42_)) + (2.0 * t_1)))));
	} else {
		tmp = sqrt(((n * U) * ((U_42_ * (n / pow(Om, 2.0))) - (2.0 / Om)))) * (l_m * sqrt(2.0));
	}
	return tmp;
}
l_m = abs(l)
function code(n, U, t, l_m, Om, U_42_)
	t_1 = Float64(l_m * Float64(l_m / Om))
	t_2 = Float64(l_m / Om) ^ 2.0
	t_3 = Float64(n * t_2)
	t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l_m * l_m) / Om))) + Float64(t_3 * Float64(U_42_ - U))))
	tmp = 0.0
	if (t_4 <= 5e-156)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - fma(2.0, t_1, Float64(n * Float64(t_2 * Float64(U - U_42_))))))));
	elseif (t_4 <= 2e+305)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(t_3 * Float64(U - U_42_)) + Float64(2.0 * t_1)))));
	else
		tmp = Float64(sqrt(Float64(Float64(n * U) * Float64(Float64(U_42_ * Float64(n / (Om ^ 2.0))) - Float64(2.0 / Om)))) * Float64(l_m * sqrt(2.0)));
	end
	return tmp
end
l_m = N[Abs[l], $MachinePrecision]
code[n_, U_, t_, l$95$m_, Om_, U$42$_] := Block[{t$95$1 = N[(l$95$m * N[(l$95$m / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l$95$m / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(n * t$95$2), $MachinePrecision]}, Block[{t$95$4 = 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[(t$95$3 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 5e-156], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * t$95$1 + N[(n * N[(t$95$2 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 2e+305], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(t$95$3 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] + N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(n * U), $MachinePrecision] * N[(N[(U$42$ * N[(n / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l_m = \left|\ell\right|

\\
\begin{array}{l}
t_1 := l\_m \cdot \frac{l\_m}{Om}\\
t_2 := {\left(\frac{l\_m}{Om}\right)}^{2}\\
t_3 := n \cdot t\_2\\
t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{l\_m \cdot l\_m}{Om}\right) + t\_3 \cdot \left(U* - U\right)\right)\\
\mathbf{if}\;t\_4 \leq 5 \cdot 10^{-156}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, t\_1, n \cdot \left(t\_2 \cdot \left(U - U*\right)\right)\right)\right)\right)}\\

\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(t\_3 \cdot \left(U - U*\right) + 2 \cdot t\_1\right)\right)}\\

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


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

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

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

    if 5.00000000000000007e-156 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*)))) < 1.9999999999999999e305

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 65.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := \left(\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 \left(U \cdot \left(n \cdot \left(t - 2 \cdot \frac{{l\_m}^{2}}{Om}\right)\right)\right)}\\

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

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


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

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

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

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

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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 62.8% accurate, 0.4× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 62.2% accurate, 0.5× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

    1. Initial program 0.0%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around 0 1.3%

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

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

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

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

        \[\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} \]
    5. Applied egg-rr32.7%

      \[\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. Recombined 3 regimes into one program.
  4. Final simplification60.5%

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

Alternative 7: 49.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if U < 6.5000000000000005e166

    1. Initial program 46.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in n around 0 39.0%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{\left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)}} \]
    4. Step-by-step derivation
      1. pow1/245.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*47.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. cancel-sign-sub-inv47.1%

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

        \[\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} \]
    5. Applied egg-rr47.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}} \]

    if 6.5000000000000005e166 < U

    1. Initial program 80.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. Simplified80.7%

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

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

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

Alternative 8: 48.3% accurate, 1.0× speedup?

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

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

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


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

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

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

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

    if 4.7999999999999998e152 < l

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

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

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

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

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

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

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

Alternative 9: 43.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 55.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.79999999999999985e153 < l

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

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

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

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

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

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

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

Alternative 10: 39.2% accurate, 1.1× speedup?

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

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

    \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in n around 0 41.9%

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

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

      \[\leadsto \sqrt{\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}} \cdot \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)}} \]
    3. pow1/248.2%

      \[\leadsto \sqrt{{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}^{0.5} \cdot \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}}} \]
    4. pow-prod-down37.1%

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

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

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

      \[\leadsto \sqrt{{\left({\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)}^{2}\right)}^{0.5}} \]
    8. metadata-eval35.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 39.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 39.6% accurate, 1.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

    if 5.70000000000000005e234 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 38.5% accurate, 2.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ {\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.5} \end{array} \]
l_m = (fabs.f64 l)
(FPCore (n U t l_m Om U*) :precision binary64 (pow (* 2.0 (* 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(2.0 * Float64(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[(2.0 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|

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

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

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

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

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

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

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

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

Alternative 14: 36.5% accurate, 2.1× speedup?

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

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

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

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

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

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

Alternative 15: 36.4% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

Alternative 16: 35.8% accurate, 2.1× speedup?

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

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

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

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

Reproduce

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