Sorry to butt in here, but… I just saw the comparison, and all my alarm bells 
with regards to extended precision and other platform-dependent magic started 
ringing.
What kind of voodoo and virgin goat blood (Am I doing the occult rituals 
right?) was needed to make that work on other compilers?

Jokes aside, adding /fp:fast should tell the compiler to ignore all rules, and 
makes the result much more platform dependent than they already were. Literals 
are no longer trustable either.
MS docs: http://msdn.microsoft.com/en-us/library/e7s85ffb.aspx
SO note on fast-math: http://stackoverflow.com/a/16069874

Shouldn’t the comparison just account for some lack of precision? I suggest 
having the macro do (a > b*0.99999 && a < b*0.00001) or the likes, after 
deciding how many digits of precision is wanted for that specific test. It 
looks stupid (And introduces even more floating point arithmetics!), but it 
works.

But maybe you should wait for another reply, I may just be too tired to 
function.

Kenny

On 09 Apr 2014, at 22:10, matti picus <[email protected]> wrote:

> looking at this test failure
> http://buildbot.pypy.org/summary/longrepr?testname=test_math&builder=own-win-x86-32&build=86&mod=jit.backend.x86.test.test_zmath
> which tests that atan2(0.23/1.23) == 1.3.... via OP_FLOAT_EQ(double value, 
> double value)
> OP_FLOAT_EQ is a compiler define to (a == b), which is tricky with double 
> values.
> Here is a nice discussion of the issue on MSVC
> http://www.gamasutra.com/view/news/167402/Indepth_Intermediate_floatingpoint_precision.php
> The link even has a flow chart for choosing msvc or intel compiler flags.
> The test passes if I add /fp:fast to the msvc compile flag
> Would anyone object if I add this to the default MSVC flags?
> 
> FWIW, the "fast" is misleading, apparently it can be slower than the default 
> for some cases.
> Matti
> _______________________________________________
> pypy-dev mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/pypy-dev

_______________________________________________
pypy-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to