Re: Non-deterministic numerical inaccuracies in Mathematica 7
- To: mathgroup at smc.vnet.net
- Subject: [mg94938] Re: Non-deterministic numerical inaccuracies in Mathematica 7
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 31 Dec 2008 06:08:07 -0500 (EST)
- References: <gjcuio$cnf$1@smc.vnet.net>
Hi, work fine on Windows Vista 64 Bit. Regards Jens Sjoerd C. de Vries wrote: > Hi all, > > Last week Budgemano posted an issue which involved numerical > inaccuracies in Mathematica 7. Due to the xmas season it hasn't > received much attention, or so it seems. > > Meanwhile, I've been able to drill the problem down to the following > code: > > myMod := Module[ > {p}, > Dot[{0.5018839897852984567457648, 0.544293499215831476457645674576, > 0.67220312964800834576456745674567}, {-0.5359693986690249`, \ > -0.41257352636613975`, -0.736559494563862`}]*{-0.5359693986690249`, \ > -0.41257352636613975`, -0.736559494563862`} - {0.5579131132707782`, > 0.2715072333003815`, 0.7842300557273234`}] > > For[ii = 1, ii <= 250, ii++, > If[myMod =!= myMod, > Print["Iteration " <> ToString[ii] <> " fails comparison "]];] > > As you can see the module myMod is called twice every iteration. Its > calculations only involve constants, so the results should always be > the same. However, on my system (Mathematica 7.WinXP) the results differ from one > call to the other at seemingly random times. > > This phenomenon crucially depends on the presence of the local > variable p (that isn't used!). With this variable it's there, without > it isn't. In M6 everything is OK, so this is a bug specific to Mathematica 7. > > Could you check on the various platforms whether you can reproduce > this? > > Cheers -- Sjoerd >