return 0;
}
+// Bug in power expansion
+unsigned exam_paranoia27()
+{
+ unsigned result = 0;
+ symbol x("x"), y("y"), a("a");
+ possymbol s("s"), t("t");
+ exmap pwrs =
+ { {pow((x+1)*(y-2)*(s-3)*(t+4), a), pow((x+1)*(y-2)*(s-3), a)*pow(t+4, a)},
+ {pow(2*(x+1)*(y-2)*(s-3)*(t+4), a), pow(2,a)*pow((x+1)*(y-2)*(s-3), a)*pow(t+4, a)},
+ {pow(-(x+1)*(y-2)*(s-3)*(t+4), a), pow(-(x+1)*(y-2)*(s-3), a)*pow(t+4, a)},
+ {pow(-2*(x+1)*(y-2)*(s-3)*(t+4), a), pow(2,a)*pow(-(x+1)*(y-2)*(s-3), a)*pow(t+4, a)} };
+
+ for (auto e : pwrs) {
+ if (! (e.first.expand()).is_equal(e.second) ) {
+ clog << "power expansion of " << e.first << " produces error.\n";
+ ++result;
+ }
+ }
+
+ return result;
+}
+
unsigned exam_paranoia()
{
unsigned result = 0;
result += exam_paranoia24(); cout << '.' << flush;
result += exam_paranoia25(); cout << '.' << flush;
result += exam_paranoia26(); cout << '.' << flush;
+ result += exam_paranoia27(); cout << '.' << flush;
return result;
}
ex coeff=(possign? _ex1 : _ex_1);
if (m.overall_coeff.info(info_flags::positive) && m.overall_coeff != _ex1)
prodseq.push_back(pow(m.overall_coeff, exponent));
- else if (m.overall_coeff.info(info_flags::negative) && m.overall_coeff != _ex_1)
+ else if (m.overall_coeff.info(info_flags::negative) && m.overall_coeff != _ex_1) {
prodseq.push_back(pow(-m.overall_coeff, exponent));
- else
+ coeff = -coeff;
+ } else
coeff *= m.overall_coeff;
// If positive/negative factors are found, then extract them.