- if (f != 0) {
- clog << "e = pow(a+b,200).expand(); f = e.subs(a == -b); erroneously returned "
- << f << " instead of simplifying to 0." << endl;
- ++result;
- }
-
- return result;
+static unsigned exam_expand_power(void)
+{
+ unsigned result = 0;
+ symbol x("x"), a("a"), b("b");
+ ex e;
+
+ e = pow(x,pow(a+b,2)-pow(a,2)-pow(b,2)-a*b*2).expand();
+
+ if (e != 1) {
+ clog << "e = pow(x,pow(a+b,2)-pow(a,2)-pow(b,2)-a*b*2).expand(); erroneously returned "
+ << e << " instead of simplifying to 1." << endl;
+ ++result;
+ }
+
+ return result;