[GiNaC-list] is_polynomial gives strange results
florent.hivert at univ-rouen.fr
Thu May 19 23:35:29 CEST 2011
I'm a regular user of GiNaC through PyNaC and Sage and I'm usually very happy
with it. Good work guys !
However during on of my class I was quite surprised by a result from
Sage. I've been able to trace back the result to GiNaC so I'd like to report
it here. Note that it's the first time I go into the arcane of GiNaC so I may
Here is a code that reproduce the problem:
using namespace std;
using namespace GiNaC;
poly = sqrt(x*x+1)*sqrt(x+1);
cout << poly << endl;
cout << poly.is_polynomial(x) << endl;
The output is:
popcorn-*/Sage-Work/GiNaC $ ./ginac
so that sqrt(1+x)*sqrt(1+x^2) is considered as a polynomial in x !
Here are the standard info:
I just installed cln-1.3.2.tar.bz2 and ginac-1.5.8.tar.bz2 from the sources.
popcorn-~/install $ c++ --version
c++ (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]
popcorn-~/install $ uname -a
Linux popcorn.rouba.net 126.96.36.199-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 x86_64 x86_64 x86_64 GNU/Linux
More information about the GiNaC-list