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


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

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-11-05 04:12 +0000
Message-ID <l59r6o$rd7$1@smc.vnet.net> (permalink)
References <l4n97h$b25$1@smc.vnet.net> <l4sjo2$pkv$1@smc.vnet.net> <l525s5$9gt$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


There is a subtlety having to do with Mathematica semantics rather than IEEE arithmetic. n/d is intertpreted, and evaluated, as n*(d^(-1)). If you go through the various computations to check on how your example will behave, I suspect it will come out fine, with the ELP ("error in last place") discrepancy between n*(d^(-1)) and n/d resulting from roundoff error in the process of taking the reciprocal and then multiplying.

To get the division semantics directly in Mathematica one can instead use

Divide[n,d]

In this case your example will give the result you had expected.

I should mention that once the actual arithmetic is performed in Mathematica, when operands are machine doubles then it is done using hardware operations that are invoked from C. If the C compiler used in the build process is IEEE compliant, then those operations will be as well. To the best of my knowledge all compilers we use to build Mathematica are IEEE compliant.

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