MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica not IEEE-754 compliant?

  • To: mathgroup at
  • Subject: [mg131926] Re: Mathematica not IEEE-754 compliant?
  • From: danl at
  • Date: Wed, 30 Oct 2013 23:45:35 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <l4n97h$b25$>

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[
    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

  • Prev by Date: Re: Mathematica and MacOSX 10.9 Mavericks
  • Next by Date: Re: Mathematica and MacOSX 10.9 Mavericks
  • Previous by thread: Mathematica not IEEE-754 compliant?
  • Next by thread: Round-off error?