#include using namespace GiNaC; int main() { symbol a,c,u; ex poly=-c*u+c*a+(u-a)*c; sqrfree(poly.expand()); //OK sqrfree(factor(poly)); //OK sqrfree(poly); //throws return 0; }