[GiNaC-list] Fwd: GiNaC Bug Report

Mark Round mround at risc.jku.at
Fri Aug 29 15:48:08 CEST 2014


Dear all,

The GiNaC feature is_polynomial() returns true in a scenario I feel is
false.  Namely,

1/(1-x)

When running the attached code I obtain,

-(-1+x)^(-1).is_polynomial(x) 1
x-(-1+x)^(-1).is_polynomial(x) 0

as output.

I observed the result on two computers,

MacBook Pro Darwin Kernel version 13.1.0 using GiNaC 1.6.2
64-bit DESY blade server scientific linux 2.6.18-371.1.2.el5 using GiNaC 
1.6.2

Additionally, in preparing this report the following variations occurred,

1/(1-pow(x,2)) -> is polynomial
1/(1-pow(x,n)) -> is not polynomial (n being a symbol)
1/(1+x) -> is not polynomial

on an SL6 installation running kernel version 
2.6.32-431.20.3.el6.x86_64, gcc 4.4.7) using GiNaC 1.6.2

Yours,

Mark



-------------- next part --------------
#include <iostream>
#include <ginac/ginac.h>

using namespace std;
using namespace GiNaC;

int main(){
	symbol x("x");
	ex e1 = pow(1-x,-1);
	ex e2 = e1 + x;
	cout << e1 << ".is_polynomial(x) "<< e1.is_polynomial (x) << endl;
	cout << e2 << ".is_polynomial(x) "<< e2.is_polynomial (x) << endl;

	return 0;

}



More information about the GiNaC-list mailing list