[Numpy-discussion] Different results from repeated calculation

Stefan stefan at sun.ac.za
Sat Jan 27 16:06:41 EST 2007


I can't reproduce this under Linux, r3510.  Output is

test1:  0  differences
test2:  0  differences
test3:  0  differences

Does anyone else see this happening?

Regards
Stéfan

On Sat, Jan 27, 2007 at 12:25:18PM -0800, Keith Goodman wrote:
> I get slightly different results when I repeat a calculation. In a
> long simulation the differences snowball and swamp the effects I am
> trying to measure.
> 
> In the attach script there are three tests.
> 
> In test1, I construct matrices x and y and then repeatedly calculate z
> = calc(x,y). The result z is the same every time. So this test passes.
> 
> In test2, I construct matrices x and y each time before calculating z
> = calc(x,y). Sometimes z is slightly different---of the order of 1e-21
> to 1e-18. But the x's test to be equal and so do the y's. This test
> fails. (It doesn't fail on my friend's windows box; I'm running
> linux.)
> 
> test3 is the same as test2 but I calculate z like this: z = calc(100*x
> ,y) / (100 * 100). This test passes.
> 
> What is going on?



More information about the NumPy-Discussion mailing list