Toniolo and Linder, Equation (13)

Percentage Accurate: 50.5% → 62.4%
Time: 25.8s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 50.5% accurate, 1.0× speedup?

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

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

Alternative 1: 62.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\\ t_2 := \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) + t\_1 \cdot \left(U* - U\right)\right)}\\ \mathbf{if}\;t\_2 \leq 4 \cdot 10^{-160}:\\ \;\;\;\;\sqrt{2 \cdot n} \cdot \sqrt{U \cdot \left(t - \mathsf{fma}\left(U - U*, t\_1, \frac{2 \cdot {\ell}^{2}}{Om}\right)\right)}\\ \mathbf{elif}\;t\_2 \leq \infty:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(t - \left(2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right) + t\_1 \cdot \left(U - U*\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(-4 \cdot \frac{U \cdot \left(n \cdot {\ell}^{2}\right)}{Om}\right)}^{0.5}\\ \end{array} \end{array} \]
(FPCore (n U t l Om U*)
 :precision binary64
 (let* ((t_1 (* n (pow (/ l Om) 2.0)))
        (t_2
         (sqrt
          (*
           (* (* 2.0 n) U)
           (+ (- t (* 2.0 (/ (* l l) Om))) (* t_1 (- U* U)))))))
   (if (<= t_2 4e-160)
     (*
      (sqrt (* 2.0 n))
      (sqrt (* U (- t (fma (- U U*) t_1 (/ (* 2.0 (pow l 2.0)) Om))))))
     (if (<= t_2 INFINITY)
       (sqrt
        (* (* 2.0 (* n U)) (- t (+ (* 2.0 (* l (/ l Om))) (* t_1 (- U U*))))))
       (pow (* -4.0 (/ (* U (* n (pow l 2.0))) Om)) 0.5)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = n * pow((l / Om), 2.0);
	double t_2 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) + (t_1 * (U_42_ - U)))));
	double tmp;
	if (t_2 <= 4e-160) {
		tmp = sqrt((2.0 * n)) * sqrt((U * (t - fma((U - U_42_), t_1, ((2.0 * pow(l, 2.0)) / Om)))));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = sqrt(((2.0 * (n * U)) * (t - ((2.0 * (l * (l / Om))) + (t_1 * (U - U_42_))))));
	} else {
		tmp = pow((-4.0 * ((U * (n * pow(l, 2.0))) / Om)), 0.5);
	}
	return tmp;
}
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(n * (Float64(l / Om) ^ 2.0))
	t_2 = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) + Float64(t_1 * Float64(U_42_ - U)))))
	tmp = 0.0
	if (t_2 <= 4e-160)
		tmp = Float64(sqrt(Float64(2.0 * n)) * sqrt(Float64(U * Float64(t - fma(Float64(U - U_42_), t_1, Float64(Float64(2.0 * (l ^ 2.0)) / Om))))));
	elseif (t_2 <= Inf)
		tmp = sqrt(Float64(Float64(2.0 * Float64(n * U)) * Float64(t - Float64(Float64(2.0 * Float64(l * Float64(l / Om))) + Float64(t_1 * Float64(U - U_42_))))));
	else
		tmp = Float64(-4.0 * Float64(Float64(U * Float64(n * (l ^ 2.0))) / Om)) ^ 0.5;
	end
	return 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[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[(t$95$1 * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 4e-160], N[(N[Sqrt[N[(2.0 * n), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(U * N[(t - N[(N[(U - U$42$), $MachinePrecision] * t$95$1 + N[(N[(2.0 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[Sqrt[N[(N[(2.0 * N[(n * U), $MachinePrecision]), $MachinePrecision] * N[(t - N[(N[(2.0 * N[(l * N[(l / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[(-4.0 * N[(N[(U * N[(n * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]]]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (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*))))) < 4e-160

    1. Initial program 14.3%

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot n} \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)}} \]
      2. fma-undefine52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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. Simplified3.3%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 61.3% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 10.5%

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

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

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

        \[\leadsto \color{blue}{\sqrt{2 \cdot n} \cdot \sqrt{U \cdot t}} \]
    6. Applied egg-rr40.6%

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

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

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

    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 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 41.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := \sqrt{\left|\left(2 \cdot U\right) \cdot \left(n \cdot t\right)\right|}\\
\mathbf{if}\;\ell \leq 2.8 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{\left(\left(n \cdot \ell\right) \cdot \sqrt{2}\right) \cdot \sqrt{U \cdot U*}}{Om}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.79999999999999995e-111 or 3.79999999999999978e-91 < l < 2.0000000000000001e96

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999995e-111 < l < 3.79999999999999978e-91

    1. Initial program 36.2%

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

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

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

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

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

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

    if 2.0000000000000001e96 < l

    1. Initial program 31.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. Simplified34.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 46.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.6999999999999999e98

    1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6999999999999999e98 < t < 2.5000000000000001e177

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

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

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

    if 2.5000000000000001e177 < t

    1. Initial program 40.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. Simplified37.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 51.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 50.9%

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

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

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

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

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

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

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

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

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

    if 2.1000000000000001e222 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 40.8% accurate, 1.1× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.39999999999999982e-277 < U

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{U \cdot 2} \cdot \color{blue}{\sqrt{n \cdot t}} \]
    6. Applied egg-rr54.4%

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

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

Alternative 7: 39.1% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 38.3% 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 50.4%

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

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

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

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

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

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

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

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

Alternative 9: 36.3% 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 50.4%

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

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

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

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

Reproduce

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