From 35a742a26893a534ddf1e51bd6d08f09dc927c43 Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Mon, 19 Dec 2022 20:17:55 +0100 Subject: [PATCH] Prefer CLN left shift operations over multiplications in factor(). --- ginac/factor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ) { -- 2.47.0