Re: Mathematica not IEEE-754 compliant?

*To*: mathgroup at smc.vnet.net*Subject*: [mg131926] Re: Mathematica not IEEE-754 compliant?*From*: danl at wolfram.com*Date*: Wed, 30 Oct 2013 23:45:35 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-outx@smc.vnet.net*Delivered-to*: mathgroup-newsendx@smc.vnet.net*References*: <l4n97h$b25$1@smc.vnet.net>

I'm not convinced that one or the other is incorrect. It could be the case, for example, that 80 bit registers at certain steps are required to get one result whereas 64 bit registers, or storing from 80 to 64 bit doubles in memory, will give the other. Whether or how 80 bit registers get used will depend on settings at compile time for the various programs being used. One thing I can point out is that the Mathematica result is arguably the better of the two. Once you create 'num' and 'den' as machine numbers, if you now take their bit sequences, make exact rationals, and divide to high precision, then create the bit sequence for the corresponding approximate value, you will recover the 'bin' set of bits, not that of 'presumablyClosestInfPrec'. I show this below. In[39]:= Take[ RealDigits[ N[FromDigits[RealDigits[num, 2], 2]/ FromDigits[RealDigits[den, 2], 2], 20], 2][[1]], 53] === bin[[1]] Out[39]= True Notice that I used N[...,20] to make sure to correctly reconstruct that (exact) quotient to more than 53 correct bits. Daniel Lichtblau Wolfram Research