       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:=
Exp[Integrate[(Cos[w] - Exp[-w^2/2]*Cos[(23/100)*w])/w, {w, 0, Infinity}]]

Unable to check convergence.

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

In:=
N[%]

Out=
0.7258911870047994

In:=
N[%%, 20]

Out=
0.7071067811865475244008443621049178777`20.

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

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

Out=
-0.05243686946160788253943021003866848941`20.

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

Out=
0.72589118700480243184501059813946795275`21.141234767758785

and so Out was correct.

Why did Mathematica think that the derivative was 0 when getting Out
but not when getting Out?

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