?

Average Error: 34.8 → 29.4
Time: 36.8s
Precision: binary64
Cost: 37320

?

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

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

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 2 n) U) (-.f64 (-.f64 t (*.f64 2 (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) 2)) (-.f64 U U*)))) < 0.0

    1. Initial program 57.4

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

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

      [Start]57.4

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

      rational.json-simplify-49 [=>]55.6

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

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

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

      [Start]42.9

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

      rational.json-simplify-4 [=>]42.9

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

      rational.json-simplify-43 [=>]42.9

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

      rational.json-simplify-43 [=>]41.7

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

      rational.json-simplify-2 [<=]41.7

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

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

    1. Initial program 24.2

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

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

      [Start]24.2

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

      rational.json-simplify-49 [=>]21.0

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

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

    1. Initial program 64.0

      \[\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)} \]
    2. Taylor expanded in l around 0 60.4

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

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

      [Start]60.4

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

      rational.json-simplify-1 [=>]60.4

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

      rational.json-simplify-43 [=>]60.8

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

      rational.json-simplify-43 [=>]60.8

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

      rational.json-simplify-43 [=>]60.8

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

      rational.json-simplify-2 [=>]60.8

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

      rational.json-simplify-51 [=>]60.8

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

      rational.json-simplify-2 [=>]60.8

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

      rational.json-simplify-2 [=>]60.8

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

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

Alternatives

Alternative 1
Error28.6
Cost30728
\[\begin{array}{l} t_1 := \left(2 \cdot n\right) \cdot U\\ t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\ t_3 := \left(n \cdot t_2\right) \cdot \left(U - U*\right)\\ t_4 := t_1 \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - t_3\right)\\ \mathbf{if}\;t_4 \leq 0:\\ \;\;\;\;\sqrt{U \cdot \left(\left(n + n\right) \cdot \left(t - \left(\ell \cdot \left(\frac{\ell}{Om} \cdot 2\right) + t_2 \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right)\right)}\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;\sqrt{t_1 \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - t_3\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{2} \cdot \left(\ell \cdot \frac{n}{Om}\right)\right) \cdot \left(-\sqrt{U \cdot U*}\right)\\ \end{array} \]
Alternative 2
Error32.8
Cost14728
\[\begin{array}{l} t_1 := {\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(n \cdot \left(U - U*\right)\right)\\ t_2 := \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot \left(\left(t - 2 \cdot \left(\ell \cdot \frac{\ell}{Om}\right)\right) - t_1\right)}\\ \mathbf{if}\;U \leq -3.2 \cdot 10^{-130}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;U \leq 4 \cdot 10^{-201}:\\ \;\;\;\;\sqrt{U \cdot \left(\left(n + n\right) \cdot \left(t - \left(\ell \cdot \left(\frac{\ell}{Om} \cdot 2\right) + t_1\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error33.1
Cost14596
\[\begin{array}{l} \mathbf{if}\;n \leq -8.2 \cdot 10^{+59}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{U \cdot \left(\left(n + n\right) \cdot \left(t - \left(\ell \cdot \left(\frac{\ell}{Om} \cdot 2\right) + {\left(\frac{\ell}{Om}\right)}^{2} \cdot \left(n \cdot \left(U - U*\right)\right)\right)\right)\right)}\\ \end{array} \]
Alternative 4
Error38.7
Cost14224
\[\begin{array}{l} t_1 := t - 2 \cdot \frac{{\ell}^{2}}{Om}\\ \mathbf{if}\;Om \leq -2.4 \cdot 10^{-103}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(t_1 \cdot n\right)\right)}\\ \mathbf{elif}\;Om \leq 1.65 \cdot 10^{-105}:\\ \;\;\;\;\sqrt{2} \cdot \left(\left(\ell \cdot \frac{n}{Om}\right) \cdot \left(-\sqrt{U \cdot U*}\right)\right)\\ \mathbf{elif}\;Om \leq 2.56 \cdot 10^{+129}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t_1 \cdot U\right)\right)}\\ \mathbf{elif}\;Om \leq 5.5 \cdot 10^{+201}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array} \]
Alternative 5
Error38.7
Cost14224
\[\begin{array}{l} t_1 := t - 2 \cdot \frac{{\ell}^{2}}{Om}\\ \mathbf{if}\;Om \leq -4.3 \cdot 10^{-103}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(t_1 \cdot n\right)\right)}\\ \mathbf{elif}\;Om \leq 6.5 \cdot 10^{-106}:\\ \;\;\;\;\sqrt{2} \cdot \left(\left(\ell \cdot \frac{n}{Om}\right) \cdot \left(-\sqrt{U \cdot U*}\right)\right)\\ \mathbf{elif}\;Om \leq 4 \cdot 10^{+129}:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(\left(t - 2 \cdot \left({\ell}^{2} \cdot \frac{1}{Om}\right)\right) \cdot U\right)\right)}\\ \mathbf{elif}\;Om \leq 4.3 \cdot 10^{+201}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \end{array} \]
Alternative 6
Error38.2
Cost14096
\[\begin{array}{l} t_1 := t - 2 \cdot \frac{{\ell}^{2}}{Om}\\ t_2 := \sqrt{2 \cdot \left(U \cdot \left(t_1 \cdot n\right)\right)}\\ \mathbf{if}\;U* \leq -1 \cdot 10^{-210}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;U* \leq 650000000:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t_1 \cdot U\right)\right)}\\ \mathbf{elif}\;U* \leq 6.8 \cdot 10^{+174}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;U* \leq 9.8 \cdot 10^{+288}:\\ \;\;\;\;\left(\sqrt{2} \cdot \left(\ell \cdot \frac{n}{Om}\right)\right) \cdot \left(-\sqrt{U \cdot U*}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \sqrt{n \cdot \left(t \cdot U\right)}\\ \end{array} \]
Alternative 7
Error37.1
Cost14092
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(U \cdot \left(\left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right) \cdot n\right)\right)}\\ \mathbf{if}\;\ell \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{elif}\;\ell \leq -9.6 \cdot 10^{-222}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq 0.00115:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error37.2
Cost14092
\[\begin{array}{l} \mathbf{if}\;\ell \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{elif}\;\ell \leq -8.2 \cdot 10^{-230}:\\ \;\;\;\;\sqrt{U \cdot \left(-4 \cdot \frac{n \cdot {\ell}^{2}}{Om} + 2 \cdot \left(n \cdot t\right)\right)}\\ \mathbf{elif}\;\ell \leq 0.000165:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(\left(t - 2 \cdot \frac{{\ell}^{2}}{Om}\right) \cdot n\right)\right)}\\ \end{array} \]
Alternative 9
Error40.1
Cost13964
\[\begin{array}{l} t_1 := \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{if}\;\ell \leq -1.28 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq -3.2 \cdot 10^{+91}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{{\ell}^{2} \cdot n}}}\\ \mathbf{elif}\;\ell \leq 3 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(\left({\ell}^{2} \cdot \frac{-2}{Om}\right) \cdot n\right)\right)}\\ \end{array} \]
Alternative 10
Error40.4
Cost13836
\[\begin{array}{l} t_1 := \sqrt{-4 \cdot \left(n \cdot \frac{U \cdot {\ell}^{2}}{Om}\right)}\\ t_2 := \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{if}\;\ell \leq -1.3 \cdot 10^{+142}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\ell \leq -3.1 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+16}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error40.1
Cost13836
\[\begin{array}{l} t_1 := \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{if}\;\ell \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq -3 \cdot 10^{+91}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{{\ell}^{2} \cdot n}}}\\ \mathbf{elif}\;\ell \leq 1.25 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{-4 \cdot \left(n \cdot \frac{U \cdot {\ell}^{2}}{Om}\right)}\\ \end{array} \]
Alternative 12
Error40.0
Cost13836
\[\begin{array}{l} t_1 := \sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \mathbf{if}\;\ell \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq -3.2 \cdot 10^{+91}:\\ \;\;\;\;\sqrt{-4 \cdot \frac{U}{\frac{Om}{{\ell}^{2} \cdot n}}}\\ \mathbf{elif}\;\ell \leq 3.1 \cdot 10^{+16}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{U \cdot -4}{\frac{\frac{Om}{{\ell}^{2}}}{n}}}\\ \end{array} \]
Alternative 13
Error40.5
Cost7112
\[\begin{array}{l} t_1 := \sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \mathbf{if}\;U* \leq -3.5 \cdot 10^{-145}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;U* \leq 220000000:\\ \;\;\;\;\sqrt{2 \cdot \left(n \cdot \left(t \cdot U\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error40.2
Cost6980
\[\begin{array}{l} \mathbf{if}\;t \leq -4 \cdot 10^{-223}:\\ \;\;\;\;\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\left(2 \cdot \left(n \cdot U\right)\right) \cdot t}\\ \end{array} \]
Alternative 15
Error40.3
Cost6848
\[\sqrt{2 \cdot \left(U \cdot \left(n \cdot t\right)\right)} \]

Error

Reproduce?

herbie shell --seed 2023064 
(FPCore (n U t l Om U*)
  :name "Toniolo and Linder, Equation (13)"
  :precision binary64
  (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))