Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16153

Re: Mathematica not IEEE-754 compliant?

From danl@wolfram.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Mathematica not IEEE-754 compliant?
Date 2013-10-31 03:45 +0000
Message-ID <l4sjo2$pkv$1@smc.vnet.net> (permalink)
References <l4n97h$b25$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Mathematica not IEEE-754 compliant? Alain Cochard <Alain.Cochard@unistra.fr> - 2013-10-29 03:14 +0000
  Re: Mathematica not IEEE-754 compliant? danl@wolfram.com - 2013-10-31 03:45 +0000
    Re: Mathematica not IEEE-754 compliant? Alain Cochard <Alain.Cochard@unistra.fr> - 2013-11-02 06:25 +0000
      Re: Mathematica not IEEE-754 compliant? danl@wolfram.com - 2013-11-05 04:12 +0000
    Re: Mathematica not IEEE-754 compliant? Alain Cochard <Alain.Cochard@unistra.fr> - 2013-11-06 05:21 +0000

csiph-web