MathGroup Archive 2002

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

Search the Archive

Re: Loss of precision when using Simplify

  • To: mathgroup at smc.vnet.net
  • Subject: [mg36972] Re: Loss of precision when using Simplify
  • From: Bill Rowe <listuser at earthlink.net>
  • Date: Thu, 3 Oct 2002 00:17:51 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 10/2/02 at 3:32 AM, carlw at u.washington.edu (Carl K. Woll) wrote:

>I'm writing to report what I consider to be a bug. First, I want to
>show a simplified example of the problem. Consider the following
>expression:
>
>expr=0.22 + x[0] + (3*(-0.16+ x[1]))/4 + (9*(0.546 + x[2]))/16;
>
>When simplified I expected to get some real number plus
>x[0]+3x[1]/4+9x[2]/16, but instead I get the following:
>
>Simplify[expr] 0.407125 + x[0] + 0.75 x[1] + 0.5625 x[2]
>
>As you can see, for some reason Mathematica converted the fractions
>3/4 and 9/16 to real machine numbers. I consider this to be a bug.

You really are not seeing a loss of precision here. When simplify carries out the indicated multiplication such as  9*.546/16 a machine precision number is returned because on of the arguments only has machine precision. It would be incorrect for Mathematica to return a result with greater precision than the arguements. It would also be incorrect for Mathematica to refuse to preform the required multiplications when simplifying this expression.

Or said differently, if you want an exact result from Mathematica *all* of the information you supply Mathematica must also be exact. It is not sensible for Mathematica to do otherwise.


  • Prev by Date: Re: Sum of 1/Primes
  • Next by Date: Re: FindRoot on complex 'interval'
  • Previous by thread: Loss of precision when using Simplify
  • Next by thread: Re: Loss of precision when using Simplify