MathGroup Archive 2009

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

Search the Archive

Re: Bug in Mathematica 7.0?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99127] Re: [mg99116] Bug in Mathematica 7.0?
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Tue, 28 Apr 2009 04:43:11 -0400 (EDT)
  • References: <200904270925.FAA24349@smc.vnet.net>

Not An Expert wrote:
> Hello Mathematica-Experts,
> 
> I'm using Mathematica 7.0 on a Windows XP machine and might have come across
> a bug in Mathematica 7.0.
> 
> I define the following function as a product of Gamma functions:
> 
> A[M_, r_] := Product[Gamma[M + j]*Gamma[1/2 + j]*Gamma[r + 1/2 + j]/
> Gamma[r + M + j], {j, 0, M - 1}]
> 
> To allow non-integer values M we re-write the above expression in terms
> of the Barnes G-function and so we obtain (we've checked the algebra
> many times!):

This is the part that went wrong.


> B[M_, r_] := BarnesG[2 + M]/BarnesG[2]*BarnesG[1/2 + M]/BarnesG[1/2]
> *BarnesG[r + 1/2 + M]/
> BarnesG[r + 1/2]*BarnesG[r + M]/BarnesG[r + 2*M]
> 
> As a test I've chosen M = 2 and r = 1
> and indeed I obtain
> A[2, 1] = Pi^2/32
> and
> B[2, 1] = Pi^2/32
> and so agreement in both functions.
> 
> But choosing M = 3 and r = 1 gives
> A[3, 1] = 9*Pi^3/2048
> B[3, 1] = 3^Pi^3/16384
> 
> So two different values for A[3, 1] and B[3, 1].
> Also A[3, 0] and B[3, 0] would give different answers - and there are
> many other examples.
> 
> Do you have any thoughts on what went wrong?
> 
> Cheerio!

Your translation from products of Gammas to BarnesG, specifically that 
first one, is not quite in agreement with what I find here.

http://mathworld.wolfram.com/BarnesG-Function.html

I obtain:

aA[m_, r_] := Product[Gamma[m + j]*Gamma[1/2 + j]*Gamma[r + 1/2 + j]/
   Gamma[r + m + j], {j, 0, m - 1}]

bB[m_,r_] := (BarnesG[2*m]/BarnesG[m]) * (BarnesG[m+1/2]/BarnesG[1/2]) *
  (BarnesG[r+m+1/2]/BarnesG[r+1/2]) * (BarnesG[r+m]/BarnesG[r+2*m])

Test:

In[44]:= Table[aA[m,r] - bB[m,r], {m,1,5}, {r,0,5}]
Out[44]= {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Mathematica crashed -- where did my notebook go?
  • Next by Date: Re: Bug in Mathematica 7.0?
  • Previous by thread: Bug in Mathematica 7.0?
  • Next by thread: Re: Bug in Mathematica 7.0?