Toniolo and Linder, Equation (13)

Percentage Accurate: 50.5% → 63.9%
Time: 26.4s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 50.5% 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: 63.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 16.2%

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 2: 63.5% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 16.2%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

Alternative 3: 51.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.15 \cdot 10^{-171} \lor \neg \left(n \leq 7.8 \cdot 10^{-166}\right):\\
\;\;\;\;{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}^{0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -1.14999999999999989e-171 or 7.79999999999999998e-166 < n

    1. Initial program 49.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. Simplified55.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 40.0%

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

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

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

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

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

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

    if -1.14999999999999989e-171 < n < 7.79999999999999998e-166

    1. Initial program 45.9%

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

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

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

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

Alternative 4: 42.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\color{blue}{\left({\left(\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}\right)}^{2} \]
      7. metadata-eval39.8%

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

      \[\leadsto {\color{blue}{\left({\left({\left(\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\right)}^{1.5}\right)}^{0.3333333333333333}\right)}}^{2} \]
    9. Step-by-step derivation
      1. *-un-lft-identity39.8%

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

        \[\leadsto {\left(1 \cdot \color{blue}{{\left(\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{2} \]
      3. sqrt-pow244.6%

        \[\leadsto {\left(1 \cdot \color{blue}{{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{\left(\frac{1.5 \cdot 0.3333333333333333}{2}\right)}}\right)}^{2} \]
      4. associate-*l*44.6%

        \[\leadsto {\left(1 \cdot {\color{blue}{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}}^{\left(\frac{1.5 \cdot 0.3333333333333333}{2}\right)}\right)}^{2} \]
      5. metadata-eval44.6%

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

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

      \[\leadsto {\color{blue}{\left(1 \cdot {\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.25}\right)}}^{2} \]
    11. Step-by-step derivation
      1. *-lft-identity44.6%

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

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

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

    if 1.15000000000000001e-56 < l < 2.3499999999999999e169

    1. Initial program 41.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. Simplified45.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. Step-by-step derivation
      1. associate-*r*45.7%

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

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

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

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

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

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

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

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

    if 2.3499999999999999e169 < l

    1. Initial program 2.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 42.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 57.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left({\color{blue}{\left({\left(\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\right)}^{\left(1 + 0.5\right)}\right)}}^{0.3333333333333333}\right)}^{2} \]
      7. metadata-eval39.8%

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

      \[\leadsto {\color{blue}{\left({\left({\left(\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\right)}^{1.5}\right)}^{0.3333333333333333}\right)}}^{2} \]
    9. Step-by-step derivation
      1. *-un-lft-identity39.8%

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

        \[\leadsto {\left(1 \cdot \color{blue}{{\left(\sqrt{\left(2 \cdot U\right) \cdot \left(n \cdot t\right)}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{2} \]
      3. sqrt-pow244.6%

        \[\leadsto {\left(1 \cdot \color{blue}{{\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{\left(\frac{1.5 \cdot 0.3333333333333333}{2}\right)}}\right)}^{2} \]
      4. associate-*l*44.6%

        \[\leadsto {\left(1 \cdot {\color{blue}{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}}^{\left(\frac{1.5 \cdot 0.3333333333333333}{2}\right)}\right)}^{2} \]
      5. metadata-eval44.6%

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

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

      \[\leadsto {\color{blue}{\left(1 \cdot {\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}^{0.25}\right)}}^{2} \]
    11. Step-by-step derivation
      1. *-lft-identity44.6%

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

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

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

    if 3.29999999999999984e-56 < l < 1.4000000000000001e169

    1. Initial program 41.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. Simplified50.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 35.5%

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

    if 1.4000000000000001e169 < l

    1. Initial program 2.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 46.0% accurate, 1.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if 6.6e-164 < n

    1. Initial program 54.4%

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

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

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

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

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

Alternative 7: 50.1% accurate, 1.1× speedup?

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

\\
{\left(\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t + -2 \cdot \frac{{\ell}^{2}}{Om}\right)\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 48.6%

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

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

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

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

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

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

Alternative 8: 45.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;U \leq 4.6 \cdot 10^{+148}:\\ \;\;\;\;\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\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 4.6e+148)
   (sqrt (* (* 2.0 n) (* U (- t (* 2.0 (/ (* l l) Om))))))
   (* (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 <= 4.6e+148) {
		tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
	} 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 <= 4.6d+148) then
        tmp = sqrt(((2.0d0 * n) * (u * (t - (2.0d0 * ((l * l) / om))))))
    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 <= 4.6e+148) {
		tmp = Math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
	} 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 <= 4.6e+148:
		tmp = math.sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))))
	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 <= 4.6e+148)
		tmp = sqrt(Float64(Float64(2.0 * n) * Float64(U * Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))))));
	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 <= 4.6e+148)
		tmp = sqrt(((2.0 * n) * (U * (t - (2.0 * ((l * l) / Om))))));
	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, 4.6e+148], N[Sqrt[N[(N[(2.0 * n), $MachinePrecision] * N[(U * N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(2.0 * U), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(n * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 46.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified52.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 40.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. unpow240.5%

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

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

    if 4.6000000000000001e148 < U

    1. Initial program 70.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. Simplified59.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 70.0%

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

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

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

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

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

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

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

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

Alternative 9: 45.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.80000000000000047e163

    1. Initial program 48.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. Simplified54.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 41.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. unpow241.5%

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

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

    if 7.80000000000000047e163 < t

    1. Initial program 49.9%

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Simplified53.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. Step-by-step derivation
      1. associate-*r*53.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 44.6% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 46.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. Simplified52.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 n around 0 40.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. unpow240.5%

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

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

    if 1.15000000000000005e33 < U

    1. Initial program 64.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. Simplified67.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. Step-by-step derivation
      1. associate-*r*67.1%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot t\right)}^{\left(1.5 \cdot 0.3333333333333333\right)} \cdot {\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot t\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      5. pow-prod-down43.1%

        \[\leadsto \sqrt{\color{blue}{{\left(\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot t\right) \cdot \left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}} \]
      6. swap-sqr28.1%

        \[\leadsto \sqrt{{\color{blue}{\left(\left(\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right) \cdot \left(t \cdot t\right)\right)}}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      7. *-commutative28.1%

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

        \[\leadsto \sqrt{{\left(\left(\color{blue}{\left(\left(2 \cdot U\right) \cdot n\right)} \cdot \left(2 \cdot \left(n \cdot U\right)\right)\right) \cdot \left(t \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      9. *-commutative28.1%

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

        \[\leadsto \sqrt{{\left(\left(\left(\left(2 \cdot U\right) \cdot n\right) \cdot \color{blue}{\left(\left(2 \cdot U\right) \cdot n\right)}\right) \cdot \left(t \cdot t\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      11. swap-sqr43.1%

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

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

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

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

        \[\leadsto \sqrt{{\left({\color{blue}{\left(2 \cdot \left(U \cdot \left(n \cdot t\right)\right)\right)}}^{2}\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} \]
      16. metadata-eval45.8%

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

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

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

        \[\leadsto \sqrt{\sqrt{\color{blue}{\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)}}} \]
      3. rem-sqrt-square59.7%

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

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

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

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

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

Alternative 11: 44.4% accurate, 2.0× speedup?

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

\\
\sqrt{\left(2 \cdot n\right) \cdot \left(U \cdot \left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right)\right)}
\end{array}
Derivation
  1. Initial program 48.6%

    \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
  2. Simplified53.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 41.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. unpow241.5%

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

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

Alternative 12: 38.6% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 13: 36.5% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 14: 36.5% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

Alternative 15: 36.6% 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 48.6%

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

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

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

Reproduce

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