Re: [PyGiNaC-users] strange behavior with the test suite
Status: Alpha
Brought to you by:
jbrandmeyer
From: Jonathan B. <jbr...@ea...> - 2005-10-03 18:38:58
|
On Mon, 2005-10-03 at 20:27 +0300, Matti Peltom=E4ki wrote: > Hi, >=20 > while playing around with pyginac, I found some strange behavior with > the regression test suite. The reason to this behavior escapes me.=20 >=20 > When running ./run python2.3 bin/checkall.py most of the time=20 > everything goes ok, but every now and then an error occurs as follows. >=20 > ***************************************************************** > Failure in example: exam_normal2() > from line #1 of exam_normalization.exam_normal2 > Expected: 0 > Got: > normal form of (-y+x)**(-3)*(x**2-y**2) returned (y-x)**(-2)*(y+x) wh= ile=20 > it should be (-y+x)**(-2)*(y+x) > normal form of (x**2-y**2)*(-1/2*y+1/2*x)**(-3) returned =20 > (y-x)**(-2)*(8*y+8*x) while it should be (-y+x)**(-2)*(8*y+8*x) I think that this is a canonicalization issue. If hash(x) is greater than hash(y) (when reinterpret_cast'ed back to unsigned ints), then pow(x - y, 2) normalizes to pow(y - x, 2) I'm not sure if this behavior is deliberate so I'm bringing it up on ginac-list. In the meantime, a patch has been committed to CVS that works around the error. -Jonathan |