Wed Jul 21 20:17:45 2010, original submission:
ReplyTo: unavailable
From: Raymond Rogers <raymond.rogers72@gmail.com>
To: unavailable
Subject: Re: [Buggsl] hyperg_U(a,b,x) Questions about x<0 and values
Date: Thu, 08 Jul 2010 11:49:15 0500
Brian Gough <bjg@gnu.org>
Subject: Re: [Buggsl] hyperg_U(a,b,x) Questions about x<0 and values
of a
To: unavailable
Cc: unavailable
MessageID: <43wrt61fkt.wl%bjg@gnu.org>
ContentType: text/plain; charset=USASCII
At Wed, 07 Jul 2010 10:14:34 0500,
Raymond Rogers wrote:
> >
> > 1) I was unable to find the valid domain of the argument a when x<0.
> > Experimenting yields what seem to be erratic results. Apparently
> > correct answers occur when {x<0&a<0& a integer}. References would be
> > sufficient. Unfortunately {x<0,a<0} is exactly the wrong range for my
> > problem; but the recursion relations can be used to stretch to a>0. If
> > I can find a range of correct operation for the domain of "a" of width >1.
>
 Brian Gough
 Thanks for the email. There are some comments about the domain for
 the hyperg_U_negx function in specfunc/hyperg_U.c  do they help?
They explain some things, but I believe the section
if (b_int && b >= 2 && !(a_int && a <= (b  2))){}
else {}
is implemented incorrectly; and probably the preceding section as well. Some restructuring of the code would make things clea\
rer; but things like that should probably done in a different forum: email, blog, etc...
I think the switches might be wrong. In any case it seems that b=1 has a hole. Is there a source for this code?
Note: the new NIST Mathematical handbook might have better algorithms. I am certainly no expert on implementing mathematical \
functions (except for finding ways to make them fail).
Ray
ReplyTo: unavailable
From: Raymond Rogers <raymond.rogers72@gmail.com>
To: unavailable
Subject: [Buggsl] Re: hyperg_U(a, b, x) Questions about x<0 and values of a,
Date: Sun, 11 Jul 2010 14:43:43 0500
hyperg_U basically fails with b=1, a noninteger; because
gsl_sf_poch_e(1+ab,a,&r1); is throwing a domain error when given
gamma(0)/gamma(a).
Checking on and using b=1 after ainteger is checked is illustrated
below in Octave. I also put in recursion to evaluate b>=2.
I checked the b=1 expression against Maple; for a few values x<0,a<0,b=1
and x<0,a<0,b>=2 integer.

Unfortunately the routine in Octave to call hyperg_U is only set up for
real returns, which was okay for versions <1.14 . Sad to say I am the
one who implemented the hyperg_U interface, and will probably have to go
back :( . Integrating these functions into Octave was not pleasant;
but perhaps somebody made it easier. I did translate the active parts
of hyperg_U into octave though; so it can be used in that way.
Ray
#
#
# Test function to evaluate b=1 for gsl 1.14 hyperg_U x<0
#
function anss=hyperg_U_negx_1(a,b,x)
int_a=(floor(a)==a);
int_b=(floor(b)==b);
#neg, int, a is already taken care of so use it
if (int_a && a<=0)
anss=hyperg_U(a,b,x);
elseif (int_b && (b==1))
#from the new NIST DLMF 13.2.41
anss=gamma(1a)exp(x)(hyperg_U(1a,1,x)/gamma(a)hyperg_1F1(1a,1,x)exp((1a)pi*I));
elseif (b>=2)
#DLMF 13.3.10
anss=((b1a)*hyperg_U_negx_1(a,b1,x) +
hyperg_U_negx_1(a1,b1,x))/x;
else
anss=hyperg_U(a,b,x);
endif
#
endfunction
