Hi there, I maintain an R wrapper for the GSL library and a user observed
the following behviour which I summarise below:


#include <stdio.h>
#include <gsl/gsl_sf_hyperg.h>

int main (void)
{
  double x1 = gsl_sf_hyperg_2F1(1.3,1,2.3,0.994);
  printf("hyperg_2F1(1.3,1,2.3,0.994) = %.18e\n", x1);
  double x2 = gsl_sf_hyperg_2F1(1.3,1,2.3,0.995);
  printf("hyperg_2F1(1.3,1,2.3,0.995) = %.18e\n", x2);
  return 0;
}

rhankin@limpet:~$ gcc -Wall -I/usr/local/include -c f.c
rhankin@limpet:~$ gcc -L/usr/local/lib f.o -lgsl -lgslcblas -lm
rhankin@limpet:~$ ./a.out
hyperg_2F1(1.3,1,2.3,0.994) = 6.170793616859728381e+00
hyperg_2F1(1.3,1,2.3,0.995) = 5.854679515581648000e+15
rhankin@limpet:~$


The second value is clearly incorrect; mathematica gives

 6.170793616 and 6.4009067299 respectively.

Reply via email to