[GiNaC-list] Ginac not collecting terms when multiplying powers (bug?)

Jonathan Mills jpamills at gmail.com
Mon Jul 20 01:18:59 CEST 2015


Consider this short programme:

#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;

int main()
possymbol x("x");
cout << pow(4,x + 1) * pow(4,-1) << endl;

The result produced is:
the expected output is

I can see that the documentation says these types of situations will
only be handled if it is "safe", but having specified x as a positive
value, I'm confused why this expression is not considered safe?

All the best

More information about the GiNaC-list mailing list