Toniolo and Linder, Equation (13)

Percentage Accurate: 49.6% → 61.4%
Time: 20.8s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 49.6% accurate, 1.0× speedup?

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

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

Alternative 1: 61.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{U \cdot \left(t - 2 \cdot t_1\right)}\\

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_3 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot t_2\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, t_1, t\right)\right)\right)}^{0.5}\\


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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000019e120 < (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0

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

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

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

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

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

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

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

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

    1. Initial program 67.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. Step-by-step derivation
      1. associate-*l/74.5%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right) \leq -5 \cdot 10^{+120}:\\ \;\;\;\;\sqrt{\left(n \cdot 2\right) \cdot \left(U \cdot \left(\left(t + -2 \cdot \frac{\ell}{\frac{Om}{\ell}}\right) - n \cdot {\left(\frac{\ell}{Om} \cdot \sqrt{U - U*}\right)}^{2}\right)\right)}\\ \mathbf{elif}\;\left(\left(n \cdot 2\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{n \cdot 2} \cdot \sqrt{U \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)}\\ \mathbf{elif}\;\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right) \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, \frac{{\ell}^{2}}{Om}, t\right)\right)\right)}^{0.5}\\ \end{array} \]

Alternative 2: 60.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot t_2\right)}\\

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


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

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

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

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

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

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

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

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

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

    1. Initial program 67.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. Step-by-step derivation
      1. associate-*l/74.5%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt{\left(\left(n \cdot 2\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{n \cdot 2} \cdot \sqrt{U \cdot t}\\ \mathbf{elif}\;\sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)} \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, \frac{{\ell}^{2}}{Om}, t\right)\right)\right)}^{0.5}\\ \end{array} \]

Alternative 3: 61.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot t_3\right)}\\

\mathbf{else}:\\
\;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, t_1, t\right)\right)\right)}^{0.5}\\


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

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

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

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

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

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

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

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

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

    1. Initial program 67.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. Step-by-step derivation
      1. associate-*l/74.5%

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\sqrt{\left(\left(n \cdot 2\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{n \cdot 2} \cdot \sqrt{U \cdot \left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right)}\\ \mathbf{elif}\;\sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U* - U\right)\right)} \leq \infty:\\ \;\;\;\;\sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(2 \cdot \left(\left(n \cdot U\right) \cdot \mathsf{fma}\left(-2, \frac{{\ell}^{2}}{Om}, t\right)\right)\right)}^{0.5}\\ \end{array} \]

Alternative 4: 55.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \left(n \cdot 2\right) \cdot U\\ \mathbf{if}\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t_1 \cdot \left(U* - U\right)\right)} \leq 0:\\ \;\;\;\;\sqrt{n \cdot 2} \cdot \sqrt{U \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{t_2 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - \left(U - U*\right) \cdot t_1\right)}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (* n (pow (/ l Om) 2.0))) (t_2 (* (* n 2.0) U)))
   (if (<=
        (sqrt (* t_2 (+ (- t (* 2.0 (/ (* l l) Om))) (* t_1 (- U* U)))))
        0.0)
     (* (sqrt (* n 2.0)) (sqrt (* U t)))
     (sqrt (* t_2 (- (- t (* 2.0 (* l (/ l Om)))) (* (- U U*) t_1)))))))
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 = (n * 2.0) * U;
	double tmp;
	if (sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))))) <= 0.0) {
		tmp = sqrt((n * 2.0)) * sqrt((U * t));
	} else {
		tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) - ((U - U_42_) * t_1))));
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = n * ((l / om) ** 2.0d0)
    t_2 = (n * 2.0d0) * u
    if (sqrt((t_2 * ((t - (2.0d0 * ((l * l) / om))) + (t_1 * (u_42 - u))))) <= 0.0d0) then
        tmp = sqrt((n * 2.0d0)) * sqrt((u * t))
    else
        tmp = sqrt((t_2 * ((t - (2.0d0 * (l * (l / om)))) - ((u - u_42) * t_1))))
    end if
    code = tmp
end function
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 = (n * 2.0) * U;
	double tmp;
	if (Math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))))) <= 0.0) {
		tmp = Math.sqrt((n * 2.0)) * Math.sqrt((U * t));
	} else {
		tmp = Math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) - ((U - U_42_) * t_1))));
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = n * math.pow((l / Om), 2.0)
	t_2 = (n * 2.0) * U
	tmp = 0
	if math.sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))))) <= 0.0:
		tmp = math.sqrt((n * 2.0)) * math.sqrt((U * t))
	else:
		tmp = math.sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) - ((U - U_42_) * t_1))))
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(n * (Float64(l / Om) ^ 2.0))
	t_2 = Float64(Float64(n * 2.0) * U)
	tmp = 0.0
	if (sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(t_1 * Float64(U_42_ - U))))) <= 0.0)
		tmp = Float64(sqrt(Float64(n * 2.0)) * sqrt(Float64(U * t)));
	else
		tmp = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * Float64(l * Float64(l / Om)))) - Float64(Float64(U - U_42_) * t_1))));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = n * ((l / Om) ^ 2.0);
	t_2 = (n * 2.0) * U;
	tmp = 0.0;
	if (sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U))))) <= 0.0)
		tmp = sqrt((n * 2.0)) * sqrt((U * t));
	else
		tmp = sqrt((t_2 * ((t - (2.0 * (l * (l / Om)))) - ((U - U_42_) * t_1))));
	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), $MachinePrecision] * U), $MachinePrecision]}, If[LessEqual[N[Sqrt[N[(t$95$2 * 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]], $MachinePrecision], 0.0], N[(N[Sqrt[N[(n * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(U - U$42$), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}

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

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


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

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

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

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

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

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

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

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

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

    1. Initial program 53.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. Step-by-step derivation
      1. associate-*l/60.2%

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

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

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

Alternative 5: 56.9% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 48.9%

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

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

    if -2.45e-303 < n

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 52.9% accurate, 1.0× speedup?

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

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


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

    1. Initial program 46.0%

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

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

    if 1.8e112 < U

    1. Initial program 53.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 47.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;n \leq -7.8 \cdot 10^{+267}:\\
\;\;\;\;{\left({\left(t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -7.79999999999999961e267

    1. Initial program 51.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. Simplified66.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    6. Step-by-step derivation
      1. unpow1/351.6%

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{\color{blue}{\left(3 \cdot 0.16666666666666666\right)}} \]
      6. metadata-eval51.6%

        \[\leadsto {\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{\left(3 \cdot \color{blue}{\frac{0.3333333333333333}{2}}\right)} \]
      7. pow-pow68.2%

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

        \[\leadsto {\left({\color{blue}{\left(\left(\left(2 \cdot U\right) \cdot n\right) \cdot t\right)}}^{3}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      9. metadata-eval68.4%

        \[\leadsto {\left({\left(\left(\left(2 \cdot U\right) \cdot n\right) \cdot t\right)}^{3}\right)}^{\color{blue}{0.16666666666666666}} \]
    9. Applied egg-rr68.4%

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

    if -7.79999999999999961e267 < n

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -7.8 \cdot 10^{+267}:\\ \;\;\;\;{\left({\left(t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot {\left(\frac{\frac{Om}{\ell}}{\ell}\right)}^{-1}\right)\right)\right)}\\ \end{array} \]

Alternative 8: 47.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.2 \cdot 10^{+271}:\\
\;\;\;\;{\left({\left(t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if n < -2.20000000000000001e271

    1. Initial program 51.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. Simplified66.7%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left({\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    6. Step-by-step derivation
      1. unpow1/351.6%

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

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

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

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

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

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

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

        \[\leadsto {\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{\color{blue}{\left(3 \cdot 0.16666666666666666\right)}} \]
      6. metadata-eval51.6%

        \[\leadsto {\left(\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right)}^{\left(3 \cdot \color{blue}{\frac{0.3333333333333333}{2}}\right)} \]
      7. pow-pow68.2%

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

        \[\leadsto {\left({\color{blue}{\left(\left(\left(2 \cdot U\right) \cdot n\right) \cdot t\right)}}^{3}\right)}^{\left(\frac{0.3333333333333333}{2}\right)} \]
      9. metadata-eval68.4%

        \[\leadsto {\left({\left(\left(\left(2 \cdot U\right) \cdot n\right) \cdot t\right)}^{3}\right)}^{\color{blue}{0.16666666666666666}} \]
    9. Applied egg-rr68.4%

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

    if -2.20000000000000001e271 < n

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;n \leq -2.2 \cdot 10^{+271}:\\ \;\;\;\;{\left({\left(t \cdot \left(n \cdot \left(2 \cdot U\right)\right)\right)}^{3}\right)}^{0.16666666666666666}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot \left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right)\right)\right)}\\ \end{array} \]

Alternative 9: 47.3% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

Alternative 10: 37.8% accurate, 2.1× speedup?

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

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

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

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

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

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

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

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

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

Alternative 11: 35.7% 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 47.0%

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

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

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

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

Reproduce

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