--- gsl-1.10/specfunc/hyperg_2F1.c.org 2008-01-09 12:52:30.000000000 +0100 +++ gsl-1.10/specfunc/hyperg_2F1.c 2008-01-09 14:00:53.000000000 +0100 @@ -636,6 +636,39 @@ result->val = 0.0; result->err = 0.0; + /* start proposed handling of x=1.0 RJM */ + if ( fabs(x - 1.0) < locEPS && c-a-b > 0. && c != 0. && ! c_neg_integer ) + { + gsl_sf_result lnGamc, lnGamcab, lnGamca, lnGamcb ; + double lnGamcSi, lnGamcaSi, lnGamcbSi ; + int stat = gsl_sf_lngamma_sgn_e(c, & lnGamc, & lnGamcSi); + if ( stat != GSL_SUCCESS ) + { + DOMAIN_ERROR(result); + } + stat = gsl_sf_lngamma_e(c-a-b, & lnGamcab); + if ( stat != GSL_SUCCESS ) + { + DOMAIN_ERROR(result); + } + stat = gsl_sf_lngamma_sgn_e(c-a, & lnGamca, & lnGamcaSi); + if ( stat != GSL_SUCCESS ) + { + DOMAIN_ERROR(result); + } + stat = gsl_sf_lngamma_sgn_e(c-b, & lnGamcb, & lnGamcbSi); + if ( stat != GSL_SUCCESS ) + { + DOMAIN_ERROR(result); + } + stat = gsl_sf_exp_err_e(lnGamc.val+lnGamcab.val-lnGamca.val + -lnGamcb.val,lnGamc.err+lnGamcab.err+lnGamca.err+lnGamcb.err,result) ; + + result->val *= lnGamcSi/(lnGamcaSi*lnGamcbSi) ; + return stat ; + } +/*end proposed handling of x=1.0 RJM */ + if(x < -1.0 || 1.0 <= x) { DOMAIN_ERROR(result); }