MathGroup Archive 2005

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

Search the Archive

Re: [Mathematica 5.1] Bug Report - Two numerical values for a same variable

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54184] Re: [Mathematica 5.1] Bug Report - Two numerical values for a same variable
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Sat, 12 Feb 2005 01:58:52 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 2/11/05 at 3:33 AM, ling at caltech.edu (Ling Li) wrote:

>Mathematica v5.1 is much better than v5.0 on the accuracy of
>integration. I am not talking about numerical accuracy---v5.0
>sometimes gives out two answers that are off by a constant for the
>same input.

>However, I still get two different numerical values for a same
>variable in v5.1

>a=Exp[Integrate[(Cos[w]-Exp[-w^2/2]*Cos[23/100*w])/w, {w, 0,
>Infinity}]] 
>N[a] 
>N[a,20]

This is the (expected) result of using floating point arithmetic. When you did N[a] you asked Mathematica for a numerical result using machine precision (!6 digits on my machine). When you did N[a,20] you asked Mathematica to do the computation with more precise numbers. That is, you are asking Mathematica to do the same computation with different values. So, it really should not be surprising when the answer is different.

In short, this is not a Mathematica bug. It is something that will occur for any numerical procedure using floating point arithmetic.
--
To reply via email subtract one hundred and four


  • Prev by Date: UpValues for Blank[foo]
  • Next by Date: Re: Quite Upset with NIntegrate
  • Previous by thread: [Mathematica 5.1] Bug Report - Two numerical values for a same variable
  • Next by thread: Re: [Mathematica 5.1] Bug Report - Two numerical values for a same variable