Hi,

I modified the first benchmark at http://www.ginac.de/csSC-0004015.pdf to,

e = expanded value of  (a0 + a1 + sqrt(3)*a2 + sqrt(3)*a3 + ... + sqrt(3)*a(n-1))^2

in e, substitute a0 with  -sqrt(3)*a2 - sqrt(3)*a3 - ... - sqrt(3)*a(n-1)

expand e again to obtain a1^2


For n = 4, I get,

 -3*a3^2+2*3*a2^2+a1^2-6*a2^2+3*a3^2

Or 

3*a3^2-3*a2^2-3*a3^2+a1^2+3*a2^2

which is true, but not the expression I expected. Why are the terms 3*a2^2 and -3*a2^2, not canceled out immediately? Also a term like 2*3*a2^2 means there is some bug right?

I am using ginac-1.6.3 on Ubuntu 14.10 with gcc-4.9.1. I am attaching the sample program. 


Isuru Fernando