Re: [Python-ideas] Fused multiply-add (FMA)

2017-01-17 Thread Stephan Houben
Hi Gregory, 2017-01-16 20:28 GMT+01:00 Gregory P. Smith : > Is there a good reason not to detect single expression multiply adds and > just emit a new FMA bytecode? > Yes ;-) See below. > Is our goal for floats to strictly match the result of the same operations > coded in unoptimized C using d

Re: [Python-ideas] Fused multiply-add (FMA)

2017-01-17 Thread Xavier Combelle
> Generally speaking, there are two reasons why people may *not* want an > FMA operation. > 1. They need their results to be reproducible across > compilers/platforms. (the most common reason) > The reproducibility of floating point calculation is very hard to reach a good survey of the problem i

Re: [Python-ideas] Fused multiply-add (FMA)

2017-01-17 Thread Stephan Houben
Hi Xavier, In this bright age of IEEE-754 compatible CPUs, it is certainly possible to achieve reproducible FP. I worked for a company whose software produced bit-identical results on various CPUs (x86, Sparc, Itanium) and OSes (Linux, Solaris, Windows). The trick is to closely RTFM for your CPU

Re: [Python-ideas] Fused multiply-add (FMA)

2017-01-17 Thread Gregory P. Smith
Makes sense, thanks! math.fma() it is. :) On Tue, Jan 17, 2017, 7:48 AM Stephan Houben wrote: > Hi Xavier, > > In this bright age of IEEE-754 compatible CPUs, > it is certainly possible to achieve reproducible FP. > I worked for a company whose software produced bit-identical > results on vario

Re: [Python-ideas] Fused multiply-add (FMA)

2017-01-17 Thread Xavier Combelle
I never said it was impossible, just very hard. Le 17/01/2017 à 16:48, Stephan Houben a écrit : > Hi Xavier, > > In this bright age of IEEE-754 compatible CPUs, > it is certainly possible to achieve reproducible FP. > I worked for a company whose software produced bit-identical > results on vario

Re: [Python-ideas] proposal: "python -m foo" should bind sys.modules['foo']

2017-01-17 Thread Cameron Simpson
Trying to get back to speed with PEP-499... On 06Aug2015 13:26, Nick Coghlan wrote: On 6 August 2015 at 10:07, Cameron Simpson wrote: I suspect "How Reloading Will Work" would need to track both module.__name__ and module.__spec__.name to reattach the module to both entires in sys.modules.