
(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 20 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 (* U (* n 2.0)))
(t_2 (* (pow (/ l Om) 2.0) n))
(t_3 (/ (* l l) Om))
(t_4 (sqrt (* (- (* (- U* U) t_2) (- (* t_3 2.0) t)) t_1))))
(if (<= t_4 0.0)
(sqrt
(*
(fma
(* (* (/ (* (- U U*) n) Om) (* l l)) (/ U Om))
-2.0
(* (* (fma t_3 -2.0 t) U) 2.0))
n))
(if (<= t_4 INFINITY)
(sqrt (* (- (fma (* -2.0 (/ l Om)) l t) (* (- U U*) t_2)) t_1))
(sqrt
(fma
(* (* (fma (- U U*) (/ n Om) 2.0) l) (* -2.0 U))
(* (/ n Om) l)
(* (* (* t n) U) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = pow((l / Om), 2.0) * n;
double t_3 = (l * l) / Om;
double t_4 = sqrt(((((U_42_ - U) * t_2) - ((t_3 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((fma((((((U - U_42_) * n) / Om) * (l * l)) * (U / Om)), -2.0, ((fma(t_3, -2.0, t) * U) * 2.0)) * n));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt(((fma((-2.0 * (l / Om)), l, t) - ((U - U_42_) * t_2)) * t_1));
} else {
tmp = sqrt(fma(((fma((U - U_42_), (n / Om), 2.0) * l) * (-2.0 * U)), ((n / Om) * l), (((t * n) * U) * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64((Float64(l / Om) ^ 2.0) * n) t_3 = Float64(Float64(l * l) / Om) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * t_2) - Float64(Float64(t_3 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(fma(Float64(Float64(Float64(Float64(Float64(U - U_42_) * n) / Om) * Float64(l * l)) * Float64(U / Om)), -2.0, Float64(Float64(fma(t_3, -2.0, t) * U) * 2.0)) * n)); elseif (t_4 <= Inf) tmp = sqrt(Float64(Float64(fma(Float64(-2.0 * Float64(l / Om)), l, t) - Float64(Float64(U - U_42_) * t_2)) * t_1)); else tmp = sqrt(fma(Float64(Float64(fma(Float64(U - U_42_), Float64(n / Om), 2.0) * l) * Float64(-2.0 * U)), Float64(Float64(n / Om) * l), Float64(Float64(Float64(t * n) * U) * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(N[(t$95$3 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(U / Om), $MachinePrecision]), $MachinePrecision] * -2.0 + N[(N[(N[(t$95$3 * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(N[(N[(-2.0 * N[(l / Om), $MachinePrecision]), $MachinePrecision] * l + t), $MachinePrecision] - N[(N[(U - U$42$), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision] * l), $MachinePrecision] * N[(-2.0 * U), $MachinePrecision]), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision] + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := {\left(\frac{\ell}{Om}\right)}^{2} \cdot n\\
t_3 := \frac{\ell \cdot \ell}{Om}\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot t\_2 - \left(t\_3 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\left(U - U*\right) \cdot n}{Om} \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{U}{Om}, -2, \left(\mathsf{fma}\left(t\_3, -2, t\right) \cdot U\right) \cdot 2\right) \cdot n}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(-2 \cdot \frac{\ell}{Om}, \ell, t\right) - \left(U - U*\right) \cdot t\_2\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right) \cdot \ell\right) \cdot \left(-2 \cdot U\right), \frac{n}{Om} \cdot \ell, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\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 15.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.5
Applied rewrites47.5%
Taylor expanded in n around 0
Applied rewrites54.1%
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 68.1%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval73.0
Applied rewrites73.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 t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites37.9%
Applied rewrites43.5%
Applied rewrites56.7%
Final simplification67.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* (* (* t n) U) 2.0))
(t_2 (* U (* n 2.0)))
(t_3 (/ (* l l) Om))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_3 2.0) t))
t_2))))
(if (<= t_4 2e-152)
(sqrt (fma (/ (* (* (* l l) n) U) Om) -4.0 t_1))
(if (<= t_4 5e+139)
(sqrt (* (fma -2.0 t_3 t) t_2))
(if (<= t_4 INFINITY)
(sqrt (fma (* (* (/ l Om) U) (* l n)) -4.0 t_1))
(sqrt (* (/ (* (* (* (* (* U* U) l) n) l) n) (* Om Om)) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = ((t * n) * U) * 2.0;
double t_2 = U * (n * 2.0);
double t_3 = (l * l) / Om;
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_3 * 2.0) - t)) * t_2));
double tmp;
if (t_4 <= 2e-152) {
tmp = sqrt(fma(((((l * l) * n) * U) / Om), -4.0, t_1));
} else if (t_4 <= 5e+139) {
tmp = sqrt((fma(-2.0, t_3, t) * t_2));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt(fma((((l / Om) * U) * (l * n)), -4.0, t_1));
} else {
tmp = sqrt((((((((U_42_ * U) * l) * n) * l) * n) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(t * n) * U) * 2.0) t_2 = Float64(U * Float64(n * 2.0)) t_3 = Float64(Float64(l * l) / Om) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_3 * 2.0) - t)) * t_2)) tmp = 0.0 if (t_4 <= 2e-152) tmp = sqrt(fma(Float64(Float64(Float64(Float64(l * l) * n) * U) / Om), -4.0, t_1)); elseif (t_4 <= 5e+139) tmp = sqrt(Float64(fma(-2.0, t_3, t) * t_2)); elseif (t_4 <= Inf) tmp = sqrt(fma(Float64(Float64(Float64(l / Om) * U) * Float64(l * n)), -4.0, t_1)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(Float64(Float64(U_42_ * U) * l) * n) * l) * n) / Float64(Om * Om)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$3 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 2e-152], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 5e+139], N[Sqrt[N[(N[(-2.0 * t$95$3 + t), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * U), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * -4.0 + t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(N[(N[(U$42$ * U), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\\
t_2 := U \cdot \left(n \cdot 2\right)\\
t_3 := \frac{\ell \cdot \ell}{Om}\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_3 \cdot 2 - t\right)\right) \cdot t\_2}\\
\mathbf{if}\;t\_4 \leq 2 \cdot 10^{-152}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot U}{Om}, -4, t\_1\right)}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+139}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2, t\_3, t\right) \cdot t\_2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\ell}{Om} \cdot U\right) \cdot \left(\ell \cdot n\right), -4, t\_1\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\left(\left(U* \cdot U\right) \cdot \ell\right) \cdot n\right) \cdot \ell\right) \cdot n}{Om \cdot Om} \cdot 2}\\
\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*))))) < 2.00000000000000013e-152Initial program 19.2%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6452.5
Applied rewrites52.5%
if 2.00000000000000013e-152 < (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*))))) < 5.0000000000000003e139Initial program 98.8%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.3
Applied rewrites82.3%
if 5.0000000000000003e139 < (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 35.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6427.8
Applied rewrites27.8%
Applied rewrites33.4%
Applied rewrites36.8%
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 t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
Applied rewrites37.3%
Final simplification54.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3 (fma -2.0 t_2 t))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_4 0.0)
(sqrt (* (* (* t_3 n) U) 2.0))
(if (<= t_4 5e+139)
(sqrt (* t_3 t_1))
(if (<= t_4 INFINITY)
(sqrt (fma (* (* (/ l Om) U) (* l n)) -4.0 (* (* (* t n) U) 2.0)))
(sqrt (* (/ (* (* (* (* (* U* U) l) n) l) n) (* Om Om)) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = fma(-2.0, t_2, t);
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_3 * n) * U) * 2.0));
} else if (t_4 <= 5e+139) {
tmp = sqrt((t_3 * t_1));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt(fma((((l / Om) * U) * (l * n)), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = sqrt((((((((U_42_ * U) * l) * n) * l) * n) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = fma(-2.0, t_2, t) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_3 * n) * U) * 2.0)); elseif (t_4 <= 5e+139) tmp = sqrt(Float64(t_3 * t_1)); elseif (t_4 <= Inf) tmp = sqrt(fma(Float64(Float64(Float64(l / Om) * U) * Float64(l * n)), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(Float64(Float64(U_42_ * U) * l) * n) * l) * n) / Float64(Om * Om)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * t$95$2 + t), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(t$95$3 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 5e+139], N[Sqrt[N[(t$95$3 * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * U), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(N[(N[(U$42$ * U), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \mathsf{fma}\left(-2, t\_2, t\right)\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_3 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+139}:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\ell}{Om} \cdot U\right) \cdot \left(\ell \cdot n\right), -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\left(\left(U* \cdot U\right) \cdot \ell\right) \cdot n\right) \cdot \ell\right) \cdot n}{Om \cdot Om} \cdot 2}\\
\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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*))))) < 5.0000000000000003e139Initial program 98.3%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6481.1
Applied rewrites81.1%
if 5.0000000000000003e139 < (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 35.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6427.8
Applied rewrites27.8%
Applied rewrites33.4%
Applied rewrites36.8%
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 t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
Applied rewrites37.3%
Final simplification54.6%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3 (fma -2.0 t_2 t))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_4 0.0)
(sqrt (* (* (* t_3 n) U) 2.0))
(if (<= t_4 5e+139)
(sqrt (* t_3 t_1))
(if (<= t_4 INFINITY)
(sqrt (fma (* (/ (* (* U n) l) Om) l) -4.0 (* (* (* t n) U) 2.0)))
(sqrt (* (/ (* (* (* (* (* U* U) l) n) l) n) (* Om Om)) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = fma(-2.0, t_2, t);
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_3 * n) * U) * 2.0));
} else if (t_4 <= 5e+139) {
tmp = sqrt((t_3 * t_1));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt(fma(((((U * n) * l) / Om) * l), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = sqrt((((((((U_42_ * U) * l) * n) * l) * n) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = fma(-2.0, t_2, t) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_3 * n) * U) * 2.0)); elseif (t_4 <= 5e+139) tmp = sqrt(Float64(t_3 * t_1)); elseif (t_4 <= Inf) tmp = sqrt(fma(Float64(Float64(Float64(Float64(U * n) * l) / Om) * l), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(Float64(Float64(U_42_ * U) * l) * n) * l) * n) / Float64(Om * Om)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * t$95$2 + t), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(t$95$3 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 5e+139], N[Sqrt[N[(t$95$3 * t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(N[(N[(N[(N[(U * n), $MachinePrecision] * l), $MachinePrecision] / Om), $MachinePrecision] * l), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(N[(N[(U$42$ * U), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \mathsf{fma}\left(-2, t\_2, t\right)\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_3 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+139}:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(U \cdot n\right) \cdot \ell}{Om} \cdot \ell, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\left(\left(U* \cdot U\right) \cdot \ell\right) \cdot n\right) \cdot \ell\right) \cdot n}{Om \cdot Om} \cdot 2}\\
\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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*))))) < 5.0000000000000003e139Initial program 98.3%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6481.1
Applied rewrites81.1%
if 5.0000000000000003e139 < (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 35.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6427.8
Applied rewrites27.8%
Applied rewrites33.4%
Applied rewrites36.6%
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 t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f643.9
Applied rewrites3.9%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
Applied rewrites37.3%
Final simplification54.5%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_3 0.0)
(sqrt
(*
(fma
(* (* (/ (* (- U U*) n) Om) (* l l)) (/ U Om))
-2.0
(* (* (fma t_2 -2.0 t) U) 2.0))
n))
(if (<= t_3 1e+153)
(sqrt
(* (fma (* (* (/ l Om) n) (- U* U)) (/ l Om) (fma -2.0 t_2 t)) t_1))
(sqrt
(fma
(* (* (fma (- U U*) (/ n Om) 2.0) l) (* -2.0 U))
(* (/ n Om) l)
(* (* (* t n) U) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_3 <= 0.0) {
tmp = sqrt((fma((((((U - U_42_) * n) / Om) * (l * l)) * (U / Om)), -2.0, ((fma(t_2, -2.0, t) * U) * 2.0)) * n));
} else if (t_3 <= 1e+153) {
tmp = sqrt((fma((((l / Om) * n) * (U_42_ - U)), (l / Om), fma(-2.0, t_2, t)) * t_1));
} else {
tmp = sqrt(fma(((fma((U - U_42_), (n / Om), 2.0) * l) * (-2.0 * U)), ((n / Om) * l), (((t * n) * U) * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_3 <= 0.0) tmp = sqrt(Float64(fma(Float64(Float64(Float64(Float64(Float64(U - U_42_) * n) / Om) * Float64(l * l)) * Float64(U / Om)), -2.0, Float64(Float64(fma(t_2, -2.0, t) * U) * 2.0)) * n)); elseif (t_3 <= 1e+153) tmp = sqrt(Float64(fma(Float64(Float64(Float64(l / Om) * n) * Float64(U_42_ - U)), Float64(l / Om), fma(-2.0, t_2, t)) * t_1)); else tmp = sqrt(fma(Float64(Float64(fma(Float64(U - U_42_), Float64(n / Om), 2.0) * l) * Float64(-2.0 * U)), Float64(Float64(n / Om) * l), Float64(Float64(Float64(t * n) * U) * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[Sqrt[N[(N[(N[(N[(N[(N[(N[(U - U$42$), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(U / Om), $MachinePrecision]), $MachinePrecision] * -2.0 + N[(N[(N[(t$95$2 * -2.0 + t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 1e+153], N[Sqrt[N[(N[(N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] * N[(l / Om), $MachinePrecision] + N[(-2.0 * t$95$2 + t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision] * l), $MachinePrecision] * N[(-2.0 * U), $MachinePrecision]), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision] + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\left(U - U*\right) \cdot n}{Om} \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{U}{Om}, -2, \left(\mathsf{fma}\left(t\_2, -2, t\right) \cdot U\right) \cdot 2\right) \cdot n}\\
\mathbf{elif}\;t\_3 \leq 10^{+153}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\ell}{Om} \cdot n\right) \cdot \left(U* - U\right), \frac{\ell}{Om}, \mathsf{fma}\left(-2, t\_2, t\right)\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right) \cdot \ell\right) \cdot \left(-2 \cdot U\right), \frac{n}{Om} \cdot \ell, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\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 15.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.5
Applied rewrites47.5%
Taylor expanded in n around 0
Applied rewrites54.1%
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*))))) < 1e153Initial program 98.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6498.2
lift--.f64N/A
sub-negN/A
Applied rewrites98.2%
if 1e153 < (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.4%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites33.5%
Applied rewrites37.8%
Applied rewrites46.6%
Final simplification66.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (fma (- U U*) (/ n Om) 2.0))
(t_2 (* U (* n 2.0)))
(t_3 (/ (* l l) Om))
(t_4
(sqrt
(* (- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_3 2.0) t)) t_2)))
(t_5 (* (* (* t n) U) 2.0)))
(if (<= t_4 2e-152)
(sqrt (fma (* -2.0 U) (* (/ (* t_1 (* l l)) Om) n) t_5))
(if (<= t_4 1e+153)
(sqrt
(* (fma (* (* (/ l Om) n) (- U* U)) (/ l Om) (fma -2.0 t_3 t)) t_2))
(sqrt (fma (* (* t_1 l) (* -2.0 U)) (* (/ n Om) l) t_5))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = fma((U - U_42_), (n / Om), 2.0);
double t_2 = U * (n * 2.0);
double t_3 = (l * l) / Om;
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_3 * 2.0) - t)) * t_2));
double t_5 = ((t * n) * U) * 2.0;
double tmp;
if (t_4 <= 2e-152) {
tmp = sqrt(fma((-2.0 * U), (((t_1 * (l * l)) / Om) * n), t_5));
} else if (t_4 <= 1e+153) {
tmp = sqrt((fma((((l / Om) * n) * (U_42_ - U)), (l / Om), fma(-2.0, t_3, t)) * t_2));
} else {
tmp = sqrt(fma(((t_1 * l) * (-2.0 * U)), ((n / Om) * l), t_5));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = fma(Float64(U - U_42_), Float64(n / Om), 2.0) t_2 = Float64(U * Float64(n * 2.0)) t_3 = Float64(Float64(l * l) / Om) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_3 * 2.0) - t)) * t_2)) t_5 = Float64(Float64(Float64(t * n) * U) * 2.0) tmp = 0.0 if (t_4 <= 2e-152) tmp = sqrt(fma(Float64(-2.0 * U), Float64(Float64(Float64(t_1 * Float64(l * l)) / Om) * n), t_5)); elseif (t_4 <= 1e+153) tmp = sqrt(Float64(fma(Float64(Float64(Float64(l / Om) * n) * Float64(U_42_ - U)), Float64(l / Om), fma(-2.0, t_3, t)) * t_2)); else tmp = sqrt(fma(Float64(Float64(t_1 * l) * Float64(-2.0 * U)), Float64(Float64(n / Om) * l), t_5)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$3 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[t$95$4, 2e-152], N[Sqrt[N[(N[(-2.0 * U), $MachinePrecision] * N[(N[(N[(t$95$1 * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision] * n), $MachinePrecision] + t$95$5), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+153], N[Sqrt[N[(N[(N[(N[(N[(l / Om), $MachinePrecision] * n), $MachinePrecision] * N[(U$42$ - U), $MachinePrecision]), $MachinePrecision] * N[(l / Om), $MachinePrecision] + N[(-2.0 * t$95$3 + t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(t$95$1 * l), $MachinePrecision] * N[(-2.0 * U), $MachinePrecision]), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision] + t$95$5), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right)\\
t_2 := U \cdot \left(n \cdot 2\right)\\
t_3 := \frac{\ell \cdot \ell}{Om}\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_3 \cdot 2 - t\right)\right) \cdot t\_2}\\
t_5 := \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\\
\mathbf{if}\;t\_4 \leq 2 \cdot 10^{-152}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2 \cdot U, \frac{t\_1 \cdot \left(\ell \cdot \ell\right)}{Om} \cdot n, t\_5\right)}\\
\mathbf{elif}\;t\_4 \leq 10^{+153}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\ell}{Om} \cdot n\right) \cdot \left(U* - U\right), \frac{\ell}{Om}, \mathsf{fma}\left(-2, t\_3, t\right)\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(t\_1 \cdot \ell\right) \cdot \left(-2 \cdot U\right), \frac{n}{Om} \cdot \ell, t\_5\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*))))) < 2.00000000000000013e-152Initial program 19.2%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites55.6%
if 2.00000000000000013e-152 < (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*))))) < 1e153Initial program 98.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f6498.6
lift--.f64N/A
sub-negN/A
Applied rewrites98.6%
if 1e153 < (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.4%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites33.5%
Applied rewrites37.8%
Applied rewrites46.6%
Final simplification66.8%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (fma (- U U*) (/ n Om) 2.0))
(t_3 (/ (* l l) Om))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_3 2.0) t))
t_1))))
(if (<= t_4 0.0)
(sqrt (* (* (* (fma -2.0 t_3 t) n) U) 2.0))
(if (<= t_4 1e+153)
(sqrt (* (- t (/ (* t_2 (* l l)) Om)) t_1))
(sqrt
(fma
(* (* t_2 l) (* -2.0 U))
(* (/ n Om) l)
(* (* (* t n) U) 2.0)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = fma((U - U_42_), (n / Om), 2.0);
double t_3 = (l * l) / Om;
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_3 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((fma(-2.0, t_3, t) * n) * U) * 2.0));
} else if (t_4 <= 1e+153) {
tmp = sqrt(((t - ((t_2 * (l * l)) / Om)) * t_1));
} else {
tmp = sqrt(fma(((t_2 * l) * (-2.0 * U)), ((n / Om) * l), (((t * n) * U) * 2.0)));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = fma(Float64(U - U_42_), Float64(n / Om), 2.0) t_3 = Float64(Float64(l * l) / Om) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_3 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(fma(-2.0, t_3, t) * n) * U) * 2.0)); elseif (t_4 <= 1e+153) tmp = sqrt(Float64(Float64(t - Float64(Float64(t_2 * Float64(l * l)) / Om)) * t_1)); else tmp = sqrt(fma(Float64(Float64(t_2 * l) * Float64(-2.0 * U)), Float64(Float64(n / Om) * l), Float64(Float64(Float64(t * n) * U) * 2.0))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(U - U$42$), $MachinePrecision] * N[(n / Om), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$3 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(N[(-2.0 * t$95$3 + t), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+153], N[Sqrt[N[(N[(t - N[(N[(t$95$2 * N[(l * l), $MachinePrecision]), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(t$95$2 * l), $MachinePrecision] * N[(-2.0 * U), $MachinePrecision]), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision] + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \mathsf{fma}\left(U - U*, \frac{n}{Om}, 2\right)\\
t_3 := \frac{\ell \cdot \ell}{Om}\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_3 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(\mathsf{fma}\left(-2, t\_3, t\right) \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq 10^{+153}:\\
\;\;\;\;\sqrt{\left(t - \frac{t\_2 \cdot \left(\ell \cdot \ell\right)}{Om}\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(t\_2 \cdot \ell\right) \cdot \left(-2 \cdot U\right), \frac{n}{Om} \cdot \ell, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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*))))) < 1e153Initial program 98.3%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
cancel-sign-sub-invN/A
associate-*r/N/A
div-subN/A
lower-/.f64N/A
Applied rewrites89.0%
if 1e153 < (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.4%
Taylor expanded in t around 0
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites33.5%
Applied rewrites37.8%
Applied rewrites46.6%
Final simplification63.3%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_3 2e-152)
(sqrt (fma (/ (* (* (* l l) n) U) Om) -4.0 (* (* (* t n) U) 2.0)))
(if (<= t_3 2e+150)
(sqrt (* (fma -2.0 t_2 t) t_1))
(sqrt (* (* (/ (* (* (* U* U) l) n) Om) (* (/ n Om) l)) 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_3 <= 2e-152) {
tmp = sqrt(fma(((((l * l) * n) * U) / Om), -4.0, (((t * n) * U) * 2.0)));
} else if (t_3 <= 2e+150) {
tmp = sqrt((fma(-2.0, t_2, t) * t_1));
} else {
tmp = sqrt(((((((U_42_ * U) * l) * n) / Om) * ((n / Om) * l)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_3 <= 2e-152) tmp = sqrt(fma(Float64(Float64(Float64(Float64(l * l) * n) * U) / Om), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); elseif (t_3 <= 2e+150) tmp = sqrt(Float64(fma(-2.0, t_2, t) * t_1)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(Float64(U_42_ * U) * l) * n) / Om) * Float64(Float64(n / Om) * l)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 2e-152], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 2e+150], N[Sqrt[N[(N[(-2.0 * t$95$2 + t), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(N[(U$42$ * U), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * N[(N[(n / Om), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{-152}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot U}{Om}, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+150}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2, t\_2, t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\frac{\left(\left(U* \cdot U\right) \cdot \ell\right) \cdot n}{Om} \cdot \left(\frac{n}{Om} \cdot \ell\right)\right) \cdot 2}\\
\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*))))) < 2.00000000000000013e-152Initial program 19.2%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6452.5
Applied rewrites52.5%
if 2.00000000000000013e-152 < (sqrt.f64 (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) n) U) (-.f64 (-.f64 t (*.f64 #s(literal 2 binary64) (/.f64 (*.f64 l l) Om))) (*.f64 (*.f64 n (pow.f64 (/.f64 l Om) #s(literal 2 binary64))) (-.f64 U U*))))) < 1.99999999999999996e150Initial program 98.8%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.1
Applied rewrites82.1%
if 1.99999999999999996e150 < (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 20.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f649.3
Applied rewrites9.3%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6431.0
Applied rewrites31.0%
Applied rewrites36.4%
Final simplification54.9%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3 (fma -2.0 t_2 t))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_4 0.0)
(sqrt (* (* (* t_3 n) U) 2.0))
(if (<= t_4 1e+153)
(sqrt (* t_3 t_1))
(sqrt (* (/ (* (* (* (* l n) n) (* U* U)) l) (* Om Om)) 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = fma(-2.0, t_2, t);
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_3 * n) * U) * 2.0));
} else if (t_4 <= 1e+153) {
tmp = sqrt((t_3 * t_1));
} else {
tmp = sqrt(((((((l * n) * n) * (U_42_ * U)) * l) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = fma(-2.0, t_2, t) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_3 * n) * U) * 2.0)); elseif (t_4 <= 1e+153) tmp = sqrt(Float64(t_3 * t_1)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(Float64(l * n) * n) * Float64(U_42_ * U)) * l) / Float64(Om * Om)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * t$95$2 + t), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(t$95$3 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+153], N[Sqrt[N[(t$95$3 * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(N[(l * n), $MachinePrecision] * n), $MachinePrecision] * N[(U$42$ * U), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \mathsf{fma}\left(-2, t\_2, t\right)\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_3 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq 10^{+153}:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\left(\ell \cdot n\right) \cdot n\right) \cdot \left(U* \cdot U\right)\right) \cdot \ell}{Om \cdot Om} \cdot 2}\\
\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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*))))) < 1e153Initial program 98.3%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6480.1
Applied rewrites80.1%
if 1e153 < (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.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f649.3
Applied rewrites9.3%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6431.2
Applied rewrites31.2%
Applied rewrites31.2%
Final simplification52.2%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3 (fma -2.0 t_2 t))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_4 0.0)
(sqrt (* (* (* t_3 n) U) 2.0))
(if (<= t_4 1e+153)
(sqrt (* t_3 t_1))
(sqrt (* (/ (* (* (* l n) (* l n)) (* U* U)) (* Om Om)) 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = fma(-2.0, t_2, t);
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_3 * n) * U) * 2.0));
} else if (t_4 <= 1e+153) {
tmp = sqrt((t_3 * t_1));
} else {
tmp = sqrt((((((l * n) * (l * n)) * (U_42_ * U)) / (Om * Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = fma(-2.0, t_2, t) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_3 * n) * U) * 2.0)); elseif (t_4 <= 1e+153) tmp = sqrt(Float64(t_3 * t_1)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * n) * Float64(l * n)) * Float64(U_42_ * U)) / Float64(Om * Om)) * 2.0)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * t$95$2 + t), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(t$95$3 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, 1e+153], N[Sqrt[N[(t$95$3 * t$95$1), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * n), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * N[(U$42$ * U), $MachinePrecision]), $MachinePrecision] / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \mathsf{fma}\left(-2, t\_2, t\right)\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_3 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq 10^{+153}:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\left(\left(\ell \cdot n\right) \cdot \left(\ell \cdot n\right)\right) \cdot \left(U* \cdot U\right)}{Om \cdot Om} \cdot 2}\\
\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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*))))) < 1e153Initial program 98.3%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6480.1
Applied rewrites80.1%
if 1e153 < (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.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f649.3
Applied rewrites9.3%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6431.2
Applied rewrites31.2%
Final simplification52.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (* U (* n 2.0)))
(t_2 (/ (* l l) Om))
(t_3 (fma -2.0 t_2 t))
(t_4
(sqrt
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_2 2.0) t))
t_1))))
(if (<= t_4 0.0)
(sqrt (* (* (* t_3 n) U) 2.0))
(if (<= t_4 INFINITY)
(sqrt (* t_3 t_1))
(* (/ (* (* (sqrt 2.0) n) l) Om) (sqrt (* U* U)))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = U * (n * 2.0);
double t_2 = (l * l) / Om;
double t_3 = fma(-2.0, t_2, t);
double t_4 = sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_2 * 2.0) - t)) * t_1));
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_3 * n) * U) * 2.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_3 * t_1));
} else {
tmp = (((sqrt(2.0) * n) * l) / Om) * sqrt((U_42_ * U));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(U * Float64(n * 2.0)) t_2 = Float64(Float64(l * l) / Om) t_3 = fma(-2.0, t_2, t) t_4 = sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_2 * 2.0) - t)) * t_1)) tmp = 0.0 if (t_4 <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_3 * n) * U) * 2.0)); elseif (t_4 <= Inf) tmp = sqrt(Float64(t_3 * t_1)); else tmp = Float64(Float64(Float64(Float64(sqrt(2.0) * n) * l) / Om) * sqrt(Float64(U_42_ * U))); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * t$95$2 + t), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$2 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.0], N[Sqrt[N[(N[(N[(t$95$3 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Sqrt[N[(t$95$3 * t$95$1), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * n), $MachinePrecision] * l), $MachinePrecision] / Om), $MachinePrecision] * N[Sqrt[N[(U$42$ * U), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := U \cdot \left(n \cdot 2\right)\\
t_2 := \frac{\ell \cdot \ell}{Om}\\
t_3 := \mathsf{fma}\left(-2, t\_2, t\right)\\
t_4 := \sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_2 \cdot 2 - t\right)\right) \cdot t\_1}\\
\mathbf{if}\;t\_4 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_3 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\sqrt{t\_3 \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\sqrt{2} \cdot n\right) \cdot \ell}{Om} \cdot \sqrt{U* \cdot U}\\
\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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 68.1%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.4
Applied rewrites55.4%
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 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.f6424.7
Applied rewrites24.7%
Final simplification49.1%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1 (/ (* l l) Om))
(t_2 (* U (* n 2.0)))
(t_3
(* (- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_1 2.0) t)) t_2)))
(if (<= t_3 4e-304)
(sqrt (fma (/ (* (* (* l l) n) U) Om) -4.0 (* (* (* t n) U) 2.0)))
(if (<= t_3 5e+300)
(sqrt (* (fma -2.0 t_1 t) t_2))
(sqrt (* (* (* (* (/ l Om) l) n) (/ (* (* U* U) n) Om)) 2.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (l * l) / Om;
double t_2 = U * (n * 2.0);
double t_3 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_1 * 2.0) - t)) * t_2;
double tmp;
if (t_3 <= 4e-304) {
tmp = sqrt(fma(((((l * l) * n) * U) / Om), -4.0, (((t * n) * U) * 2.0)));
} else if (t_3 <= 5e+300) {
tmp = sqrt((fma(-2.0, t_1, t) * t_2));
} else {
tmp = sqrt((((((l / Om) * l) * n) * (((U_42_ * U) * n) / Om)) * 2.0));
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(l * l) / Om) t_2 = Float64(U * Float64(n * 2.0)) t_3 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_1 * 2.0) - t)) * t_2) tmp = 0.0 if (t_3 <= 4e-304) tmp = sqrt(fma(Float64(Float64(Float64(Float64(l * l) * n) * U) / Om), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); elseif (t_3 <= 5e+300) tmp = sqrt(Float64(fma(-2.0, t_1, t) * t_2)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l / Om) * l) * n) * Float64(Float64(Float64(U_42_ * U) * n) / Om)) * 2.0)); 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[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, 4e-304], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] * U), $MachinePrecision] / Om), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$3, 5e+300], N[Sqrt[N[(N[(-2.0 * t$95$1 + t), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l / Om), $MachinePrecision] * l), $MachinePrecision] * n), $MachinePrecision] * N[(N[(N[(U$42$ * U), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{Om}\\
t_2 := U \cdot \left(n \cdot 2\right)\\
t_3 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_1 \cdot 2 - t\right)\right) \cdot t\_2\\
\mathbf{if}\;t\_3 \leq 4 \cdot 10^{-304}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\frac{\left(\left(\ell \cdot \ell\right) \cdot n\right) \cdot U}{Om}, -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(-2, t\_1, t\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(\left(\frac{\ell}{Om} \cdot \ell\right) \cdot n\right) \cdot \frac{\left(U* \cdot U\right) \cdot n}{Om}\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.99999999999999988e-304Initial program 16.6%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6448.1
Applied rewrites48.1%
if 3.99999999999999988e-304 < (*.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*)))) < 5.00000000000000026e300Initial program 98.8%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6482.1
Applied rewrites82.1%
if 5.00000000000000026e300 < (*.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 20.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f649.5
Applied rewrites9.5%
Taylor expanded in U* around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
unpow2N/A
unswap-sqrN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6431.3
Applied rewrites31.3%
Applied rewrites35.4%
Final simplification54.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 (* U (* n 2.0)))
(t_4
(* (- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_1 2.0) t)) t_3)))
(if (<= t_4 0.0)
(sqrt (* (* (* t_2 n) U) 2.0))
(if (<= t_4 INFINITY)
(sqrt (* t_2 t_3))
(sqrt (* (* (/ U (* Om Om)) (* (* n n) (* U* (* l l)))) 2.0))))))
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 = U * (n * 2.0);
double t_4 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_1 * 2.0) - t)) * t_3;
double tmp;
if (t_4 <= 0.0) {
tmp = sqrt((((t_2 * n) * U) * 2.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = sqrt((t_2 * t_3));
} else {
tmp = sqrt((((U / (Om * Om)) * ((n * n) * (U_42_ * (l * l)))) * 2.0));
}
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(U * Float64(n * 2.0)) t_4 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_1 * 2.0) - t)) * t_3) 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_2 * t_3)); else tmp = sqrt(Float64(Float64(Float64(U / Float64(Om * Om)) * Float64(Float64(n * n) * Float64(U_42_ * Float64(l * l)))) * 2.0)); 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[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$3), $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$2 * t$95$3), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(U / N[(Om * Om), $MachinePrecision]), $MachinePrecision] * N[(N[(n * n), $MachinePrecision] * N[(U$42$ * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $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 := U \cdot \left(n \cdot 2\right)\\
t_4 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_1 \cdot 2 - t\right)\right) \cdot t\_3\\
\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\_2 \cdot t\_3}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\frac{U}{Om \cdot Om} \cdot \left(\left(n \cdot n\right) \cdot \left(U* \cdot \left(\ell \cdot \ell\right)\right)\right)\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*)))) < 0.0Initial program 13.0%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6449.2
Applied rewrites49.2%
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 68.1%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.4
Applied rewrites55.4%
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
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6435.7
Applied rewrites35.7%
Final simplification51.0%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(*
(-
(* (- U* U) (* (pow (/ l Om) 2.0) n))
(- (* (/ (* l l) Om) 2.0) t))
(* U (* n 2.0)))))
(if (<= t_1 0.0)
(sqrt (* (* (* U 2.0) t) n))
(if (<= t_1 5e+305)
(sqrt (* (* (* U n) t) 2.0))
(sqrt (* (* (/ (* (* l l) n) Om) U) -4.0))))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = (((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0));
double tmp;
if (t_1 <= 0.0) {
tmp = sqrt((((U * 2.0) * t) * n));
} else if (t_1 <= 5e+305) {
tmp = sqrt((((U * n) * t) * 2.0));
} else {
tmp = sqrt((((((l * l) * n) / Om) * U) * -4.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) :: t_1
real(8) :: tmp
t_1 = (((u_42 - u) * (((l / om) ** 2.0d0) * n)) - ((((l * l) / om) * 2.0d0) - t)) * (u * (n * 2.0d0))
if (t_1 <= 0.0d0) then
tmp = sqrt((((u * 2.0d0) * t) * n))
else if (t_1 <= 5d+305) then
tmp = sqrt((((u * n) * t) * 2.0d0))
else
tmp = sqrt((((((l * l) * n) / om) * u) * (-4.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 t_1 = (((U_42_ - U) * (Math.pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0));
double tmp;
if (t_1 <= 0.0) {
tmp = Math.sqrt((((U * 2.0) * t) * n));
} else if (t_1 <= 5e+305) {
tmp = Math.sqrt((((U * n) * t) * 2.0));
} else {
tmp = Math.sqrt((((((l * l) * n) / Om) * U) * -4.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): t_1 = (((U_42_ - U) * (math.pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0)) tmp = 0 if t_1 <= 0.0: tmp = math.sqrt((((U * 2.0) * t) * n)) elif t_1 <= 5e+305: tmp = math.sqrt((((U * n) * t) * 2.0)) else: tmp = math.sqrt((((((l * l) * n) / Om) * U) * -4.0)) return tmp
function code(n, U, t, l, Om, U_42_) t_1 = Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(Float64(Float64(l * l) / Om) * 2.0) - t)) * Float64(U * Float64(n * 2.0))) tmp = 0.0 if (t_1 <= 0.0) tmp = sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)); elseif (t_1 <= 5e+305) tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); else tmp = sqrt(Float64(Float64(Float64(Float64(Float64(l * l) * n) / Om) * U) * -4.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) t_1 = (((U_42_ - U) * (((l / Om) ^ 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0)); tmp = 0.0; if (t_1 <= 0.0) tmp = sqrt((((U * 2.0) * t) * n)); elseif (t_1 <= 5e+305) tmp = sqrt((((U * n) * t) * 2.0)); else tmp = sqrt((((((l * l) * n) / Om) * U) * -4.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 5e+305], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * U), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(\frac{\ell \cdot \ell}{Om} \cdot 2 - t\right)\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\frac{\left(\ell \cdot \ell\right) \cdot n}{Om} \cdot U\right) \cdot -4}\\
\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 13.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6441.0
Applied rewrites41.0%
Applied rewrites43.8%
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*)))) < 5.00000000000000009e305Initial program 98.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6463.2
Applied rewrites63.2%
Applied rewrites73.1%
if 5.00000000000000009e305 < (*.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 20.2%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6418.6
Applied rewrites18.6%
Taylor expanded in t around 0
Applied rewrites15.0%
Final simplification40.6%
(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 (* U (* n 2.0))))
(if (<=
(sqrt
(* (- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* t_1 2.0) t)) t_3))
0.0)
(sqrt (* (* (* t_2 n) U) 2.0))
(sqrt (* t_2 t_3)))))
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 = U * (n * 2.0);
double tmp;
if (sqrt(((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((t_1 * 2.0) - t)) * t_3)) <= 0.0) {
tmp = sqrt((((t_2 * n) * U) * 2.0));
} else {
tmp = sqrt((t_2 * t_3));
}
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(U * Float64(n * 2.0)) tmp = 0.0 if (sqrt(Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(t_1 * 2.0) - t)) * t_3)) <= 0.0) tmp = sqrt(Float64(Float64(Float64(t_2 * n) * U) * 2.0)); else tmp = sqrt(Float64(t_2 * t_3)); 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[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Sqrt[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(t$95$1 * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]], $MachinePrecision], 0.0], N[Sqrt[N[(N[(N[(t$95$2 * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(t$95$2 * t$95$3), $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 := U \cdot \left(n \cdot 2\right)\\
\mathbf{if}\;\sqrt{\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(t\_1 \cdot 2 - t\right)\right) \cdot t\_3} \leq 0:\\
\;\;\;\;\sqrt{\left(\left(t\_2 \cdot n\right) \cdot U\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{t\_2 \cdot t\_3}\\
\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 15.3%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
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*))))) Initial program 52.8%
Taylor expanded in Om around inf
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6444.1
Applied rewrites44.1%
Final simplification45.2%
(FPCore (n U t l Om U*)
:precision binary64
(if (<=
(*
(- (* (- U* U) (* (pow (/ l Om) 2.0) n)) (- (* (/ (* l l) Om) 2.0) t))
(* U (* n 2.0)))
0.0)
(sqrt (* (* (* U 2.0) t) n))
(sqrt (* (* (* U n) t) 2.0))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (((((U_42_ - U) * (pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0))) <= 0.0) {
tmp = sqrt((((U * 2.0) * t) * n));
} else {
tmp = sqrt((((U * n) * t) * 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 (((((u_42 - u) * (((l / om) ** 2.0d0) * n)) - ((((l * l) / om) * 2.0d0) - t)) * (u * (n * 2.0d0))) <= 0.0d0) then
tmp = sqrt((((u * 2.0d0) * t) * n))
else
tmp = sqrt((((u * n) * t) * 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 (((((U_42_ - U) * (Math.pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0))) <= 0.0) {
tmp = Math.sqrt((((U * 2.0) * t) * n));
} else {
tmp = Math.sqrt((((U * n) * t) * 2.0));
}
return tmp;
}
def code(n, U, t, l, Om, U_42_): tmp = 0 if ((((U_42_ - U) * (math.pow((l / Om), 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0))) <= 0.0: tmp = math.sqrt((((U * 2.0) * t) * n)) else: tmp = math.sqrt((((U * n) * t) * 2.0)) return tmp
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (Float64(Float64(Float64(Float64(U_42_ - U) * Float64((Float64(l / Om) ^ 2.0) * n)) - Float64(Float64(Float64(Float64(l * l) / Om) * 2.0) - t)) * Float64(U * Float64(n * 2.0))) <= 0.0) tmp = sqrt(Float64(Float64(Float64(U * 2.0) * t) * n)); else tmp = sqrt(Float64(Float64(Float64(U * n) * t) * 2.0)); end return tmp end
function tmp_2 = code(n, U, t, l, Om, U_42_) tmp = 0.0; if (((((U_42_ - U) * (((l / Om) ^ 2.0) * n)) - ((((l * l) / Om) * 2.0) - t)) * (U * (n * 2.0))) <= 0.0) tmp = sqrt((((U * 2.0) * t) * n)); else tmp = sqrt((((U * n) * t) * 2.0)); end tmp_2 = tmp; end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[N[(N[(N[(N[(U$42$ - U), $MachinePrecision] * N[(N[Power[N[(l / Om), $MachinePrecision], 2.0], $MachinePrecision] * n), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(l * l), $MachinePrecision] / Om), $MachinePrecision] * 2.0), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[Sqrt[N[(N[(N[(U * 2.0), $MachinePrecision] * t), $MachinePrecision] * n), $MachinePrecision]], $MachinePrecision], N[Sqrt[N[(N[(N[(U * n), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(U* - U\right) \cdot \left({\left(\frac{\ell}{Om}\right)}^{2} \cdot n\right) - \left(\frac{\ell \cdot \ell}{Om} \cdot 2 - t\right)\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right) \leq 0:\\
\;\;\;\;\sqrt{\left(\left(U \cdot 2\right) \cdot t\right) \cdot n}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\left(U \cdot n\right) \cdot t\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*)))) < 0.0Initial program 13.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6441.0
Applied rewrites41.0%
Applied rewrites43.8%
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*)))) Initial program 54.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6432.7
Applied rewrites32.7%
Applied rewrites36.1%
Final simplification37.2%
(FPCore (n U t l Om U*)
:precision binary64
(if (<= n -21.0)
(sqrt (* (- t (/ (* (/ (* (* l l) n) Om) (- U*)) Om)) (* U (* n 2.0))))
(if (<= n 1.35e-56)
(sqrt (fma (* (* (/ l Om) U) (* l n)) -4.0 (* (* (* t n) U) 2.0)))
(*
(sqrt
(* (* (fma (* (- l) l) (/ (fma (/ (- U U*) Om) n 2.0) Om) t) U) 2.0))
(sqrt n)))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double tmp;
if (n <= -21.0) {
tmp = sqrt(((t - (((((l * l) * n) / Om) * -U_42_) / Om)) * (U * (n * 2.0))));
} else if (n <= 1.35e-56) {
tmp = sqrt(fma((((l / Om) * U) * (l * n)), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = sqrt(((fma((-l * l), (fma(((U - U_42_) / Om), n, 2.0) / Om), t) * U) * 2.0)) * sqrt(n);
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) tmp = 0.0 if (n <= -21.0) tmp = sqrt(Float64(Float64(t - Float64(Float64(Float64(Float64(Float64(l * l) * n) / Om) * Float64(-U_42_)) / Om)) * Float64(U * Float64(n * 2.0)))); elseif (n <= 1.35e-56) tmp = sqrt(fma(Float64(Float64(Float64(l / Om) * U) * Float64(l * n)), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = Float64(sqrt(Float64(Float64(fma(Float64(Float64(-l) * l), Float64(fma(Float64(Float64(U - U_42_) / Om), n, 2.0) / Om), t) * U) * 2.0)) * sqrt(n)); end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := If[LessEqual[n, -21.0], N[Sqrt[N[(N[(t - N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * (-U$42$)), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 1.35e-56], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * U), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(N[(N[((-l) * l), $MachinePrecision] * N[(N[(N[(N[(U - U$42$), $MachinePrecision] / Om), $MachinePrecision] * n + 2.0), $MachinePrecision] / Om), $MachinePrecision] + t), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[n], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -21:\\
\;\;\;\;\sqrt{\left(t - \frac{\frac{\left(\ell \cdot \ell\right) \cdot n}{Om} \cdot \left(-U*\right)}{Om}\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{elif}\;n \leq 1.35 \cdot 10^{-56}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\ell}{Om} \cdot U\right) \cdot \left(\ell \cdot n\right), -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\left(\mathsf{fma}\left(\left(-\ell\right) \cdot \ell, \frac{\mathsf{fma}\left(\frac{U - U*}{Om}, n, 2\right)}{Om}, t\right) \cdot U\right) \cdot 2} \cdot \sqrt{n}\\
\end{array}
\end{array}
if n < -21Initial program 52.6%
Taylor expanded in Om around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6431.4
Applied rewrites31.4%
Taylor expanded in Om around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites61.9%
Taylor expanded in U* around inf
Applied rewrites62.1%
if -21 < n < 1.34999999999999997e-56Initial program 41.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites54.1%
Applied rewrites59.5%
if 1.34999999999999997e-56 < n Initial program 56.7%
Taylor expanded in Om around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6437.0
Applied rewrites37.0%
Taylor expanded in Om around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites62.8%
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites67.5%
Final simplification62.4%
(FPCore (n U t l Om U*)
:precision binary64
(let* ((t_1
(sqrt
(* (- t (/ (* (/ (* (* l l) n) Om) (- U*)) Om)) (* U (* n 2.0))))))
(if (<= n -21.0)
t_1
(if (<= n 2.2e-50)
(sqrt (fma (* (* (/ l Om) U) (* l n)) -4.0 (* (* (* t n) U) 2.0)))
t_1))))
double code(double n, double U, double t, double l, double Om, double U_42_) {
double t_1 = sqrt(((t - (((((l * l) * n) / Om) * -U_42_) / Om)) * (U * (n * 2.0))));
double tmp;
if (n <= -21.0) {
tmp = t_1;
} else if (n <= 2.2e-50) {
tmp = sqrt(fma((((l / Om) * U) * (l * n)), -4.0, (((t * n) * U) * 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(n, U, t, l, Om, U_42_) t_1 = sqrt(Float64(Float64(t - Float64(Float64(Float64(Float64(Float64(l * l) * n) / Om) * Float64(-U_42_)) / Om)) * Float64(U * Float64(n * 2.0)))) tmp = 0.0 if (n <= -21.0) tmp = t_1; elseif (n <= 2.2e-50) tmp = sqrt(fma(Float64(Float64(Float64(l / Om) * U) * Float64(l * n)), -4.0, Float64(Float64(Float64(t * n) * U) * 2.0))); else tmp = t_1; end return tmp end
code[n_, U_, t_, l_, Om_, U$42$_] := Block[{t$95$1 = N[Sqrt[N[(N[(t - N[(N[(N[(N[(N[(l * l), $MachinePrecision] * n), $MachinePrecision] / Om), $MachinePrecision] * (-U$42$)), $MachinePrecision] / Om), $MachinePrecision]), $MachinePrecision] * N[(U * N[(n * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -21.0], t$95$1, If[LessEqual[n, 2.2e-50], N[Sqrt[N[(N[(N[(N[(l / Om), $MachinePrecision] * U), $MachinePrecision] * N[(l * n), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(N[(N[(t * n), $MachinePrecision] * U), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sqrt{\left(t - \frac{\frac{\left(\ell \cdot \ell\right) \cdot n}{Om} \cdot \left(-U*\right)}{Om}\right) \cdot \left(U \cdot \left(n \cdot 2\right)\right)}\\
\mathbf{if}\;n \leq -21:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;n \leq 2.2 \cdot 10^{-50}:\\
\;\;\;\;\sqrt{\mathsf{fma}\left(\left(\frac{\ell}{Om} \cdot U\right) \cdot \left(\ell \cdot n\right), -4, \left(\left(t \cdot n\right) \cdot U\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if n < -21 or 2.1999999999999999e-50 < n Initial program 55.0%
Taylor expanded in Om around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower--.f6434.6
Applied rewrites34.6%
Taylor expanded in Om around -inf
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
Applied rewrites62.4%
Taylor expanded in U* around inf
Applied rewrites62.6%
if -21 < n < 2.1999999999999999e-50Initial program 41.8%
Taylor expanded in Om around inf
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6447.1
Applied rewrites47.1%
Applied rewrites54.1%
Applied rewrites59.5%
Final simplification61.1%
(FPCore (n U t l Om U*) :precision binary64 (sqrt (* (* (* (fma -2.0 (/ (* l l) Om) t) n) U) 2.0)))
double code(double n, double U, double t, double l, double Om, double U_42_) {
return sqrt((((fma(-2.0, ((l * l) / Om), t) * n) * U) * 2.0));
}
function code(n, U, t, l, Om, U_42_) return sqrt(Float64(Float64(Float64(fma(-2.0, Float64(Float64(l * l) / Om), t) * n) * U) * 2.0)) end
code[n_, U_, t_, l_, Om_, U$42$_] := 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]
\begin{array}{l}
\\
\sqrt{\left(\left(\mathsf{fma}\left(-2, \frac{\ell \cdot \ell}{Om}, t\right) \cdot n\right) \cdot U\right) \cdot 2}
\end{array}
Initial program 48.5%
Taylor expanded in n around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6442.4
Applied rewrites42.4%
(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 48.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6433.8
Applied rewrites33.8%
Applied rewrites32.9%
Final simplification32.9%
herbie shell --seed 2024250
(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*))))))