bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gsl_sf_hyperg_2F1()


From: robin hankin
Subject: gsl_sf_hyperg_2F1()
Date: Sat, 20 Mar 2021 10:09:11 +1300

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

[Prev in Thread] Current Thread [Next in Thread]