#include #include using namespace std; using namespace GiNaC; int main() { parser p; //This works fine ex e1 = p("(x+y)*(x+y+x*y)"); cout << "Input 1: " << e1.expand() << ", which is " << e1 << endl; ex f1 = factor(e1.expand()); cout << "Output 1: " << f1 << endl; //This runs forever ex e2 = p("(3*x+2*y)*(x+y+x*y)"); cout << "Input 2: " << e2.expand() << ", which is " << e2 << endl; ex f2 = factor(e2.expand()); cout << "Output 2: " << f2 << endl; return 0; }