+// Test of the patch of Stefan Weinzierl that prevents an infinite loop if
+// a factor in a product is a complicated way of writing zero.
+static unsigned exam_series13()
+{
+ unsigned result = 0;
+
+ ex e = (new mul(pow(2,x), (1/x*(-(1+x)/(1-x)) + (1+x)/x/(1-x)))
+ )->setflag(status_flags::evaluated);
+ ex d = Order(x);
+ result += check_series(e,0,d,1);
+
+ return result;
+}
+
+// Test if (1+x)^(1/x) can be expanded.
+static unsigned exam_series14()
+{
+ unsigned result = 0;
+
+ ex e = pow(1+x, sin(x)/x);
+ ex d = 1 + x - pow(x,3)/6 + Order(pow(x,4));
+ try {
+ result += check_series(e,0,d,4);
+ } catch (const pole_error& err) {
+ clog << "series expansion of " << e << " at 0 raised an exception." << endl;
+ ++result;
+ }
+
+ return result;
+}