flag_accidental_zero = cln::zerop(t[k+1]);
t[k] = t[k] + t[k+1] * cln::expt(x[k], q+j-1-k) / cln::expt(cln::cl_I(q+j-1-k), s[k]);
}
+ q++;
+ t[j-1] = t[j-1] + cln::expt(x[j-1], q) / cln::expt(cln::cl_I(q),s[j-1]) * one;
+ for (int k=j-2; k>=0; k--) {
+ flag_accidental_zero = cln::zerop(t[k+1]);
+ t[k] = t[k] + t[k+1] * cln::expt(x[k], q+j-1-k) / cln::expt(cln::cl_I(q+j-1-k), s[k]);
+ }
} while ( (t[0] != t0buf) || flag_accidental_zero );
return t[0];
if (x.op(x.nops()-1).is_zero()) {
need_trafo = true;
}
- if (depth == 1 && !need_trafo) {
+ if (depth == 1 && x.nops() == 2 && !need_trafo) {
return -Li(x.nops(), y / x.op(x.nops()-1)).evalf();
}