Fri Jul 2 13:06:07 2010, original submission:
From: Heiko Bauke <heiko.bauke@snafu.de>
To: unavailable
Subject: [Helpgsl] Gauss hypergeometric
Date: Thu, 24 Jun 2010 21:11:53 +0200
Dear GSL developers,
I would like to point out that the GSL functions gsl_sf_hyperg_2F1_e and
gsl_sf_hyperg_2F1 which compute the Gauss hypergeometric function for
1<=x<1 may be extended with little effort to arguments in the interval
oo<x<1 by using relations (32) and/or (33) in [1] by something like
this:
double hyperg_2F1(double a, double b, double c, double x) {
if (1.<=x and x<1.)
return gsl_sf_hyperg_2F1(a, b, c, x);
if (x<1.) {
// gsl_sf_hyperg_2F1 may have problems with negative arguments
if (ca<0)
return pow(1.x, a)*
gsl_sf_hyperg_2F1(a, cb, c, x/(x1.));
if (cb<0)
return pow(1.x, b)*
gsl_sf_hyperg_2F1(ca, c, c, x/(x1.));
// choose one of two equivalent formulas which is expected to be
// more accurate
if (a(cb)<(ca)b)
return pow(1.x, a)*
gsl_sf_hyperg_2F1(a, cb, c, x/(x1.));
else
return pow(1.x, b)*
gsl_sf_hyperg_2F1(ca, b, c, x/(x1.));
}
// insert some error handling for x>=1
return 0;
}
I cannot say much about the accuracy and the stability of this approach.
I think, however, it is reasonable to extend gsl_sf_hyperg_2F1_e and
gsl_sf_hyperg_2F1 in this way. It would make these functions more
general and useful.
Regards,
Heiko
[1] http://mathworld.wolfram.com/HypergeometricFunction.html
