X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fnormal.cpp;h=fffdc925b09fe5d4e83040f153ed97d258a12c26;hb=a50cca9ebc390b6ba1d2f17f03bd18ebea7fb970;hp=d23b2289d520aa535bd0dd6fb43b6e43080536a7;hpb=2db113296f65f8fd3a0d62781ddc9276ff07b487;p=ginac.git diff --git a/ginac/normal.cpp b/ginac/normal.cpp index d23b2289..fffdc925 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -811,6 +811,8 @@ ex ex::primpart(const symbol &x, const ex &c) const static ex sr_gcd(const ex &a, const ex &b, const symbol *x) { +//clog << "sr_gcd(" << a << "," << b << ")\n"; + // Sort c and d so that c has higher degree ex c, d; int adeg = a.degree(*x), bdeg = b.degree(*x); @@ -1021,6 +1023,9 @@ class gcdheu_failed {}; static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const_iterator var) { +//clog << "heur_gcd(" << a << "," << b << ")\n"; + + // Trivial cases if (is_ex_exactly_of_type(a, numeric) && is_ex_exactly_of_type(b, numeric)) { numeric g = gcd(ex_to_numeric(a), ex_to_numeric(b)); numeric rg; @@ -1053,8 +1058,10 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const // 6 tries maximum for (int t=0; t<6; t++) { - if (xi.int_length() * maxdeg > 50000) + if (xi.int_length() * maxdeg > 100000) { +//clog << "giving up heur_gcd, xi.int_length = " << xi.int_length() << ", maxdeg = " << maxdeg << endl; throw gcdheu_failed(); + } // Apply evaluation homomorphism and calculate GCD ex gamma = heur_gcd(p.subs(*x == xi), q.subs(*x == xi), NULL, NULL, var+1).expand(); @@ -1622,7 +1629,7 @@ ex pseries::normal(lst &sym_lst, lst &repl_lst, int level) const new_seq.push_back(expair(it->rest.normal(), it->coeff)); it++; } - ex n = pseries(var, point, new_seq); + ex n = pseries(relational(var,point), new_seq); return (new lst(replace_with_symbol(n, sym_lst, repl_lst), _ex1()))->setflag(status_flags::dynallocated); }