Re: [PyGiNaC-users] strange behavior with the test suite
Status: Alpha
Brought to you by:
jbrandmeyer
From: Jonathan B. <jbr...@ea...> - 2005-10-04 23:51:09
|
On Tue, 2005-10-04 at 20:14 +0300, Matti Peltom=E4ki wrote: > Hi,=20 >=20 > > 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) > >=20 > > 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. >=20 > I'm afraid there is something wrong in the workaround. I did a cvs update= =20 > getting your changes (bin/exam_normalization.py and ChangeLog) and rerun=20 > the test (again several times since it does not fail every time), and I=20 > still get the error sometimes.=20 >=20 > Are you still able to reproduce the error or is it just me?=20 I guess I didn't run the test often enough before I committed the fix last night, because you are right. Whatever the cause of the error, I'm inclined to let it slide since this is mathematically correct, and because (pow(x-y, 2)/pow(y-x,2)).normal() evaluates to numeric(1). In the current fix, if the test fails one way, it is retried with the second option. -Jonathan |