Toniolo and Linder, Equation (13)

Percentage Accurate: 50.1% → 65.3%
Time: 6.4s
Alternatives: 17
Speedup: 1.7×

Specification

?
\[\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)} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (sqrt
 (*
  (* (* 2 n) U)
  (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- 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_)))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\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)}

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 17 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.1% accurate, 1.0× speedup?

\[\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)} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (sqrt
 (*
  (* (* 2 n) U)
  (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- 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_)))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\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)}

Alternative 1: 65.3% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{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. lift-/.f64N/A

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

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

        \[\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)} \]
      5. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \left(\ell \cdot \frac{1}{Om} + \color{blue}{\ell \cdot \frac{1}{Om}}\right) \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      12. distribute-lft-outN/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \left(\ell \cdot \left(1 \cdot \frac{1}{Om} + \color{blue}{1 \cdot \frac{1}{Om}}\right)\right) \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      15. distribute-rgt-outN/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{\left(\left(\ell \cdot \frac{1}{Om}\right) \cdot 2\right)} \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      18. mult-flipN/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{\frac{\ell + \ell}{Om} \cdot \ell}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right)} \cdot \left(U - U*\right)\right)} \]
      3. lift-pow.f64N/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} \cdot \left(U - U*\right)\right)} \]
      6. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} \cdot \left(U - U*\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\color{blue}{\left(n + n\right)} \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)} \]
      3. lift-+.f6454.9%

        \[\leadsto \sqrt{\left(\color{blue}{\left(n + n\right)} \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)} \]
    7. Applied rewrites54.9%

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto \color{blue}{\ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

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

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      5. lower-*.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      6. lower-+.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      8. lower-/.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
      9. lower-/.f64N/A

        \[\leadsto \ell \cdot \sqrt{-2 \cdot \left(U \cdot \left(n \cdot \left(2 \cdot \frac{1}{Om} + \frac{n \cdot \left(U - U*\right)}{{Om}^{2}}\right)\right)\right)} \]
    7. Applied rewrites15.0%

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

Alternative 2: 60.2% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{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. lift-/.f64N/A

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

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

        \[\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)} \]
      5. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \left(\ell \cdot \frac{1}{Om} + \color{blue}{\ell \cdot \frac{1}{Om}}\right) \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      12. distribute-lft-outN/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \left(\ell \cdot \left(1 \cdot \frac{1}{Om} + \color{blue}{1 \cdot \frac{1}{Om}}\right)\right) \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      15. distribute-rgt-outN/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{\left(\left(\ell \cdot \frac{1}{Om}\right) \cdot 2\right)} \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      18. mult-flipN/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{\frac{\ell + \ell}{Om} \cdot \ell}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right)} \cdot \left(U - U*\right)\right)} \]
      3. lift-pow.f64N/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} \cdot \left(U - U*\right)\right)} \]
      6. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} \cdot \left(U - U*\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\color{blue}{\left(n + n\right)} \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)} \]
      3. lift-+.f6454.9%

        \[\leadsto \sqrt{\left(\color{blue}{\left(n + n\right)} \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)} \]
    7. Applied rewrites54.9%

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      4. sqr-abs-revN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right| \cdot \left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      5. mul-fabsN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      7. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      8. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      9. lower-fabs.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      13. associate-*r*N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      15. lower-*.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    11. Applied rewrites15.7%

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

Alternative 3: 58.4% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := t - \frac{\ell + \ell}{Om} \cdot \ell\\ \mathbf{if}\;U \leq \frac{4051998235156121}{98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808}:\\ \;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(t\_1 - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(t\_1 - \frac{\left(U - U*\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot n\right)}{Om}\right) \cdot \left(n + n\right)} \cdot \sqrt{U}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1 (- t (* (/ (+ l l) Om) l))))
  (if (<=
       U
       4051998235156121/98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808)
    (sqrt
     (*
      (* (+ n n) U)
      (- t_1 (* (* (/ l Om) (* (/ l Om) n)) (- U U*)))))
    (*
     (sqrt
      (* (- t_1 (/ (* (- U U*) (* (* (/ l Om) l) n)) Om)) (+ n n)))
     (sqrt U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = t - (((l + l) / Om) * l);
	double tmp;
	if (U <= 4.1e-305) {
		tmp = sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
	} else {
		tmp = sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * sqrt(U);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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 = t - (((l + l) / om) * l)
    if (u <= 4.1d-305) then
        tmp = sqrt((((n + n) * u) * (t_1 - (((l / om) * ((l / om) * n)) * (u - u_42)))))
    else
        tmp = sqrt(((t_1 - (((u - u_42) * (((l / om) * l) * n)) / om)) * (n + n))) * sqrt(u)
    end if
    code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = t - (((l + l) / Om) * l);
	double tmp;
	if (U <= 4.1e-305) {
		tmp = Math.sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
	} else {
		tmp = Math.sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * Math.sqrt(U);
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = t - (((l + l) / Om) * l)
	tmp = 0
	if U <= 4.1e-305:
		tmp = math.sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))))
	else:
		tmp = math.sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * math.sqrt(U)
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = Float64(t - Float64(Float64(Float64(l + l) / Om) * l))
	tmp = 0.0
	if (U <= 4.1e-305)
		tmp = sqrt(Float64(Float64(Float64(n + n) * U) * Float64(t_1 - Float64(Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) * Float64(U - U_42_)))));
	else
		tmp = Float64(sqrt(Float64(Float64(t_1 - Float64(Float64(Float64(U - U_42_) * Float64(Float64(Float64(l / Om) * l) * n)) / Om)) * Float64(n + n))) * sqrt(U));
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = t - (((l + l) / Om) * l);
	tmp = 0.0;
	if (U <= 4.1e-305)
		tmp = sqrt((((n + n) * U) * (t_1 - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
	else
		tmp = sqrt(((t_1 - (((U - U_42_) * (((l / Om) * l) * n)) / Om)) * (n + n))) * sqrt(U);
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(t - N[(N[(N[(l + l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[U, 4051998235156121/98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808], N[Sqrt[N[(N[(N[(n + n), $MachinePrecision] * U), $MachinePrecision] * N[(t$95$1 - N[(N[(N[(l / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(t$95$1 - N[(N[(N[(U - U$42$), $MachinePrecision] * N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * N[(n + n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := t - \frac{\ell + \ell}{Om} \cdot \ell\\
\mathbf{if}\;U \leq \frac{4051998235156121}{98829225247710262867429368515096341332791332892647518728955741224331220492185227974590031104217345944915565363435943316108305047551656971126471386689813725547615929822542168634993607295943953291620980311754270053008792716515963231747120779125566189619536160406425180445475300105093018814544105228831057745755716670455808}:\\
\;\;\;\;\sqrt{\left(\left(n + n\right) \cdot U\right) \cdot \left(t\_1 - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\

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


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

    1. Initial program 50.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. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{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. lift-/.f64N/A

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

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

        \[\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)} \]
      5. lift-/.f64N/A

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

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

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

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

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \left(\ell \cdot \frac{1}{Om} + \color{blue}{\ell \cdot \frac{1}{Om}}\right) \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      12. distribute-lft-outN/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \left(\ell \cdot \left(1 \cdot \frac{1}{Om} + \color{blue}{1 \cdot \frac{1}{Om}}\right)\right) \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      15. distribute-rgt-outN/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{\left(\left(\ell \cdot \frac{1}{Om}\right) \cdot 2\right)} \cdot \ell\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
      18. mult-flipN/A

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

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \color{blue}{\frac{\ell + \ell}{Om} \cdot \ell}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right)} \cdot \left(U - U*\right)\right)} \]
      3. lift-pow.f64N/A

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

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

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} \cdot \left(U - U*\right)\right)} \]
      6. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)} \cdot \left(U - U*\right)\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\color{blue}{\left(n + n\right)} \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)} \]
      3. lift-+.f6454.9%

        \[\leadsto \sqrt{\left(\color{blue}{\left(n + n\right)} \cdot U\right) \cdot \left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)} \]
    7. Applied rewrites54.9%

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

    if 4.1000000000000002e-305 < U

    1. Initial program 50.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. Applied rewrites26.3%

      \[\leadsto \color{blue}{\sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(\left(U - U*\right) \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U}} \]
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(\left(U - U*\right) \cdot n\right)} \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      3. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(U - U*\right) \cdot \left(n \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right)}\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      4. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \color{blue}{\left(\left(\ell \cdot \frac{\ell}{Om \cdot Om}\right) \cdot n\right)}\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      5. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\color{blue}{\left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)} \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      6. lift-/.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\left(\ell \cdot \color{blue}{\frac{\ell}{Om \cdot Om}}\right) \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      7. associate-*r/N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\color{blue}{\frac{\ell \cdot \ell}{Om \cdot Om}} \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      8. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\frac{\ell \cdot \ell}{\color{blue}{Om \cdot Om}} \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      9. frac-timesN/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\color{blue}{\left(\frac{\ell}{Om} \cdot \frac{\ell}{Om}\right)} \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      10. lift-/.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\left(\color{blue}{\frac{\ell}{Om}} \cdot \frac{\ell}{Om}\right) \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      11. lift-/.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\left(\frac{\ell}{Om} \cdot \color{blue}{\frac{\ell}{Om}}\right) \cdot n\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      12. associate-*r*N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)}\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      13. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\frac{\ell}{Om} \cdot \color{blue}{\left(\frac{\ell}{Om} \cdot n\right)}\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      14. lift-/.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \left(\color{blue}{\frac{\ell}{Om}} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      15. associate-*l/N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U - U*\right) \cdot \color{blue}{\frac{\ell \cdot \left(\frac{\ell}{Om} \cdot n\right)}{Om}}\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      16. associate-*r/N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\frac{\left(U - U*\right) \cdot \left(\ell \cdot \left(\frac{\ell}{Om} \cdot n\right)\right)}{Om}}\right) \cdot \left(n + n\right)} \cdot \sqrt{U} \]
      17. lower-/.f64N/A

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

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

Alternative 4: 52.7% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Applied rewrites46.5%

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      4. sqr-abs-revN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right| \cdot \left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      5. mul-fabsN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      7. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      8. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      9. lower-fabs.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      13. associate-*r*N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      15. lower-*.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    11. Applied rewrites15.7%

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

Alternative 5: 52.5% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Applied rewrites46.3%

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      4. sqr-abs-revN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right| \cdot \left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      5. mul-fabsN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      7. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      8. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      9. lower-fabs.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      13. associate-*r*N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      15. lower-*.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    11. Applied rewrites15.7%

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

Alternative 6: 49.2% accurate, 1.8× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq \frac{3256237484844319}{23258839177459420497578361852416145099316523541994177929007686373780457219628733546438113622840434097944400691400517693873107252115668992}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(n + n\right) \cdot \left(\left(\left(t - \frac{\left|\ell\right| + \left|\ell\right|}{Om} \cdot \left|\ell\right|\right) - \left(\left(U - U*\right) \cdot n\right) \cdot \left(\left|\ell\right| \cdot \frac{\left|\ell\right|}{Om \cdot Om}\right)\right) \cdot U\right)}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (if (<=
     (fabs l)
     3256237484844319/23258839177459420497578361852416145099316523541994177929007686373780457219628733546438113622840434097944400691400517693873107252115668992)
  (sqrt (* 2 (* U (* n t))))
  (sqrt
   (*
    (+ n n)
    (*
     (-
      (- t (* (/ (+ (fabs l) (fabs l)) Om) (fabs l)))
      (* (* (- U U*) n) (* (fabs l) (/ (fabs l) (* Om Om)))))
     U)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (fabs(l) <= 1.4e-121) {
		tmp = sqrt((2.0 * (U * (n * t))));
	} else {
		tmp = sqrt(((n + n) * (((t - (((fabs(l) + fabs(l)) / Om) * fabs(l))) - (((U - U_42_) * n) * (fabs(l) * (fabs(l) / (Om * Om))))) * U)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

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

    if 1.4000000000000001e-121 < l

    1. Initial program 50.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. Applied rewrites46.1%

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

Alternative 7: 47.8% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\ \mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\ \;\;\;\;\sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\frac{\ell}{Om \cdot Om} \cdot \ell\right)\right) \cdot \left(\left(U + U\right) \cdot n\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1
        (*
         (* (* 2 n) U)
         (-
          (- t (* 2 (/ (* l l) Om)))
          (* (* n (pow (/ l Om) 2)) (- U U*))))))
  (if (<= t_1 0)
    (sqrt (fabs (* (* t U) (+ n n))))
    (if (<=
         t_1
         10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
      (sqrt
       (*
        (-
         (- t (* (/ (+ l l) Om) l))
         (* (* U n) (* (/ l (* Om Om)) l)))
        (* (+ U U) n)))
      (/
       (* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
       (- Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = sqrt(fabs(((t * U) * (n + n))));
	} else if (t_1 <= 1e+289) {
		tmp = sqrt((((t - (((l + l) / Om) * l)) - ((U * n) * ((l / (Om * Om)) * l))) * ((U + U) * n)));
	} else {
		tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * n) / -Om;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Applied rewrites26.7%

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

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

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

      \[\leadsto \sqrt{\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \color{blue}{\left(U \cdot n\right)} \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)} \cdot \sqrt{U \cdot \left(n + n\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\sqrt{\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)} \cdot \sqrt{U \cdot \left(n + n\right)}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)}} \cdot \sqrt{U \cdot \left(n + n\right)} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)} \cdot \color{blue}{\sqrt{U \cdot \left(n + n\right)}} \]
      4. sqrt-unprodN/A

        \[\leadsto \color{blue}{\sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \left(U \cdot \left(n + n\right)\right)}} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \color{blue}{\sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \left(U \cdot \left(n + n\right)\right)}} \]
      6. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \color{blue}{\left(U \cdot \left(n + n\right)\right)}} \]
      7. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \color{blue}{\left(\left(n + n\right) \cdot U\right)}} \]
      8. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(t - \frac{\ell + \ell}{Om} \cdot \ell\right) - \left(U \cdot n\right) \cdot \left(\ell \cdot \frac{\ell}{Om \cdot Om}\right)\right) \cdot \color{blue}{\left(\left(n + n\right) \cdot U\right)}} \]
      9. lower-*.f6438.1%

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

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      4. sqr-abs-revN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right| \cdot \left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      5. mul-fabsN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      7. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      8. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      9. lower-fabs.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      13. associate-*r*N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      15. lower-*.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    11. Applied rewrites15.7%

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

Alternative 8: 45.7% accurate, 0.4× speedup?

\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\ \mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\ \;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1
        (*
         (* (* 2 n) U)
         (-
          (- t (* 2 (/ (* l l) Om)))
          (* (* n (pow (/ l Om) 2)) (- U U*))))))
  (if (<= t_1 0)
    (sqrt (fabs (* (* t U) (+ n n))))
    (if (<=
         t_1
         10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
      (sqrt (fabs (* t (* U (+ n n)))))
      (/
       (* (* (sqrt (fabs (* (* (- U U*) -2) U))) (fabs l)) n)
       (- Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = sqrt(fabs(((t * U) * (n + n))));
	} else if (t_1 <= 1e+289) {
		tmp = sqrt(fabs((t * (U * (n + n)))));
	} else {
		tmp = ((sqrt(fabs((((U - U_42_) * -2.0) * U))) * fabs(l)) * n) / -Om;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      4. sqr-abs-revN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right| \cdot \left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      5. mul-fabsN/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      6. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      7. lift-sqrt.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      8. rem-square-sqrtN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      9. lower-fabs.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(-2 \cdot U\right) \cdot \left(U - U*\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      11. *-commutativeN/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      12. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(U - U*\right) \cdot \left(-2 \cdot U\right)\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      13. associate-*r*N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      15. lower-*.f6415.7%

        \[\leadsto \frac{\left(\sqrt{\left|\left(\left(U - U*\right) \cdot -2\right) \cdot U\right|} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    11. Applied rewrites15.7%

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

Alternative 9: 45.0% accurate, 0.5× speedup?

\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\ \mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\ \;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{-n}{Om}\right)\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1
        (*
         (* (* 2 n) U)
         (-
          (- t (* 2 (/ (* l l) Om)))
          (* (* n (pow (/ l Om) 2)) (- U U*))))))
  (if (<= t_1 0)
    (sqrt (fabs (* (* t U) (+ n n))))
    (if (<=
         t_1
         10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
      (sqrt (fabs (* t (* U (+ n n)))))
      (* (fabs l) (* (sqrt (* (* (- U U*) -2) U)) (/ (- n) Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = sqrt(fabs(((t * U) * (n + n))));
	} else if (t_1 <= 1e+289) {
		tmp = sqrt(fabs((t * (U * (n + n)))));
	} else {
		tmp = fabs(l) * (sqrt((((U - U_42_) * -2.0) * U)) * (-n / Om));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      3. associate-/l*N/A

        \[\leadsto \left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot \frac{n}{\color{blue}{-Om}} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot \frac{n}{-\color{blue}{Om}} \]
      5. *-commutativeN/A

        \[\leadsto \left(\left|\ell\right| \cdot \sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)}\right) \cdot \frac{n}{-\color{blue}{Om}} \]
      6. associate-*l*N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \color{blue}{\frac{n}{-Om}}\right) \]
      7. lower-*.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \color{blue}{\frac{n}{-Om}}\right) \]
      8. lower-*.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \frac{n}{\color{blue}{-Om}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \frac{n}{-Om}\right) \]
      10. *-commutativeN/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(U - U*\right) \cdot \left(-2 \cdot U\right)} \cdot \frac{n}{-Om}\right) \]
      11. lift-*.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(U - U*\right) \cdot \left(-2 \cdot U\right)} \cdot \frac{n}{-Om}\right) \]
      12. associate-*r*N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{n}{-Om}\right) \]
      13. lower-*.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{n}{-Om}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{n}{-Om}\right) \]
      15. frac-2negN/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{\mathsf{neg}\left(n\right)}{\mathsf{neg}\left(\left(-Om\right)\right)}\right) \]
      16. lift-neg.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{\mathsf{neg}\left(n\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(Om\right)\right)\right)}\right) \]
      17. remove-double-negN/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{\mathsf{neg}\left(n\right)}{Om}\right) \]
      18. lower-/.f64N/A

        \[\leadsto \left|\ell\right| \cdot \left(\sqrt{\left(\left(U - U*\right) \cdot -2\right) \cdot U} \cdot \frac{\mathsf{neg}\left(n\right)}{Om}\right) \]
    11. Applied rewrites13.4%

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

Alternative 10: 44.7% accurate, 0.5× speedup?

\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\ \mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\ \;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;-\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot \frac{n}{Om}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1
        (*
         (* (* 2 n) U)
         (-
          (- t (* 2 (/ (* l l) Om)))
          (* (* n (pow (/ l Om) 2)) (- U U*))))))
  (if (<= t_1 0)
    (sqrt (fabs (* (* t U) (+ n n))))
    (if (<=
         t_1
         10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
      (sqrt (fabs (* t (* U (+ n n)))))
      (- (* (* (sqrt (* (* -2 U) (- U U*))) (fabs l)) (/ n Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = sqrt(fabs(((t * U) * (n + n))));
	} else if (t_1 <= 1e+289) {
		tmp = sqrt(fabs((t * (U * (n + n)))));
	} else {
		tmp = -((sqrt(((-2.0 * U) * (U - U_42_))) * fabs(l)) * (n / Om));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lower-neg.f6411.3%

        \[\leadsto -\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lift-/.f64N/A

        \[\leadsto -\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lift-*.f64N/A

        \[\leadsto -\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. *-commutativeN/A

        \[\leadsto -\frac{\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)} \cdot n}{Om} \]
      7. associate-/l*N/A

        \[\leadsto -\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)} \cdot \frac{n}{Om} \]
      8. lower-*.f64N/A

        \[\leadsto -\sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)} \cdot \frac{n}{Om} \]
    9. Applied rewrites13.5%

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

Alternative 11: 44.6% accurate, 0.5× speedup?

\[\begin{array}{l} t_1 := \left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\ \mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\ \;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\sqrt{2 \cdot \left(U \cdot U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1
        (*
         (* (* 2 n) U)
         (-
          (- t (* 2 (/ (* l l) Om)))
          (* (* n (pow (/ l Om) 2)) (- U U*))))))
  (if (<= t_1 0)
    (sqrt (fabs (* (* t U) (+ n n))))
    (if (<=
         t_1
         10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784)
      (sqrt (fabs (* t (* U (+ n n)))))
      (/ (* (* (sqrt (* 2 (* U U*))) (fabs l)) n) (- Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = ((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = sqrt(fabs(((t * U) * (n + n))));
	} else if (t_1 <= 1e+289) {
		tmp = sqrt(fabs((t * (U * (n + n)))));
	} else {
		tmp = ((sqrt((2.0 * (U * U_42_))) * fabs(l)) * n) / -Om;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\mathbf{elif}\;t\_1 \leq 10000000000000000617278335278671568869943723109630112583100528505388133765396715589425391709444647966943104584514912613103459078543395617173821153536698722855425910210916188218613474303381375362727338596024627724499484625789034803081540112423670420191213257583185130503608895092113260150784:\\
\;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      4. sqr-abs-revN/A

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

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

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

    1. Initial program 50.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. Taylor expanded in n around inf

      \[\leadsto \color{blue}{n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto n \cdot \color{blue}{\sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}}} \]
      2. lower-sqrt.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      4. lower-/.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      7. lower-pow.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      8. lower--.f64N/A

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
      9. lower-pow.f649.8%

        \[\leadsto n \cdot \sqrt{-2 \cdot \frac{U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)}{{Om}^{2}}} \]
    4. Applied rewrites9.8%

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

      \[\leadsto -1 \cdot \color{blue}{\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}} \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. lower-/.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      3. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      4. lower-sqrt.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      5. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      6. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      7. lower-*.f64N/A

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om} \]
      8. lower-pow.f64N/A

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

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

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

        \[\leadsto -1 \cdot \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\color{blue}{Om}} \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      3. lift-/.f64N/A

        \[\leadsto \mathsf{neg}\left(\frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{Om}\right) \]
      4. distribute-neg-frac2N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{n \cdot \sqrt{-2 \cdot \left(U \cdot \left({\ell}^{2} \cdot \left(U - U*\right)\right)\right)}}{\mathsf{neg}\left(Om\right)} \]
    9. Applied rewrites13.5%

      \[\leadsto \frac{\left(\sqrt{\left(-2 \cdot U\right) \cdot \left(U - U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    10. Taylor expanded in U around 0

      \[\leadsto \frac{\left(\sqrt{2 \cdot \left(U \cdot U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    11. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{\left(\sqrt{2 \cdot \left(U \cdot U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
      2. lower-*.f6414.0%

        \[\leadsto \frac{\left(\sqrt{2 \cdot \left(U \cdot U*\right)} \cdot \left|\ell\right|\right) \cdot n}{-Om} \]
    12. Applied rewrites14.0%

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

Alternative 12: 40.2% accurate, 4.2× speedup?

\[\begin{array}{l} \mathbf{if}\;U \leq \frac{8696971821798503}{395316900990841051469717474060385365331165331570590074915822964897324881968740911898360124416869383779662261453743773264433220190206627884505885546759254902190463719290168674539974429183775813166483921247017080212035170866063852926988483116502264758478144641625700721781901200420372075258176420915324230983022866681823232}:\\ \;\;\;\;\sqrt{\left|\left(t \cdot U\right) \cdot \left(n + n\right)\right|}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot t\right)} \cdot \sqrt{U}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (if (<=
     U
     8696971821798503/395316900990841051469717474060385365331165331570590074915822964897324881968740911898360124416869383779662261453743773264433220190206627884505885546759254902190463719290168674539974429183775813166483921247017080212035170866063852926988483116502264758478144641625700721781901200420372075258176420915324230983022866681823232)
  (sqrt (fabs (* (* t U) (+ n n))))
  (* (sqrt (* 2 (* n t))) (sqrt U))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (U <= 2.2e-305) {
		tmp = sqrt(fabs(((t * U) * (n + n))));
	} else {
		tmp = sqrt((2.0 * (n * t))) * sqrt(U);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot \color{blue}{t}} \]
    7. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \cdot \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \cdot \color{blue}{\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}}} \]
      4. sqr-abs-revN/A

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

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

    if 2.2e-305 < U

    1. Initial program 50.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. Applied rewrites26.3%

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(n \cdot t\right)}} \cdot \sqrt{U} \]
    4. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

Alternative 13: 39.5% accurate, 5.2× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq \frac{6313673899733619}{121416805764108066932466369176469931665150427440758720078238275608681517825325531136}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left|t \cdot \left(U \cdot \left(n + n\right)\right)\right|}\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (if (<=
     (fabs l)
     6313673899733619/121416805764108066932466369176469931665150427440758720078238275608681517825325531136)
  (sqrt (* 2 (* U (* n t))))
  (sqrt (fabs (* t (* U (+ n n)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double tmp;
	if (fabs(l) <= 5.2e-68) {
		tmp = sqrt((2.0 * (U * (n * t))));
	} else {
		tmp = sqrt(fabs((t * (U * (n + n)))));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

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

    if 5.1999999999999996e-68 < l

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      2. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \cdot \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
      3. lift-sqrt.f64N/A

        \[\leadsto \sqrt{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \cdot \color{blue}{\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}}} \]
      4. sqr-abs-revN/A

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

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

Alternative 14: 37.5% accurate, 0.5× speedup?

\[\begin{array}{l} t_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)}\\ t_2 := \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot n}\\ \mathbf{if}\;t\_1 \leq 0:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336:\\ \;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (let* ((t_1
        (sqrt
         (*
          (* (* 2 n) U)
          (-
           (- t (* 2 (/ (* l l) Om)))
           (* (* n (pow (/ l Om) 2)) (- U U*))))))
       (t_2 (sqrt (* (* (+ U U) t) n))))
  (if (<= t_1 0)
    t_2
    (if (<=
         t_1
         4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336)
      (sqrt (* (* U (+ n n)) t))
      t_2))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	double t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
	double t_2 = sqrt((((U + U) * t) * n));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = t_2;
	} else if (t_1 <= 5e+144) {
		tmp = sqrt(((U * (n + n)) * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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 = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
    t_2 = sqrt((((u + u) * t) * n))
    if (t_1 <= 0.0d0) then
        tmp = t_2
    else if (t_1 <= 5d+144) then
        tmp = sqrt(((u * (n + n)) * t))
    else
        tmp = t_2
    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((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
	double t_2 = Math.sqrt((((U + U) * t) * n));
	double tmp;
	if (t_1 <= 0.0) {
		tmp = t_2;
	} else if (t_1 <= 5e+144) {
		tmp = Math.sqrt(((U * (n + n)) * t));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(n, U, t, l, Om, U_42_):
	t_1 = math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
	t_2 = math.sqrt((((U + U) * t) * n))
	tmp = 0
	if t_1 <= 0.0:
		tmp = t_2
	elif t_1 <= 5e+144:
		tmp = math.sqrt(((U * (n + n)) * t))
	else:
		tmp = t_2
	return tmp
function code(n, U, t, l, Om, U_42_)
	t_1 = 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_)))))
	t_2 = sqrt(Float64(Float64(Float64(U + U) * t) * n))
	tmp = 0.0
	if (t_1 <= 0.0)
		tmp = t_2;
	elseif (t_1 <= 5e+144)
		tmp = sqrt(Float64(Float64(U * Float64(n + n)) * t));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(n, U, t, l, Om, U_42_)
	t_1 = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))));
	t_2 = sqrt((((U + U) * t) * n));
	tmp = 0.0;
	if (t_1 <= 0.0)
		tmp = t_2;
	elseif (t_1 <= 5e+144)
		tmp = sqrt(((U * (n + n)) * t));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(N[(2 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(N[(U + U), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 0], t$95$2, If[LessEqual[t$95$1, 4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336], N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_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)}\\
t_2 := \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot n}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 4999999999999999945435305910704598063392403130200679472590007732362651199555129074427056403228815030648329464160476949292016380761727168556302336:\\
\;\;\;\;\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. associate-*l*N/A

        \[\leadsto \sqrt{\left(2 \cdot U\right) \cdot \color{blue}{\left(n \cdot t\right)}} \]
      4. count-2-revN/A

        \[\leadsto \sqrt{\left(U + U\right) \cdot \left(\color{blue}{n} \cdot t\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U + U\right) \cdot \left(n \cdot \color{blue}{t}\right)} \]
      6. *-commutativeN/A

        \[\leadsto \sqrt{\left(U + U\right) \cdot \left(t \cdot \color{blue}{n}\right)} \]
      7. associate-*r*N/A

        \[\leadsto \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot \color{blue}{n}} \]
      8. lower-*.f64N/A

        \[\leadsto \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot \color{blue}{n}} \]
      9. lower-*.f64N/A

        \[\leadsto \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot n} \]
      10. lower-+.f6436.1%

        \[\leadsto \sqrt{\left(\left(U + U\right) \cdot t\right) \cdot n} \]
    6. Applied rewrites36.1%

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

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

    1. Initial program 50.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. Taylor expanded in t around inf

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lower-*.f64N/A

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

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

      \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
      6. count-2N/A

        \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
      7. distribute-rgt-outN/A

        \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
      8. count-2-revN/A

        \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
      9. associate-*l*N/A

        \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
      10. *-commutativeN/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      11. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      12. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      13. lower-*.f6436.5%

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
      14. lift-*.f64N/A

        \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
      15. *-commutativeN/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      16. lift-*.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
      17. count-2-revN/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      18. lift-+.f64N/A

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
      19. lift-*.f6436.5%

        \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    6. Applied rewrites36.5%

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

Alternative 15: 36.5% accurate, 6.8× speedup?

\[\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (sqrt (* 2 (* 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))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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 * N[(U * N[(n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}
Derivation
  1. Initial program 50.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. Taylor expanded in t around inf

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
    2. lower-*.f64N/A

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

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

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

Alternative 16: 36.4% accurate, 7.4× speedup?

\[\sqrt{\left(U + U\right) \cdot \left(t \cdot n\right)} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (sqrt (* (+ U U) (* t n))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt(((U + U) * (t * n)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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(((u + u) * (t * n)))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt(((U + U) * (t * n)));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt(((U + U) * (t * n)))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(U + U) * Float64(t * n)))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt(((U + U) * (t * n)));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(U + U), $MachinePrecision] * N[(t * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sqrt{\left(U + U\right) \cdot \left(t \cdot n\right)}
Derivation
  1. Initial program 50.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. Taylor expanded in t around inf

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
    2. lower-*.f64N/A

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

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

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
    2. lift-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
    3. associate-*l*N/A

      \[\leadsto \sqrt{\left(2 \cdot U\right) \cdot \color{blue}{\left(n \cdot t\right)}} \]
    4. count-2-revN/A

      \[\leadsto \sqrt{\left(U + U\right) \cdot \left(\color{blue}{n} \cdot t\right)} \]
    5. lower-*.f64N/A

      \[\leadsto \sqrt{\left(U + U\right) \cdot \color{blue}{\left(n \cdot t\right)}} \]
    6. lower-+.f6436.4%

      \[\leadsto \sqrt{\left(U + U\right) \cdot \left(\color{blue}{n} \cdot t\right)} \]
    7. lift-*.f64N/A

      \[\leadsto \sqrt{\left(U + U\right) \cdot \left(n \cdot \color{blue}{t}\right)} \]
    8. *-commutativeN/A

      \[\leadsto \sqrt{\left(U + U\right) \cdot \left(t \cdot \color{blue}{n}\right)} \]
    9. lower-*.f6436.4%

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

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

Alternative 17: 36.4% accurate, 7.4× speedup?

\[\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
(FPCore (n U t l Om U*)
  :precision binary64
  (sqrt (* (* U (+ n n)) t)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
	return sqrt(((U * (n + n)) * t));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(n, u, t, l, om, u_42)
use fmin_fmax_functions
    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(((u * (n + n)) * t))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
	return Math.sqrt(((U * (n + n)) * t));
}
def code(n, U, t, l, Om, U_42_):
	return math.sqrt(((U * (n + n)) * t))
function code(n, U, t, l, Om, U_42_)
	return sqrt(Float64(Float64(U * Float64(n + n)) * t))
end
function tmp = code(n, U, t, l, Om, U_42_)
	tmp = sqrt(((U * (n + n)) * t));
end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(U * N[(n + n), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]
\sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t}
Derivation
  1. Initial program 50.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. Taylor expanded in t around inf

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
    2. lower-*.f64N/A

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

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

    \[\leadsto \sqrt{\color{blue}{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \color{blue}{\left(U \cdot \left(n \cdot t\right)\right)}} \]
    2. lift-*.f64N/A

      \[\leadsto \sqrt{2 \cdot \left(U \cdot \color{blue}{\left(n \cdot t\right)}\right)} \]
    3. lift-*.f64N/A

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

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

      \[\leadsto \sqrt{\left(2 \cdot \left(U \cdot n\right)\right) \cdot \color{blue}{t}} \]
    6. count-2N/A

      \[\leadsto \sqrt{\left(U \cdot n + U \cdot n\right) \cdot t} \]
    7. distribute-rgt-outN/A

      \[\leadsto \sqrt{\left(n \cdot \left(U + U\right)\right) \cdot t} \]
    8. count-2-revN/A

      \[\leadsto \sqrt{\left(n \cdot \left(2 \cdot U\right)\right) \cdot t} \]
    9. associate-*l*N/A

      \[\leadsto \sqrt{\left(\left(n \cdot 2\right) \cdot U\right) \cdot t} \]
    10. *-commutativeN/A

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
    11. lift-*.f64N/A

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
    12. lift-*.f64N/A

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
    13. lower-*.f6436.5%

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \color{blue}{t}} \]
    14. lift-*.f64N/A

      \[\leadsto \sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot t} \]
    15. *-commutativeN/A

      \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
    16. lift-*.f64N/A

      \[\leadsto \sqrt{\left(U \cdot \left(2 \cdot n\right)\right) \cdot t} \]
    17. count-2-revN/A

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    18. lift-+.f64N/A

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
    19. lift-*.f6436.5%

      \[\leadsto \sqrt{\left(U \cdot \left(n + n\right)\right) \cdot t} \]
  6. Applied rewrites36.5%

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

Reproduce

?
herbie shell --seed 2025285 -o generate:evaluate
(FPCore (n U t l Om U*)
  :name "Toniolo and Linder, Equation (13)"
  :precision binary64
  (sqrt (* (* (* 2 n) U) (- (- t (* 2 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2)) (- U U*))))))