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: [mg54189] Re: [Mathematica 5.1] Bug Report - Two numerical values for a same variable
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Sat, 12 Feb 2005 01:59:14 -0500 (EST)
  • References: <cuhr4q$978$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Ling Li <ling at caltech.edu> wrote:
> Hi,
>
> 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]

(Note: I'm still using v5.0)

This is interesting, and seems to be a true bug. I hope that you have (or
will) report it to user support.

In[265]:=
Exp[Integrate[(Cos[w] - Exp[-w^2/2]*Cos[(23/100)*w])/w, {w, 0, Infinity}]]

  Unable to check convergence.

Out[265]=
E^((1/2)*(-Log[2] - Derivative[1, 0, 0][Hypergeometric1F1][0, 1/2,
-(529/20000)]))

In[266]:=
N[%]

Out[266]=
0.7258911870047994

In[267]:=
N[%%, 20]

Out[267]=
0.7071067811865475244008443621049178777`20.

Note that the above is 1/Sqrt[2], which is precisely what we'd get if the
derivative of the hypergeometric function were 0. But it's not:

In[268]:=
N[Derivative[1, 0, 0][Hypergeometric1F1][0, 1/2, -(529/20000)], 20]

Out[268]=
-0.05243686946160788253943021003866848941`20.

In[269]:=
E^((1/2)*(-Log[2] - %))

Out[269]=
0.72589118700480243184501059813946795275`21.141234767758785

and so Out[266] was correct.

Why did Mathematica think that the derivative was 0 when getting Out[267]
but not when getting Out[268]?

David Cantrell


  • Prev by Date: Re: Problems with easy simplifications
  • Next by Date: Re: Re: how to have a blind factorization of a polinomial?
  • Previous by thread: Re: [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