URL:
<http://savannah.gnu.org/bugs/?30324>
Summary: improve range of 2F1
Project: GNU Scientific Library
Submitted by: bjg
Submitted on: Fri 02 Jul 2010 02:06:07 PM BST
Category: Accuracy problem
Severity: 3 - Normal
Operating System:
Status: Confirmed
Assigned to: None
Open/Closed: Open
Release: 1.14
Discussion Lock: Any
_______________________________________________________
Details:
From: Heiko Bauke <[email protected]>
To: [email protected]
Subject: [Help-gsl] 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 (c-a<0)
return pow(1.-x, -a)*
gsl_sf_hyperg_2F1(a, c-b, c, x/(x-1.));
if (c-b<0)
return pow(1.-x, -b)*
gsl_sf_hyperg_2F1(c-a, c, c, x/(x-1.));
// choose one of two equivalent formulas which is expected to be
// more accurate
if (a*(c-b)<(c-a)*b)
return pow(1.-x, -a)*
gsl_sf_hyperg_2F1(a, c-b, c, x/(x-1.));
else
return pow(1.-x, -b)*
gsl_sf_hyperg_2F1(c-a, b, c, x/(x-1.));
}
// 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
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?30324>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl