big float gamma



Many thanks to Andrej, Ray, and Viktor. I think bffac works OK--maybe it
has some trouble towards -%i * inf.

(%i1) load(bffac)$
(%i2) big_float_gamma(x) := bfloat(cbffac(x-1,fpprec))$

(%i3) chk(y) := bfloat(abs(big_float_gamma(%i*y))^2  / 
(%pi/(y*sinh(%pi*y))) - 1)$

(%i4) chk(10.1b0), fpprec : 25;
(%o4) 3.360421238496674929165098b-25

(%i5) chk(0.1b0), fpprec : 25;
(%o5) 1.292469707114105741986576b-24

(%i6) chk(-0.1b0), fpprec : 25;
(%o6) 1.137373342260413052948187b-24

(%i7) chk(-10.1b0), fpprec : 25;
(%o7) -6.215874910879647143551673b-13

(%i10) chk(-15.1b0), fpprec : 25;
(%o10) 9.401519380059724961306556b-7



BW

maxima-bounces at math.utexas.edu wrote on 09/06/2007 08:23:27 AM:

> Actually, I think bffac is correct; just keep in mind that it is the
> extended factorial, not gamma (i.e., Gamma(z) = bffac(z - 1)):
> 
> (%i8) abs(rectform(bffac(-5.0*%i-1,16)));
> (%o8)                        4.351751096374172b-4
> 
> 
> Viktor
> 
> 
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
[mailto:maxima-bounces at math.utexas.edu]
> On Behalf Of Raymond Toy (RT/EUS)
> Sent: Thursday, September 06, 2007 8:29 AM
> To: Barton Willis
> Cc: maxima at math.utexas.edu
> Subject: Re: [Maxima] big float gamma
> 
> Barton Willis wrote:
> > In bffac.mac, there is a big float gamma function bffac (author Bill
> > Gosper).
> > I was testing this function with complex inputs -- the output isn't in
> > rectangular form (it's a big mess). So I was wondering: Is bffac
> > algorithmically
> > correct for (all) complex inputs? If so, maybe we could insert some 
calls
> > to rectform
> > into the code? Example:
> > 
> > (%i49) float2bf : true$
> > (%i50) load(bffac)$
> > 
> > (%i51) bffac(-5.0 + %i,25);
> > 
> > < long mess deleted >
> > 
> > (%i52) rectform(%);
> > (%o52) 1.262948529867786b-2-7.163743828758051b-4*%i
> > 
> A&S says abs(gamma(%i*y)) = sqrt(%pi/(y*sinh(%pi*y)).
> 
> abs(rectform(bffac(5b0*%i,16))) -> 2.175875548187084b-3
> 
> But it should be  4.3517510963741685e-4
> 
> And gamma(5.0*%i) -> 3.399328988721385e-4 %i - 2.717038835061503e-4, 
> which has the magnitude  4.3517510963741857e-4.
> 
> Seems like bffac is not correct for complex args.
> 
> Ray
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima