Toniolo and Linder, Equation (13)

Percentage Accurate: 49.3% → 60.0%
Time: 30.5s
Alternatives: 13
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \ell \cdot \frac{\ell}{Om}\\ t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_3 := \left(n \cdot t\_2\right) \cdot \left(U* - U\right)\\ t_4 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t\_3\right)\\ \mathbf{if}\;t\_4 \leq 10^{-7}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \mathsf{fma}\left(2, t\_1, t\_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t + \left(t\_3 - 2 \cdot t\_1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{2 \cdot \left(U \cdot \left(U* \cdot {\left(n \cdot \ell\right)}^{2}\right)\right)}{{Om}^{2}}}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (* l (/ l Om)))
        (t_2 (pow (/ l Om) 2.0))
        (t_3 (* (* n t_2) (- U* U)))
        (t_4 (* (* (* 2.0 n) U) (+ (- t (* 2.0 (/ (* l l) Om))) t_3))))
   (if (<= t_4 1e-7)
     (sqrt (* (* 2.0 n) (* U (- t (fma 2.0 t_1 (* t_2 (* n (- U U*))))))))
     (if (<= t_4 INFINITY)
       (sqrt (* (* 2.0 (* n U)) (+ t (- t_3 (* 2.0 t_1)))))
       (sqrt (/ (* 2.0 (* U (* U* (pow (* n l) 2.0)))) (pow Om 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = l * (l / Om);
	double t_2 = pow((l / Om), 2.0);
	double t_3 = (n * t_2) * (U_42_ - U);
	double t_4 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + t_3);
	double tmp;
	if (t_4 <= 1e-7) {
		tmp = sqrt(((2.0 * n) * (U * (t - fma(2.0, t_1, (t_2 * (n * (U - U_42_))))))));
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t + (t_3 - (2.0 * t_1)))));
	} else {
		tmp = sqrt(((2.0 * (U * (U_42_ * pow((n * l), 2.0)))) / pow(Om, 2.0)));
	}
	return tmp;
}
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(l * Float64(l / Om))
	t_2 = Float64(l / Om) ^ 2.0
	t_3 = Float64(Float64(n * t_2) * Float64(U_42_ - U))
	t_4 = Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + t_3))
	tmp = 0.0
	if (t_4 <= 1e-7)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - fma(2.0, t_1, Float64(t_2 * Float64(n * Float64(U - U_42_))))))));
	elseif (t_4 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t + Float64(t_3 - Float64(2.0 * t_1)))));
	else
		tmp = sqrt(Float64(Float64(2.0 * Float64(U * Float64(U_42_ * (Float64(n * l) ^ 2.0)))) / (Om ^ 2.0)));
	end
	return tmp
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(n * t$95$2), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 1e-7], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * t$95$1 + N[(t$95$2 * N[(n * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t + N[(t$95$3 - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * N[(U * N[(U$42$ * N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Om, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 60.6% accurate, 0.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.1%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{\left|2 \cdot \left(U \cdot \left(n \cdot t\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{\frac{2 \cdot \left(U \cdot \left(U* \cdot {\left(n \cdot \ell\right)}^{2}\right)\right)}{{Om}^{2}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 61.2% accurate, 0.5× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 72.1%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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{\left|2 \cdot \left(U \cdot \left(n \cdot t\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(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 41.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 3.4 \cdot 10^{-249}:\\ \;\;\;\;\sqrt{2} \cdot \sqrt{t \cdot \left(n \cdot U\right)}\\ \mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+130}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= l 3.4e-249)
   (* (sqrt 2.0) (sqrt (* t (* n U))))
   (if (<= l 3.7e+130)
     (sqrt (* 2.0 (* U (* n (- t (/ (* 2.0 (pow l 2.0)) Om))))))
     (pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 3.4e-249) {
		tmp = sqrt(2.0) * sqrt((t * (n * U)));
	} else if (l <= 3.7e+130) {
		tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * pow(l, 2.0)) / Om))))));
	} else {
		tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 0.5);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (l <= 3.4d-249) then
        tmp = sqrt(2.0d0) * sqrt((t * (n * u)))
    else if (l <= 3.7d+130) then
        tmp = sqrt((2.0d0 * (u * (n * (t - ((2.0d0 * (l ** 2.0d0)) / om))))))
    else
        tmp = ((-4.0d0) * ((u * (n * (l ** 2.0d0))) / om)) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (l <= 3.4e-249) {
		tmp = Math.sqrt(2.0) * Math.sqrt((t * (n * U)));
	} else if (l <= 3.7e+130) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - ((2.0 * Math.pow(l, 2.0)) / Om))))));
	} else {
		tmp = Math.pow((-4.0 * ((U * (n * Math.pow(l, 2.0))) / Om)), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if l <= 3.4e-249:
		tmp = math.sqrt(2.0) * math.sqrt((t * (n * U)))
	elif l <= 3.7e+130:
		tmp = math.sqrt((2.0 * (U * (n * (t - ((2.0 * math.pow(l, 2.0)) / Om))))))
	else:
		tmp = math.pow((-4.0 * ((U * (n * math.pow(l, 2.0))) / Om)), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (l <= 3.4e-249)
		tmp = Float64(sqrt(2.0) * sqrt(Float64(t * Float64(n * U))));
	elseif (l <= 3.7e+130)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om))))));
	else
		tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (l <= 3.4e-249)
		tmp = sqrt(2.0) * sqrt((t * (n * U)));
	elseif (l <= 3.7e+130)
		tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * (l ^ 2.0)) / Om))))));
	else
		tmp = (-4.0 * ((U * (n * (l ^ 2.0))) / Om)) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 3.4e-249], N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.7e+130], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;\ell \leq 3.7 \cdot 10^{+130}:\\
\;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)\right)}\\

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


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

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

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

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

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

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

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

    if 3.3999999999999998e-249 < l < 3.7000000000000001e130

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

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

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

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

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

    if 3.7000000000000001e130 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 42.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Om \leq -3.2 \cdot 10^{-162}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)\right)}\\ \mathbf{elif}\;Om \leq 4.9 \cdot 10^{+44}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= Om -3.2e-162)
   (sqrt (* 2.0 (* U (* n (- t (/ (* 2.0 (pow l 2.0)) Om))))))
   (if (<= Om 4.9e+44)
     (sqrt (* (* 2.0 n) (* U (* (* n (pow (/ l Om) 2.0)) U*))))
     (pow (* 2.0 (* t (* n U))) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (Om <= -3.2e-162) {
		tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * pow(l, 2.0)) / Om))))));
	} else if (Om <= 4.9e+44) {
		tmp = sqrt(((2.0 * n) * (U * ((n * pow((l / Om), 2.0)) * U_42_))));
	} else {
		tmp = pow((2.0 * (t * (n * U))), 0.5);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (om <= (-3.2d-162)) then
        tmp = sqrt((2.0d0 * (u * (n * (t - ((2.0d0 * (l ** 2.0d0)) / om))))))
    else if (om <= 4.9d+44) then
        tmp = sqrt(((2.0d0 * n) * (u * ((n * ((l / om) ** 2.0d0)) * u_42))))
    else
        tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (Om <= -3.2e-162) {
		tmp = Math.sqrt((2.0 * (U * (n * (t - ((2.0 * Math.pow(l, 2.0)) / Om))))));
	} else if (Om <= 4.9e+44) {
		tmp = Math.sqrt(((2.0 * n) * (U * ((n * Math.pow((l / Om), 2.0)) * U_42_))));
	} else {
		tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if Om <= -3.2e-162:
		tmp = math.sqrt((2.0 * (U * (n * (t - ((2.0 * math.pow(l, 2.0)) / Om))))))
	elif Om <= 4.9e+44:
		tmp = math.sqrt(((2.0 * n) * (U * ((n * math.pow((l / Om), 2.0)) * U_42_))))
	else:
		tmp = math.pow((2.0 * (t * (n * U))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (Om <= -3.2e-162)
		tmp = sqrt(Float64(2.0 * Float64(U * Float64(n * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om))))));
	elseif (Om <= 4.9e+44)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * U_42_))));
	else
		tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (Om <= -3.2e-162)
		tmp = sqrt((2.0 * (U * (n * (t - ((2.0 * (l ^ 2.0)) / Om))))));
	elseif (Om <= 4.9e+44)
		tmp = sqrt(((2.0 * n) * (U * ((n * ((l / Om) ^ 2.0)) * U_42_))));
	else
		tmp = (2.0 * (t * (n * U))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, -3.2e-162], N[Sqrt[N[(2.0 * N[(U * N[(n * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 4.9e+44], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;Om \leq 4.9 \cdot 10^{+44}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Om < -3.19999999999999975e-162

    1. Initial program 59.6%

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

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

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

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

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

    if -3.19999999999999975e-162 < Om < 4.90000000000000035e44

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.90000000000000035e44 < Om

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

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

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

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

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

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

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

Alternative 6: 42.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Om \leq -1.6 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}\\ \mathbf{elif}\;Om \leq 2.4 \cdot 10^{+45}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= Om -1.6e-160)
   (sqrt (* (* 2.0 n) (* U (- t (/ (* 2.0 (pow l 2.0)) Om)))))
   (if (<= Om 2.4e+45)
     (sqrt (* (* 2.0 n) (* U (* (* n (pow (/ l Om) 2.0)) U*))))
     (pow (* 2.0 (* t (* n U))) 0.5))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (Om <= -1.6e-160) {
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * pow(l, 2.0)) / Om)))));
	} else if (Om <= 2.4e+45) {
		tmp = sqrt(((2.0 * n) * (U * ((n * pow((l / Om), 2.0)) * U_42_))));
	} else {
		tmp = pow((2.0 * (t * (n * U))), 0.5);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (om <= (-1.6d-160)) then
        tmp = sqrt(((2.0d0 * n) * (u * (t - ((2.0d0 * (l ** 2.0d0)) / om)))))
    else if (om <= 2.4d+45) then
        tmp = sqrt(((2.0d0 * n) * (u * ((n * ((l / om) ** 2.0d0)) * u_42))))
    else
        tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (Om <= -1.6e-160) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t - ((2.0 * Math.pow(l, 2.0)) / Om)))));
	} else if (Om <= 2.4e+45) {
		tmp = Math.sqrt(((2.0 * n) * (U * ((n * Math.pow((l / Om), 2.0)) * U_42_))));
	} else {
		tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if Om <= -1.6e-160:
		tmp = math.sqrt(((2.0 * n) * (U * (t - ((2.0 * math.pow(l, 2.0)) / Om)))))
	elif Om <= 2.4e+45:
		tmp = math.sqrt(((2.0 * n) * (U * ((n * math.pow((l / Om), 2.0)) * U_42_))))
	else:
		tmp = math.pow((2.0 * (t * (n * U))), 0.5)
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (Om <= -1.6e-160)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(Float64(2.0 * (l ^ 2.0)) / Om)))));
	elseif (Om <= 2.4e+45)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * U_42_))));
	else
		tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (Om <= -1.6e-160)
		tmp = sqrt(((2.0 * n) * (U * (t - ((2.0 * (l ^ 2.0)) / Om)))));
	elseif (Om <= 2.4e+45)
		tmp = sqrt(((2.0 * n) * (U * ((n * ((l / Om) ^ 2.0)) * U_42_))));
	else
		tmp = (2.0 * (t * (n * U))) ^ 0.5;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, -1.6e-160], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[Om, 2.4e+45], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;Om \leq 2.4 \cdot 10^{+45}:\\
\;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(\left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot U*\right)\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Om < -1.60000000000000004e-160

    1. Initial program 59.6%

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

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

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

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

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

    if -1.60000000000000004e-160 < Om < 2.39999999999999989e45

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999989e45 < Om

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

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

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

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

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

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

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

Alternative 7: 40.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+31}:\\
\;\;\;\;\sqrt{\left|2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right|}\\

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


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

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

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

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

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

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

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

    if 2.9000000000000001e-248 < l < 2.6e31

    1. Initial program 66.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. Simplified66.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 t around inf 59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e31 < l

    1. Initial program 39.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. Simplified48.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 36.7% accurate, 1.1× speedup?

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

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

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


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

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

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

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

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

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

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

    if 2.19999999999999999e-248 < l

    1. Initial program 54.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. Simplified59.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 t around inf 43.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 40.3% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < U

    1. Initial program 59.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. Simplified62.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 t around inf 44.7%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot U}} \cdot \sqrt{n \cdot t} \]
      2. *-commutative54.2%

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

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

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

Alternative 10: 38.4% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 36.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;U \leq -1.2 \cdot 10^{-81}:\\ \;\;\;\;{\left(2 \cdot \left(t \cdot \left(n \cdot U\right)\right)\right)}^{0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= U -1.2e-81)
   (pow (* 2.0 (* t (* n U))) 0.5)
   (sqrt (* (* 2.0 n) (* U t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -1.2e-81) {
		tmp = pow((2.0 * (t * (n * U))), 0.5);
	} else {
		tmp = sqrt(((2.0 * n) * (U * t)));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (u <= (-1.2d-81)) then
        tmp = (2.0d0 * (t * (n * u))) ** 0.5d0
    else
        tmp = sqrt(((2.0d0 * n) * (u * t)))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -1.2e-81) {
		tmp = Math.pow((2.0 * (t * (n * U))), 0.5);
	} else {
		tmp = Math.sqrt(((2.0 * n) * (U * t)));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= -1.2e-81:
		tmp = math.pow((2.0 * (t * (n * U))), 0.5)
	else:
		tmp = math.sqrt(((2.0 * n) * (U * t)))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= -1.2e-81)
		tmp = Float64(2.0 * Float64(t * Float64(n * U))) ^ 0.5;
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t)));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= -1.2e-81)
		tmp = (2.0 * (t * (n * U))) ^ 0.5;
	else
		tmp = sqrt(((2.0 * n) * (U * t)));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -1.2e-81], N[Power[N[(2.0 * N[(t * N[(n * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

    if -1.2e-81 < U

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

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

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

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

Alternative 12: 36.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;U \leq -5 \cdot 10^{-81}:\\ \;\;\;\;\sqrt{t \cdot \left(n \cdot \left(2 \cdot U\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot t\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (if (<= U -5e-81) (sqrt (* t (* n (* 2.0 U)))) (sqrt (* (* 2.0 n) (* U t)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -5e-81) {
		tmp = sqrt((t * (n * (2.0 * U))));
	} else {
		tmp = sqrt(((2.0 * n) * (U * t)));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (u <= (-5d-81)) then
        tmp = sqrt((t * (n * (2.0d0 * u))))
    else
        tmp = sqrt(((2.0d0 * n) * (u * t)))
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= -5e-81) {
		tmp = Math.sqrt((t * (n * (2.0 * U))));
	} else {
		tmp = Math.sqrt(((2.0 * n) * (U * t)));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	tmp = 0
	if U <= -5e-81:
		tmp = math.sqrt((t * (n * (2.0 * U))))
	else:
		tmp = math.sqrt(((2.0 * n) * (U * t)))
	return tmp
function code(n, U, t, l, Om, U_42_)
	tmp = 0.0
	if (U <= -5e-81)
		tmp = sqrt(Float64(t * Float64(n * Float64(2.0 * U))));
	else
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * t)));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	tmp = 0.0;
	if (U <= -5e-81)
		tmp = sqrt((t * (n * (2.0 * U))));
	else
		tmp = sqrt(((2.0 * n) * (U * t)));
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[U, -5e-81], N[Sqrt[N[(t * N[(n * N[(2.0 * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

    if -4.99999999999999981e-81 < U

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

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

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

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

Alternative 13: 35.5% accurate, 2.1× speedup?

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

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

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

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

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

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

Reproduce

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