22 Sep
2004
22 Sep
'04
1:06 p.m.
Dear all, I found that the program #include <iostream> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { symbol x("x"),y("y"); ex e=sin(x)*sin(x); if(e.info(info_flags::polynomial)) cout << e << " is polynomial" << endl; else cout << e << " is not polynomial" << endl; e=sin(x)*sin(y); if(e.info(info_flags::polynomial)) cout << e << " is polynomial" << endl; else cout << e << " is not polynomial" << endl; return 0; } gives the output sin(x)^2 is polynomial sin(x)*sin(y) is not polynomial which I find very awkward. The attached patch unpolynomializes sin(x)^2. Best, Chris