
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* 2.0 n) U) (- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))))
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
return Math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(Float64(t - Float64(2.0 * Float64(Float64(l * l) / Om))) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_))))); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(t - N[(2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\left(t - 2 \cdot \frac{\ell \cdot \ell}{Om}\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}
\end{array}
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* 2.0 n) U))
(t_4 (sqrt (* t_3 (- (- t (* 2.0 t_1)) (* (* n t_2) (- U U*)))))))
(if (<= t_4 0.0)
(*
(sqrt (* (- (fma -2.0 t_1 t) (* (* (- U U*) n) t_2)) (* n 2.0)))
(sqrt U))
(if (<= t_4 INFINITY)
(sqrt
(*
t_3
(-
(fma (* -2.0 l) (/ l Om) t)
(* (* (/ l Om) (* (/ l Om) n)) (- U U*)))))
(sqrt
(fma
(* 2.0 U)
(* n t)
(/
(fma
l
(* (* n l) (* 4.0 U))
(* (- U U*) (* (pow (* n l) 2.0) (/ (* 2.0 U) Om))))
(- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = pow((l / Om), 2.0);
double t_3 = (2.0 * n) * U;
double t_4 = sqrt((t_3 * ((t - (2.0 * t_1)) - ((n * t_2) * (U - U_42_)))));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((fma(-2.0, t_1, t) - (((U - U_42_) * n) * t_2)) * (n * 2.0))) * sqrt(U);
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * (fma((-2.0 * l), (l / Om), t) - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (fma(l, ((n * l) * (4.0 * U)), ((U - U_42_) * (pow((n * l), 2.0) * ((2.0 * U) / Om)))) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(2.0 * n) * U) t_4 = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * t_2) * Float64(U - U_42_))))) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(sqrt(Float64(Float64(fma(-2.0, t_1, t) - Float64(Float64(Float64(U - U_42_) * n) * t_2)) * Float64(n * 2.0))) * sqrt(U)); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) - Float64(Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) * Float64(U - U_42_))))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(fma(l, Float64(Float64(n * l) * Float64(4.0 * U)), Float64(Float64(U - U_42_) * Float64((Float64(n * l) ^ 2.0) * Float64(Float64(2.0 * U) / Om)))) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * t$95$2), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[Sqrt[N[(N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $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[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(l * N[(N[(n * l), $MachinePrecision] * N[(4.0 * U), $MachinePrecision]), $MachinePrecision] + N[(N[(U - U$42$), $MachinePrecision] * N[(N[Power[N[(n * l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(2.0 * U), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := \sqrt{t\_3 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot t\_2\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(-2, t\_1, t\right) - \left(\left(U - U*\right) \cdot n\right) \cdot t\_2\right) \cdot \left(n \cdot 2\right)} \cdot \sqrt{U}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_3 \cdot \left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\mathsf{fma}\left(\ell, \left(n \cdot \ell\right) \cdot \left(4 \cdot U\right), \left(U - U*\right) \cdot \left({\left(n \cdot \ell\right)}^{2} \cdot \frac{2 \cdot U}{Om}\right)\right)}{-Om}\right)}\\
\end{array}
\end{array}
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.0Initial program 17.4%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6417.4
Applied rewrites17.4%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites39.7%
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*))))) < +inf.0Initial program 67.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.0
Applied rewrites71.0%
if +inf.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*))))) Initial program 0.0%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites12.3%
Applied rewrites48.0%
Applied rewrites52.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (pow (/ l Om) 2.0))
(t_3 (* (* 2.0 n) U))
(t_4 (sqrt (* t_3 (- (- t (* 2.0 t_1)) (* (* n t_2) (- U U*)))))))
(if (<= t_4 0.0)
(*
(sqrt (* (- (fma -2.0 t_1 t) (* (* (- U U*) n) t_2)) (* n 2.0)))
(sqrt U))
(if (<= t_4 INFINITY)
(sqrt
(*
t_3
(-
(fma (* -2.0 l) (/ l Om) t)
(* (* (/ l Om) (* (/ l Om) n)) (- U U*)))))
(sqrt
(fma
(* 2.0 U)
(* n t)
(/
(fma
l
(* (* n l) (* 4.0 U))
(* (* n l) (* (* n l) (* (* (- U U*) U) (/ 2.0 Om)))))
(- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = pow((l / Om), 2.0);
double t_3 = (2.0 * n) * U;
double t_4 = sqrt((t_3 * ((t - (2.0 * t_1)) - ((n * t_2) * (U - U_42_)))));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt(((fma(-2.0, t_1, t) - (((U - U_42_) * n) * t_2)) * (n * 2.0))) * sqrt(U);
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * (fma((-2.0 * l), (l / Om), t) - (((l / Om) * ((l / Om) * n)) * (U - U_42_)))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (fma(l, ((n * l) * (4.0 * U)), ((n * l) * ((n * l) * (((U - U_42_) * U) * (2.0 / Om))))) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(l / Om) ^ 2.0 t_3 = Float64(Float64(2.0 * n) * U) t_4 = sqrt(Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * t_2) * Float64(U - U_42_))))) tmp = 0.0 if (t_4 <= 0.0) tmp = Float64(sqrt(Float64(Float64(fma(-2.0, t_1, t) - Float64(Float64(Float64(U - U_42_) * n) * t_2)) * Float64(n * 2.0))) * sqrt(U)); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) - Float64(Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) * Float64(U - U_42_))))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(fma(l, Float64(Float64(n * l) * Float64(4.0 * U)), Float64(Float64(n * l) * Float64(Float64(n * l) * Float64(Float64(Float64(U - U_42_) * U) * Float64(2.0 / Om))))) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * t$95$2), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[(N[Sqrt[N[(N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] - N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[U], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $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[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(l * N[(N[(n * l), $MachinePrecision] * N[(4.0 * U), $MachinePrecision]), $MachinePrecision] + N[(N[(n * l), $MachinePrecision] * N[(N[(n * l), $MachinePrecision] * N[(N[(N[(U - U$42$), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2}\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := \sqrt{t\_3 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot t\_2\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(-2, t\_1, t\right) - \left(\left(U - U*\right) \cdot n\right) \cdot t\_2\right) \cdot \left(n \cdot 2\right)} \cdot \sqrt{U}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_3 \cdot \left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) - \left(\frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\mathsf{fma}\left(\ell, \left(n \cdot \ell\right) \cdot \left(4 \cdot U\right), \left(n \cdot \ell\right) \cdot \left(\left(n \cdot \ell\right) \cdot \left(\left(\left(U - U*\right) \cdot U\right) \cdot \frac{2}{Om}\right)\right)\right)}{-Om}\right)}\\
\end{array}
\end{array}
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.0Initial program 17.4%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6417.4
Applied rewrites17.4%
lift-sqrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
Applied rewrites39.7%
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*))))) < +inf.0Initial program 67.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.0
Applied rewrites71.0%
if +inf.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*))))) Initial program 0.0%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites12.3%
Applied rewrites48.0%
Applied rewrites50.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (/ l Om) (* (/ l Om) n)))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
t_2
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_3 0.0)
(sqrt
(fma
(* n 2.0)
(* U (fma n 2.0 t))
(- (* (* n 2.0) (* (* U (- U U*)) t_1)))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (- (fma (* -2.0 l) (/ l Om) t) (* t_1 (- U U*)))))
(sqrt
(fma
(* 2.0 U)
(* n t)
(/
(fma
l
(* (* n l) (* 4.0 U))
(* (* n l) (* (* n l) (* (* (- U U*) U) (/ 2.0 Om)))))
(- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * ((l / Om) * n);
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(fma((n * 2.0), (U * fma(n, 2.0, t)), -((n * 2.0) * ((U * (U - U_42_)) * t_1))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * (fma((-2.0 * l), (l / Om), t) - (t_1 * (U - U_42_)))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (fma(l, ((n * l) * (4.0 * U)), ((n * l) * ((n * l) * (((U - U_42_) * U) * (2.0 / Om))))) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * 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_3 <= 0.0) tmp = sqrt(fma(Float64(n * 2.0), Float64(U * fma(n, 2.0, t)), Float64(-Float64(Float64(n * 2.0) * Float64(Float64(U * Float64(U - U_42_)) * t_1))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) - Float64(t_1 * Float64(U - U_42_))))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(fma(l, Float64(Float64(n * l) * Float64(4.0 * U)), Float64(Float64(n * l) * Float64(Float64(n * l) * Float64(Float64(Float64(U - U_42_) * U) * Float64(2.0 / Om))))) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * 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]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(n * 2.0 + t), $MachinePrecision]), $MachinePrecision] + (-N[(N[(n * 2.0), $MachinePrecision] * N[(N[(U * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] - N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(l * N[(N[(n * l), $MachinePrecision] * N[(4.0 * U), $MachinePrecision]), $MachinePrecision] + N[(N[(n * l), $MachinePrecision] * N[(N[(n * l), $MachinePrecision] * N[(N[(N[(U - U$42$), $MachinePrecision] * U), $MachinePrecision] * N[(2.0 / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t\_2 \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\_3 \leq 0:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(n \cdot 2, U \cdot \mathsf{fma}\left(n, 2, t\right), -\left(n \cdot 2\right) \cdot \left(\left(U \cdot \left(U - U*\right)\right) \cdot t\_1\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) - t\_1 \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\mathsf{fma}\left(\ell, \left(n \cdot \ell\right) \cdot \left(4 \cdot U\right), \left(n \cdot \ell\right) \cdot \left(\left(n \cdot \ell\right) \cdot \left(\left(\left(U - U*\right) \cdot U\right) \cdot \frac{2}{Om}\right)\right)\right)}{-Om}\right)}\\
\end{array}
\end{array}
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.0Initial program 17.4%
Applied rewrites36.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6436.8
Applied rewrites36.8%
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*))))) < +inf.0Initial program 67.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.0
Applied rewrites71.0%
if +inf.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*))))) Initial program 0.0%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites12.3%
Applied rewrites48.0%
Applied rewrites50.2%
Final simplification63.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (/ l Om) (* (/ l Om) n)))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
t_2
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_3 0.0)
(sqrt
(fma
(* n 2.0)
(* U (fma n 2.0 t))
(- (* (* n 2.0) (* (* U (- U U*)) t_1)))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (- (fma (* -2.0 l) (/ l Om) t) (* t_1 (- U U*)))))
(sqrt
(fma (* 2.0 U) (* n t) (/ (* (* l (* (* U l) n)) 4.0) (- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l / Om) * ((l / Om) * n);
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt(fma((n * 2.0), (U * fma(n, 2.0, t)), -((n * 2.0) * ((U * (U - U_42_)) * t_1))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * (fma((-2.0 * l), (l / Om), t) - (t_1 * (U - U_42_)))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (((l * ((U * l) * n)) * 4.0) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l / Om) * Float64(Float64(l / Om) * n)) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * 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_3 <= 0.0) tmp = sqrt(fma(Float64(n * 2.0), Float64(U * fma(n, 2.0, t)), Float64(-Float64(Float64(n * 2.0) * Float64(Float64(U * Float64(U - U_42_)) * t_1))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) - Float64(t_1 * Float64(U - U_42_))))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(Float64(Float64(l * Float64(Float64(U * l) * n)) * 4.0) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l / Om), $MachinePrecision] * N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * 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]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(n * 2.0), $MachinePrecision] * N[(U * N[(n * 2.0 + t), $MachinePrecision]), $MachinePrecision] + (-N[(N[(n * 2.0), $MachinePrecision] * N[(N[(U * N[(U - U$42$), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] - N[(t$95$1 * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(N[(l * N[(N[(U * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell}{Om} \cdot \left(\frac{\ell}{Om} \cdot n\right)\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t\_2 \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\_3 \leq 0:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(n \cdot 2, U \cdot \mathsf{fma}\left(n, 2, t\right), -\left(n \cdot 2\right) \cdot \left(\left(U \cdot \left(U - U*\right)\right) \cdot t\_1\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) - t\_1 \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\left(\ell \cdot \left(\left(U \cdot \ell\right) \cdot n\right)\right) \cdot 4}{-Om}\right)}\\
\end{array}
\end{array}
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.0Initial program 17.4%
Applied rewrites36.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6436.8
Applied rewrites36.8%
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*))))) < +inf.0Initial program 67.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6467.8
Applied rewrites67.8%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval71.0
Applied rewrites71.0%
if +inf.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*))))) Initial program 0.0%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites12.3%
Taylor expanded in n around 0
Applied rewrites9.6%
Applied rewrites31.9%
Final simplification60.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
t_2
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_3 2e-79)
(sqrt (* (fma (* U t) 2.0 (* (* U t_1) -4.0)) n))
(if (<= t_3 INFINITY)
(sqrt
(*
t_2
(-
(fma (* -2.0 l) (/ l Om) t)
(* (/ (* (* n l) l) (* Om Om)) (- U U*)))))
(sqrt
(fma (* 2.0 U) (* n t) (/ (* (* l (* (* U l) n)) 4.0) (- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_3 <= 2e-79) {
tmp = sqrt((fma((U * t), 2.0, ((U * t_1) * -4.0)) * n));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * (fma((-2.0 * l), (l / Om), t) - ((((n * l) * l) / (Om * Om)) * (U - U_42_)))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (((l * ((U * l) * n)) * 4.0) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_3 <= 2e-79) tmp = sqrt(Float64(fma(Float64(U * t), 2.0, Float64(Float64(U * t_1) * -4.0)) * n)); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) - Float64(Float64(Float64(Float64(n * l) * l) / Float64(Om * Om)) * Float64(U - U_42_))))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(Float64(Float64(l * Float64(Float64(U * l) * n)) * 4.0) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-79], N[Sqrt[N[(N[(N[(U * t), $MachinePrecision] * 2.0 + N[(N[(U * t$95$1), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] - N[(N[(N[(N[(n * l), $MachinePrecision] * l), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(N[(l * N[(N[(U * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-79}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(U \cdot t, 2, \left(U \cdot t\_1\right) \cdot -4\right) \cdot n}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) - \frac{\left(n \cdot \ell\right) \cdot \ell}{Om \cdot Om} \cdot \left(U - U*\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\left(\ell \cdot \left(\left(U \cdot \ell\right) \cdot n\right)\right) \cdot 4}{-Om}\right)}\\
\end{array}
\end{array}
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*))))) < 2e-79Initial program 50.2%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites45.5%
Taylor expanded in n around 0
Applied rewrites55.4%
if 2e-79 < (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*))))) < +inf.0Initial program 64.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6464.3
Applied rewrites64.3%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval67.9
Applied rewrites67.9%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6461.0
Applied rewrites61.0%
if +inf.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*))))) Initial program 0.0%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites12.3%
Taylor expanded in n around 0
Applied rewrites9.6%
Applied rewrites31.9%
Final simplification55.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(sqrt
(*
t_2
(- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*)))))))
(if (<= t_3 5e-146)
(sqrt (* n (fma -4.0 (/ (* U (* l l)) Om) (* 2.0 (* U t)))))
(if (<= t_3 2e+152)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(sqrt
(fma (* 2.0 U) (* n t) (/ (* (* l (* (* U l) n)) 4.0) (- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = sqrt((t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))));
double tmp;
if (t_3 <= 5e-146) {
tmp = sqrt((n * fma(-4.0, ((U * (l * l)) / Om), (2.0 * (U * t)))));
} else if (t_3 <= 2e+152) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (((l * ((U * l) * n)) * 4.0) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = sqrt(Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_))))) tmp = 0.0 if (t_3 <= 5e-146) tmp = sqrt(Float64(n * fma(-4.0, Float64(Float64(U * Float64(l * l)) / Om), Float64(2.0 * Float64(U * t))))); elseif (t_3 <= 2e+152) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(Float64(Float64(l * Float64(Float64(U * l) * n)) * 4.0) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 5e-146], N[Sqrt[N[(n * N[(-4.0 * N[(N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 2e+152], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(N[(l * N[(N[(U * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := \sqrt{t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)}\\
\mathbf{if}\;t\_3 \leq 5 \cdot 10^{-146}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(-4, \frac{U \cdot \left(\ell \cdot \ell\right)}{Om}, 2 \cdot \left(U \cdot t\right)\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+152}:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\left(\ell \cdot \left(\left(U \cdot \ell\right) \cdot n\right)\right) \cdot 4}{-Om}\right)}\\
\end{array}
\end{array}
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*))))) < 4.99999999999999957e-146Initial program 31.2%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites35.4%
Applied rewrites35.4%
Taylor expanded in n around 0
Applied rewrites42.2%
if 4.99999999999999957e-146 < (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*))))) < 2.0000000000000001e152Initial program 98.1%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6484.5
Applied rewrites84.5%
if 2.0000000000000001e152 < (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*))))) Initial program 19.1%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites18.0%
Taylor expanded in n around 0
Applied rewrites19.4%
Applied rewrites29.6%
Final simplification52.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 4e-291)
(sqrt (* n (fma -4.0 (/ (* U (* l l)) Om) (* 2.0 (* U t)))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(* (* (* l (sqrt 2.0)) (/ n Om)) (sqrt (* U* U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 4e-291) {
tmp = sqrt((n * fma(-4.0, ((U * (l * l)) / Om), (2.0 * (U * t)))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = ((l * sqrt(2.0)) * (n / Om)) * sqrt((U_42_ * U));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 4e-291) tmp = sqrt(Float64(n * fma(-4.0, Float64(Float64(U * Float64(l * l)) / Om), Float64(2.0 * Float64(U * t))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = Float64(Float64(Float64(l * sqrt(2.0)) * Float64(n / Om)) * sqrt(Float64(U_42_ * U))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 4e-291], N[Sqrt[N[(n * N[(-4.0 * N[(N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(n / Om), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 4 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(-4, \frac{U \cdot \left(\ell \cdot \ell\right)}{Om}, 2 \cdot \left(U \cdot t\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{n}{Om}\right) \cdot \sqrt{U* \cdot U}\\
\end{array}
\end{array}
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*)))) < 3.99999999999999985e-291Initial program 29.5%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites36.4%
Applied rewrites36.2%
Taylor expanded in n around 0
Applied rewrites42.6%
if 3.99999999999999985e-291 < (*.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.0Initial program 67.0%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.9
Applied rewrites55.9%
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*)))) Initial program 0.0%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f640.3
Applied rewrites0.3%
Taylor expanded in U* around -inf
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites19.7%
Applied rewrites19.7%
Final simplification48.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 4e-291)
(sqrt (* n (fma -4.0 (/ (* U (* l l)) Om) (* 2.0 (* U t)))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(* (* l (/ (* (sqrt 2.0) n) Om)) (sqrt (* U* U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 4e-291) {
tmp = sqrt((n * fma(-4.0, ((U * (l * l)) / Om), (2.0 * (U * t)))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = (l * ((sqrt(2.0) * n) / Om)) * sqrt((U_42_ * U));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 4e-291) tmp = sqrt(Float64(n * fma(-4.0, Float64(Float64(U * Float64(l * l)) / Om), Float64(2.0 * Float64(U * t))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = Float64(Float64(l * Float64(Float64(sqrt(2.0) * n) / Om)) * sqrt(Float64(U_42_ * U))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 4e-291], N[Sqrt[N[(n * N[(-4.0 * N[(N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(l * N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 4 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(-4, \frac{U \cdot \left(\ell \cdot \ell\right)}{Om}, 2 \cdot \left(U \cdot t\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\ell \cdot \frac{\sqrt{2} \cdot n}{Om}\right) \cdot \sqrt{U* \cdot U}\\
\end{array}
\end{array}
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*)))) < 3.99999999999999985e-291Initial program 29.5%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites36.4%
Applied rewrites36.2%
Taylor expanded in n around 0
Applied rewrites42.6%
if 3.99999999999999985e-291 < (*.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.0Initial program 67.0%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.9
Applied rewrites55.9%
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*)))) Initial program 0.0%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f640.3
Applied rewrites0.3%
Taylor expanded in U* around -inf
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
Applied rewrites19.7%
Applied rewrites19.7%
Final simplification48.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* (* 2.0 n) U))
(t_3
(* t_2 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_3 4e-291)
(sqrt (* n (fma -4.0 (/ (* U (* l l)) Om) (* 2.0 (* U t)))))
(if (<= t_3 INFINITY)
(sqrt (* t_2 (fma -2.0 t_1 t)))
(* (sqrt (* U* U)) (/ (* (* (sqrt 2.0) n) l) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = (2.0 * n) * U;
double t_3 = t_2 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_3 <= 4e-291) {
tmp = sqrt((n * fma(-4.0, ((U * (l * l)) / Om), (2.0 * (U * t)))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * fma(-2.0, t_1, t)));
} else {
tmp = sqrt((U_42_ * U)) * (((sqrt(2.0) * n) * l) / Om);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(Float64(2.0 * n) * U) t_3 = Float64(t_2 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_3 <= 4e-291) tmp = sqrt(Float64(n * fma(-4.0, Float64(Float64(U * Float64(l * l)) / Om), Float64(2.0 * Float64(U * t))))); elseif (t_3 <= Inf) tmp = sqrt(Float64(t_2 * fma(-2.0, t_1, t))); else tmp = Float64(sqrt(Float64(U_42_ * U)) * Float64(Float64(Float64(sqrt(2.0) * n) * l) / Om)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 4e-291], N[Sqrt[N[(n * N[(-4.0 * N[(N[(U * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 * N[(U * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Sqrt[N[(t$95$2 * N[(-2.0 * t$95$1 + t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \left(2 \cdot n\right) \cdot U\\
t_3 := t\_2 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_3 \leq 4 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{n \cdot \mathsf{fma}\left(-4, \frac{U \cdot \left(\ell \cdot \ell\right)}{Om}, 2 \cdot \left(U \cdot t\right)\right)}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\sqrt{t\_2 \cdot \mathsf{fma}\left(-2, t\_1, t\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U* \cdot U} \cdot \frac{\left(\sqrt{2} \cdot n\right) \cdot \ell}{Om}\\
\end{array}
\end{array}
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*)))) < 3.99999999999999985e-291Initial program 29.5%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites36.4%
Applied rewrites36.2%
Taylor expanded in n around 0
Applied rewrites42.6%
if 3.99999999999999985e-291 < (*.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.0Initial program 67.0%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.9
Applied rewrites55.9%
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*)))) Initial program 0.0%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f6419.7
Applied rewrites19.7%
Final simplification48.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (fma -2.0 t_1 t))
(t_3 (* (* 2.0 n) U))
(t_4
(* t_3 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_4 0.0)
(sqrt (* (* (* t_2 n) U) 2.0))
(if (<= t_4 INFINITY)
(sqrt (* t_3 t_2))
(* (sqrt (* U* U)) (/ (* (* (sqrt 2.0) n) l) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = fma(-2.0, t_1, t);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_2 * n) * U) * 2.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * t_2));
} else {
tmp = sqrt((U_42_ * U)) * (((sqrt(2.0) * n) * l) / Om);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = fma(-2.0, t_1, t) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_2 * n) * U) * 2.0)); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * t_2)); else tmp = Float64(sqrt(Float64(U_42_ * U)) * Float64(Float64(Float64(sqrt(2.0) * n) * l) / Om)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * t$95$1 + t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(t$95$2 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * t$95$2), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \mathsf{fma}\left(-2, t\_1, t\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t\_3 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_2 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{U* \cdot U} \cdot \frac{\left(\sqrt{2} \cdot n\right) \cdot \ell}{Om}\\
\end{array}
\end{array}
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.0Initial program 16.2%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6434.9
Applied rewrites34.9%
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.0Initial program 67.8%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6456.7
Applied rewrites56.7%
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*)))) Initial program 0.0%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f6419.7
Applied rewrites19.7%
Final simplification48.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (fma -2.0 t_1 t))
(t_3 (* (* 2.0 n) U))
(t_4
(* t_3 (- (- t (* 2.0 t_1)) (* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (or (<= t_4 0.0) (not (<= t_4 2e+304)))
(sqrt (* (* (* t_2 n) U) 2.0))
(sqrt (* t_3 t_2)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = fma(-2.0, t_1, t);
double t_3 = (2.0 * n) * U;
double t_4 = t_3 * ((t - (2.0 * t_1)) - ((n * pow((l / Om), 2.0)) * (U - U_42_)));
double tmp;
if ((t_4 <= 0.0) || !(t_4 <= 2e+304)) {
tmp = sqrt((((t_2 * n) * U) * 2.0));
} else {
tmp = sqrt((t_3 * t_2));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = fma(-2.0, t_1, t) t_3 = Float64(Float64(2.0 * n) * U) t_4 = Float64(t_3 * Float64(Float64(t - Float64(2.0 * t_1)) - Float64(Float64(n * (Float64(l / Om) ^ 2.0)) * Float64(U - U_42_)))) tmp = 0.0 if ((t_4 <= 0.0) || !(t_4 <= 2e+304)) tmp = sqrt(Float64(Float64(Float64(t_2 * n) * U) * 2.0)); else tmp = sqrt(Float64(t_3 * t_2)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * t$95$1 + t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[(N[(t - N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(n * N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$4, 0.0], N[Not[LessEqual[t$95$4, 2e+304]], $MachinePrecision]], N[Sqrt[N[(N[(N[(t$95$2 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$3 * t$95$2), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := \mathsf{fma}\left(-2, t\_1, t\right)\\
t_3 := \left(2 \cdot n\right) \cdot U\\
t_4 := t\_3 \cdot \left(\left(t - 2 \cdot t\_1\right) - \left(n \cdot {\left(\frac{\ell}{Om}\right)}^{2}\right) \cdot \left(U - U*\right)\right)\\
\mathbf{if}\;t\_4 \leq 0 \lor \neg \left(t\_4 \leq 2 \cdot 10^{+304}\right):\\
\;\;\;\;\sqrt{\left(\left(t\_2 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_2}\\
\end{array}
\end{array}
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 or 1.9999999999999999e304 < (*.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*)))) Initial program 18.7%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6422.6
Applied rewrites22.6%
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.9999999999999999e304Initial program 97.5%
Taylor expanded in n around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6484.0
Applied rewrites84.0%
Final simplification47.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(* (* 2.0 n) U)
(-
(- t (* 2.0 (/ (* l l) Om)))
(* (* n (pow (/ l Om) 2.0)) (- U U*))))))
(if (<= t_1 4e-291)
(sqrt (* (* (* U 2.0) t) n))
(if (<= t_1 2e+304)
(sqrt (* (* (* U n) 2.0) t))
(sqrt (* (* (* (fma 2.0 n t) n) U) 2.0))))))
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 <= 4e-291) {
tmp = sqrt((((U * 2.0) * t) * n));
} else if (t_1 <= 2e+304) {
tmp = sqrt((((U * n) * 2.0) * t));
} else {
tmp = sqrt((((fma(2.0, n, t) * n) * U) * 2.0));
}
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 <= 4e-291) tmp = sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)); elseif (t_1 <= 2e+304) tmp = sqrt(Float64(Float64(Float64(U * n) * 2.0) * t)); else tmp = sqrt(Float64(Float64(Float64(fma(2.0, n, t) * n) * U) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 4e-291], N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 2e+304], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(2.0 * n + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\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 4 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(2, n, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\end{array}
\end{array}
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*)))) < 3.99999999999999985e-291Initial program 29.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites35.5%
if 3.99999999999999985e-291 < (*.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.9999999999999999e304Initial program 98.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6465.7
Applied rewrites65.7%
Applied rewrites75.6%
if 1.9999999999999999e304 < (*.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*)))) Initial program 19.4%
Applied rewrites20.7%
Taylor expanded in l around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6412.5
Applied rewrites12.5%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(* (* 2.0 n) U)
(- (- t (* 2.0 (/ (* l l) Om))) (* (* n (pow (/ l Om) 2.0)) (- U U*))))
4e-291)
(sqrt (* (* (* U 2.0) t) n))
(sqrt (* (* (* U n) 2.0) t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * pow((l / Om), 2.0)) * (U - U_42_)))) <= 4e-291) {
tmp = sqrt((((U * 2.0) * t) * n));
} else {
tmp = sqrt((((U * n) * 2.0) * t));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if ((((2.0d0 * n) * u) * ((t - (2.0d0 * ((l * l) / om))) - ((n * ((l / om) ** 2.0d0)) * (u - u_42)))) <= 4d-291) then
tmp = sqrt((((u * 2.0d0) * t) * n))
else
tmp = sqrt((((u * n) * 2.0d0) * t))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * Math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 4e-291) {
tmp = Math.sqrt((((U * 2.0) * t) * n));
} else {
tmp = Math.sqrt((((U * n) * 2.0) * t));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if (((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * math.pow((l / Om), 2.0)) * (U - U_42_)))) <= 4e-291: tmp = math.sqrt((((U * 2.0) * t) * n)) else: tmp = math.sqrt((((U * n) * 2.0) * t)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (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_)))) <= 4e-291) tmp = sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)); else tmp = sqrt(Float64(Float64(Float64(U * n) * 2.0) * t)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if ((((2.0 * n) * U) * ((t - (2.0 * ((l * l) / Om))) - ((n * ((l / Om) ^ 2.0)) * (U - U_42_)))) <= 4e-291) tmp = sqrt((((U * 2.0) * t) * n)); else tmp = sqrt((((U * n) * 2.0) * t)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[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], 4e-291], N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\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 4 \cdot 10^{-291}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
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*)))) < 3.99999999999999985e-291Initial program 29.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6431.8
Applied rewrites31.8%
Applied rewrites35.5%
if 3.99999999999999985e-291 < (*.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*)))) Initial program 54.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6435.3
Applied rewrites35.3%
Applied rewrites38.4%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 1.4e-179)
(sqrt (* (* (* U 2.0) t) n))
(if (<= l 1e+20)
(sqrt
(*
(* (* 2.0 n) U)
(-
(fma (* -2.0 l) (/ l Om) t)
(* (/ (* (* n l) l) (* Om Om)) (- U U*)))))
(if (<= l 1.3e+154)
(sqrt
(*
-2.0
(-
(* (* (* l l) U) (* (fma (/ n Om) (/ (- U U*) Om) (/ 2.0 Om)) n))
(* (* n t) U))))
(sqrt
(fma (* 2.0 U) (* n t) (/ (* (* l (* (* U l) n)) 4.0) (- Om))))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.4e-179) {
tmp = sqrt((((U * 2.0) * t) * n));
} else if (l <= 1e+20) {
tmp = sqrt((((2.0 * n) * U) * (fma((-2.0 * l), (l / Om), t) - ((((n * l) * l) / (Om * Om)) * (U - U_42_)))));
} else if (l <= 1.3e+154) {
tmp = sqrt((-2.0 * ((((l * l) * U) * (fma((n / Om), ((U - U_42_) / Om), (2.0 / Om)) * n)) - ((n * t) * U))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (((l * ((U * l) * n)) * 4.0) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.4e-179) tmp = sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)); elseif (l <= 1e+20) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(fma(Float64(-2.0 * l), Float64(l / Om), t) - Float64(Float64(Float64(Float64(n * l) * l) / Float64(Om * Om)) * Float64(U - U_42_))))); elseif (l <= 1.3e+154) tmp = sqrt(Float64(-2.0 * Float64(Float64(Float64(Float64(l * l) * U) * Float64(fma(Float64(n / Om), Float64(Float64(U - U_42_) / Om), Float64(2.0 / Om)) * n)) - Float64(Float64(n * t) * U)))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(Float64(Float64(l * Float64(Float64(U * l) * n)) * 4.0) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.4e-179], N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1e+20], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(N[(N[(-2.0 * l), $MachinePrecision] * N[(l / Om), $MachinePrecision] + t), $MachinePrecision] - N[(N[(N[(N[(n * l), $MachinePrecision] * l), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * N[(U - U$42$), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.3e+154], N[Sqrt[N[(-2.0 * N[(N[(N[(N[(l * l), $MachinePrecision] * U), $MachinePrecision] * N[(N[(N[(n / Om), $MachinePrecision] * N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] + N[(2.0 / Om), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(n * t), $MachinePrecision] * U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(N[(l * N[(N[(U * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.4 \cdot 10^{-179}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}\\
\mathbf{elif}\;\ell \leq 10^{+20}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(\mathsf{fma}\left(-2 \cdot \ell, \frac{\ell}{Om}, t\right) - \frac{\left(n \cdot \ell\right) \cdot \ell}{Om \cdot Om} \cdot \left(U - U*\right)\right)}\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;\sqrt{-2 \cdot \left(\left(\left(\ell \cdot \ell\right) \cdot U\right) \cdot \left(\mathsf{fma}\left(\frac{n}{Om}, \frac{U - U*}{Om}, \frac{2}{Om}\right) \cdot n\right) - \left(n \cdot t\right) \cdot U\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\left(\ell \cdot \left(\left(U \cdot \ell\right) \cdot n\right)\right) \cdot 4}{-Om}\right)}\\
\end{array}
\end{array}
if l < 1.4e-179Initial program 53.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6436.9
Applied rewrites36.9%
Applied rewrites37.6%
if 1.4e-179 < l < 1e20Initial program 75.1%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6475.3
Applied rewrites75.3%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval75.3
Applied rewrites75.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6470.4
Applied rewrites70.4%
if 1e20 < l < 1.29999999999999994e154Initial program 43.7%
Taylor expanded in l around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
distribute-lft-out--N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites57.5%
if 1.29999999999999994e154 < l Initial program 5.7%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites4.3%
Taylor expanded in n around 0
Applied rewrites7.5%
Applied rewrites31.2%
Final simplification43.9%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= l 1.55e-184)
(sqrt (* (* (* U 2.0) t) n))
(if (<= l 5.2e+142)
(sqrt
(*
(* (* 2.0 n) U)
(- t (/ (* (* l l) (- (/ (* (- U U*) n) Om) -2.0)) Om))))
(sqrt (fma (* 2.0 U) (* n t) (/ (* (* l (* (* U l) n)) 4.0) (- Om)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.55e-184) {
tmp = sqrt((((U * 2.0) * t) * n));
} else if (l <= 5.2e+142) {
tmp = sqrt((((2.0 * n) * U) * (t - (((l * l) * ((((U - U_42_) * n) / Om) - -2.0)) / Om))));
} else {
tmp = sqrt(fma((2.0 * U), (n * t), (((l * ((U * l) * n)) * 4.0) / -Om)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.55e-184) tmp = sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)); elseif (l <= 5.2e+142) tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(t - Float64(Float64(Float64(l * l) * Float64(Float64(Float64(Float64(U - U_42_) * n) / Om) - -2.0)) / Om)))); else tmp = sqrt(fma(Float64(2.0 * U), Float64(n * t), Float64(Float64(Float64(l * Float64(Float64(U * l) * n)) * 4.0) / Float64(-Om)))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.55e-184], N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 5.2e+142], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(t - N[(N[(N[(l * l), $MachinePrecision] * N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] - -2.0), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(2.0 * U), $MachinePrecision] * N[(n * t), $MachinePrecision] + N[(N[(N[(l * N[(N[(U * l), $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / (-Om)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.55 \cdot 10^{-184}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}\\
\mathbf{elif}\;\ell \leq 5.2 \cdot 10^{+142}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(t - \frac{\left(\ell \cdot \ell\right) \cdot \left(\frac{\left(U - U*\right) \cdot n}{Om} - -2\right)}{Om}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(2 \cdot U, n \cdot t, \frac{\left(\ell \cdot \left(\left(U \cdot \ell\right) \cdot n\right)\right) \cdot 4}{-Om}\right)}\\
\end{array}
\end{array}
if l < 1.5500000000000001e-184Initial program 53.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6437.1
Applied rewrites37.1%
Applied rewrites37.7%
if 1.5500000000000001e-184 < l < 5.20000000000000043e142Initial program 63.6%
Taylor expanded in Om around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites56.9%
if 5.20000000000000043e142 < l Initial program 5.7%
Taylor expanded in Om around -inf
+-commutativeN/A
associate-*r*N/A
count-2-revN/A
lower-fma.f64N/A
count-2-revN/A
lower-*.f64N/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites4.9%
Taylor expanded in n around 0
Applied rewrites8.0%
Applied rewrites30.9%
Final simplification41.9%
(FPCore (n U t l Om U*) :precision binary64 (if (<= Om 1.42e+87) (sqrt (* (* (* (fma -2.0 (/ (* l l) Om) t) n) U) 2.0)) (sqrt (* (* (* U n) 2.0) t))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (Om <= 1.42e+87) {
tmp = sqrt((((fma(-2.0, ((l * l) / Om), t) * n) * U) * 2.0));
} else {
tmp = sqrt((((U * n) * 2.0) * t));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Om <= 1.42e+87) tmp = sqrt(Float64(Float64(Float64(fma(-2.0, Float64(Float64(l * l) / Om), t) * n) * U) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(U * n) * 2.0) * t)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[Om, 1.42e+87], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 1.42 \cdot 10^{+87}:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if Om < 1.42e87Initial program 50.6%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6445.1
Applied rewrites45.1%
if 1.42e87 < Om Initial program 51.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
Applied rewrites49.6%
(FPCore (n U t l Om U*) :precision binary64 (if (<= l 1.6e+114) (sqrt (* (* (* U n) 2.0) t)) (sqrt (* (* (* 2.0 n) U) (* -2.0 (/ (* l l) Om))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.6e+114) {
tmp = sqrt((((U * n) * 2.0) * t));
} else {
tmp = sqrt((((2.0 * n) * U) * (-2.0 * ((l * l) / Om))));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (l <= 1.6d+114) then
tmp = sqrt((((u * n) * 2.0d0) * t))
else
tmp = sqrt((((2.0d0 * n) * u) * ((-2.0d0) * ((l * l) / om))))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (l <= 1.6e+114) {
tmp = Math.sqrt((((U * n) * 2.0) * t));
} else {
tmp = Math.sqrt((((2.0 * n) * U) * (-2.0 * ((l * l) / Om))));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if l <= 1.6e+114: tmp = math.sqrt((((U * n) * 2.0) * t)) else: tmp = math.sqrt((((2.0 * n) * U) * (-2.0 * ((l * l) / Om)))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (l <= 1.6e+114) tmp = sqrt(Float64(Float64(Float64(U * n) * 2.0) * t)); else tmp = sqrt(Float64(Float64(Float64(2.0 * n) * U) * Float64(-2.0 * Float64(Float64(l * l) / Om)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (l <= 1.6e+114) tmp = sqrt((((U * n) * 2.0) * t)); else tmp = sqrt((((2.0 * n) * U) * (-2.0 * ((l * l) / Om)))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[l, 1.6e+114], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(2.0 * n), $MachinePrecision] * U), $MachinePrecision] * N[(-2.0 * N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.6 \cdot 10^{+114}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(2 \cdot n\right) \cdot U\right) \cdot \left(-2 \cdot \frac{\ell \cdot \ell}{Om}\right)}\\
\end{array}
\end{array}
if l < 1.6e114Initial program 56.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
Applied rewrites41.1%
if 1.6e114 < l Initial program 13.8%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6416.7
Applied rewrites16.7%
Taylor expanded in l around inf
mul-1-negN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r/N/A
metadata-evalN/A
lower-/.f6420.6
Applied rewrites20.6%
Taylor expanded in n around 0
Applied rewrites17.5%
(FPCore (n U t l Om U*) :precision binary64 (if (<= t 4.8e-250) (sqrt (* (* (* U n) 2.0) t)) (* (sqrt t) (sqrt (* U (* n 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 4.8e-250) {
tmp = sqrt((((U * n) * 2.0) * t));
} else {
tmp = sqrt(t) * sqrt((U * (n * 2.0)));
}
return tmp;
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
real(8) :: tmp
if (t <= 4.8d-250) then
tmp = sqrt((((u * n) * 2.0d0) * t))
else
tmp = sqrt(t) * sqrt((u * (n * 2.0d0)))
end if
code = tmp
end function
public static double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (t <= 4.8e-250) {
tmp = Math.sqrt((((U * n) * 2.0) * t));
} else {
tmp = Math.sqrt(t) * Math.sqrt((U * (n * 2.0)));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if t <= 4.8e-250: tmp = math.sqrt((((U * n) * 2.0) * t)) else: tmp = math.sqrt(t) * math.sqrt((U * (n * 2.0))) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (t <= 4.8e-250) tmp = sqrt(Float64(Float64(Float64(U * n) * 2.0) * t)); else tmp = Float64(sqrt(t) * sqrt(Float64(U * Float64(n * 2.0)))); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (t <= 4.8e-250) tmp = sqrt((((U * n) * 2.0) * t)); else tmp = sqrt(t) * sqrt((U * (n * 2.0))); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[t, 4.8e-250], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[t], $MachinePrecision] * N[Sqrt[N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{-250}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t} \cdot \sqrt{U \cdot \left(n \cdot 2\right)}\\
\end{array}
\end{array}
if t < 4.7999999999999998e-250Initial program 47.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6430.6
Applied rewrites30.6%
Applied rewrites32.3%
if 4.7999999999999998e-250 < t Initial program 54.3%
Applied rewrites34.7%
Taylor expanded in n around 0
lower-sqrt.f6445.0
Applied rewrites45.0%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* U 2.0) t) n)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((U * 2.0) * t) * n));
}
real(8) function code(n, u, t, l, om, u_42)
real(8), intent (in) :: n
real(8), intent (in) :: u
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: u_42
code = sqrt((((u * 2.0d0) * 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 * 2.0) * t) * n));
}
def code(n, U, t, l, Om, U_42_): return math.sqrt((((U * 2.0) * t) * n))
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)) end
function tmp = code(n, U, t, l, Om, U_42_) tmp = sqrt((((U * 2.0) * t) * n)); end
code[n_, U_, t_, l_, Om_, U$42$_] := N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}
\end{array}
Initial program 50.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6434.8
Applied rewrites34.8%
Applied rewrites35.2%
herbie shell --seed 2024337
(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*))))))