return 0;
}
+// Bug in power::expand (fixed 2015-07-18).
+static unsigned exam_paranoia22()
+{
+ symbol x("x"), y("y");
+ ex e = pow(sqrt(1+x)+y*sqrt(1+x), 2).expand();
+ if (e.nops() != 6) {
+ clog << "(sqrt(1+x)+y*sqrt(1+x))^2 was wrongly expanded to " << e << "\n";
+ return 1;
+ }
+ return 0;
+}
+
unsigned exam_paranoia()
{
unsigned result = 0;
result += exam_paranoia20(); cout << '.' << flush;
result += is_polynomial_false_positive(); cout << '.' << flush;
result += exam_paranoia21(); cout << '.' << flush;
+ result += exam_paranoia22(); cout << '.' << flush;
return result;
}
for (epvector::const_iterator cit1=cit0+1; cit1!=last; ++cit1) {
const ex & r1 = cit1->rest;
const ex & c1 = cit1->coeff;
- sum.push_back(a.combine_ex_with_coeff_to_pair((new mul(r,r1))->setflag(status_flags::dynallocated),
+ sum.push_back(a.combine_ex_with_coeff_to_pair(mul(r,r1).expand(options),
_num2_p->mul(ex_to<numeric>(c)).mul_dyn(ex_to<numeric>(c1))));
}
}
GINAC_ASSERT(sum.size()==(a.seq.size()*(a.seq.size()+1))/2);
- // second part: add terms coming from overall_factor (if != 0)
+ // second part: add terms coming from overall_coeff (if != 0)
if (!a.overall_coeff.is_zero()) {
epvector::const_iterator i = a.seq.begin(), end = a.seq.end();
while (i != end) {