[GiNaC-list] Ginac not collecting terms when multiplying powers (bug?)
Jonathan Mills
jpamills at gmail.com
Mon Jul 20 01:18:59 CEST 2015
Hello
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:
1/4*4^(1+x),
the expected output is
4^x.
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
Jonathan
More information about the GiNaC-list
mailing list