From: Richard Kreckel Date: Mon, 19 Dec 2022 19:17:55 +0000 (+0100) Subject: Prefer CLN left shift operations over multiplications in factor(). X-Git-Tag: release_1-8-5~5 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=35a742a26893a534ddf1e51bd6d08f09dc927c43;p=ginac.git Prefer CLN left shift operations over multiplications in factor(). --- diff --git a/ginac/factor.cpp b/ginac/factor.cpp index 987ba168..0d3d4dd8 100644 --- a/ginac/factor.cpp +++ b/ginac/factor.cpp @@ -1235,7 +1235,7 @@ static void hensel_univar(const upoly& a_, unsigned int p, const umodpoly& u1_, // calc bound B int maxdeg = (degree(u1_) > degree(w1_)) ? degree(u1_) : degree(w1_); - cl_I maxmodulus = calc_bound(a) * ash(cl_I(1), maxdeg+1); // 2 * calc_bound(a) * 2^maxdeg + cl_I maxmodulus = ash(calc_bound(a), maxdeg+1); // = 2 * calc_bound(a) * 2^maxdeg // step 1 cl_I alpha = lcoeff(a); @@ -2357,7 +2357,7 @@ struct factorization_ctx { maxdeg = ufaclst[i].degree(x); } } - cl_I B = calc_bound(u, x) * ash(cl_I(1), maxdeg+1); // 2 * calc_bound(u,x) * 2^maxdeg + cl_I B = ash(calc_bound(u, x), maxdeg+1); // = 2 * calc_bound(u,x) * 2^maxdeg cl_I l = 1; cl_I pl = prime; while ( pl < B ) {