At Mon, 11 May 2009 14:26:43 -0400,
Taylor Binnington wrote:
> When I call gsl_sf_hyperg_2F1(0, -2, -4, 0.5) I get a domain error. I
> understand where it comes from, by looking in the course code, but I'm not
> sure why the routine does not simply provide 1.0000 as the output, which it
> should be. If I change the -4 to -4.1, for example, THEN my output is
> 1.00000 as it should be but I wish I didn't have to manually do this each
> time. Does anyone know how I can get around this issue?
Thanks for your email. I looked at the code and there was a bug in
the logic when c is a negative integer. The patch below should fix it
and will be in the next release.
diff --git a/specfunc/hyperg_2F1.c b/specfunc/hyperg_2F1.c
index 7e8c9d0..882ed35 100644
--- a/specfunc/hyperg_2F1.c
+++ b/specfunc/hyperg_2F1.c
@@ -667,8 +667,9 @@ gsl_sf_hyperg_2F1_e(double a, double b, const double c,
}
if(c_neg_integer) {
- if(! (a_neg_integer && a > c + 0.1)) DOMAIN_ERROR(result);
- if(! (b_neg_integer && b > c + 0.1)) DOMAIN_ERROR(result);
+ if(! (a_neg_integer && a > c + 0.1) && ! (b_neg_integer && b > c + 0.1)) {
+ DOMAIN_ERROR(result);
+ }
}
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl