MathGroup Archive 2011

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

Search the Archive

Re: Why Mathematica does not issue a warning when the calculations

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117602] Re: Why Mathematica does not issue a warning when the calculations
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Thu, 24 Mar 2011 06:28:45 -0500 (EST)

Richard Fateman wrote:
> On 3/21/2011 4:13 AM, John Travolta Sardus wrote:
>> With Mathematica 8.0.1
>>
>> N[FractionalPart[(6 + Sqrt[2])^20]]
>>
>> Result:
>>
>> -160.
>>
>> Is it a problem for all numerical software being able to recognize when
>> these calculations cannot be performed with the given machine accuracy?
> 
> Yes, it is a problem. There is some support for this in other 
> computational systems (e.g. "inexact" traps), and Mathematica has
> some tools involving increasing the precision of results, but basically
> recognizing that your answer is wrong is, in general, a problem.
> 
>> Does this happen in this case only (where a wrong result is easily
>> recognized) or in other cases too?
> 
> It happens in cases where you cannot see it directly, as well.

> To some extent this is a problem with all arithmetic that is of finite
> precision, but it is especially a problem with Mathematica because of 
> its unusual arithmetic.

The example below, and the claim above, are completely tail backwards.

In slightly more detail, this is the customary gripe, from one poster, 
about degradation of precision when using precision tracking. But that 
degradation is made apparent by the low or zero precision of the result.

By way of contrast, programs that do no tracking give arbitrarily 
terrible results, only with NO warning. So they might well get wrong the 
example from the original post, even when ostensibly working at high 
precision.


> Try this
> 
> z = 1.11111111111111111111
> While [(z = 2*z - z) != 0, Print[z]]
> 
> This loop should never terminate, since 2*z-z is equal to z and is
> clearly very far away from zero, and setting z=2*z-z should not
> make it any closer to zero... Yet it terminates.  So a test
> internal to a Mathematica program that involves arithmetic and
> comparison can produce odd results.
> 
> This phenomenon is well-known to certain denizens of this newsgroup, 
> who claim it is a feature.(!) You can judge for yourself.
> 
> RJF

Richard,

The development of Mathematica, and usage of significance arithmetic, is 
not going to change. The fact that you do not like it, or even 
necessarily know how to use it to advantage, will not alter that. My 
advice: get past it. Move onto something more important. Justifying this 
particular gripe as important is not the tack to take (since you've gone 
that route before and made no impression).

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Using Nearest on a group of points
  • Next by Date: Re: Multiple Integrals
  • Previous by thread: Re: Why Mathematica does not issue a warning when the calculations
  • Next by thread: Re: Why Mathematica does not issue a warning when the calculations