bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] Sporadic nan's from gsl_sf_bessel_Jn an related functions


From: Paul Nulsen
Subject: [Bug-gsl] Sporadic nan's from gsl_sf_bessel_Jn an related functions
Date: Wed, 27 Nov 2013 16:48:38 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130809 Thunderbird/17.0.8

I think this is distinct from other bugs in the gsl bug database. No error
is reported by gsl_sf_bessel_Jn_e.

$ cat testgsl.c
/*
** Bug in gsl_sf_bessel_Jn (and related functions)
*/

#include <stdio.h>
#include <math.h>
#include <gsl/gsl_sf_bessel.h>

int main (int argc, char **argv) {
  double x = M_PI * 128 * 127.999;
  int nmin = 46335, nmax = 46345, i;
  for (i = nmin; i <= nmax; ++i) {
    double gsl_res = gsl_sf_bessel_Jn (i, x);
    double sys_res = jn (i, x);
    printf ("For (%d, %f), gsl gave %f, jn() gave %f\n", i, x, gsl_res,
        sys_res);
  }
  return 0;
}
$ gcc -O testgsl.c -o testgsl -lgsl -lgslcblas -lm
$ ./testgsl
For (46335, 51471.451913), gsl gave -0.004580, jn() gave -0.004580
For (46336, 51471.451913), gsl gave -0.005310, jn() gave -0.005310
For (46337, 51471.451913), gsl gave -0.004980, jn() gave -0.004980
For (46338, 51471.451913), gsl gave -0.003657, jn() gave -0.003657
For (46339, 51471.451913), gsl gave -0.001604, jn() gave -0.001604
For (46340, 51471.451913), gsl gave 0.000769, jn() gave 0.000769
For (46341, 51471.451913), gsl gave -nan, jn() gave 0.002988
For (46342, 51471.451913), gsl gave -nan, jn() gave 0.004612
For (46343, 51471.451913), gsl gave -nan, jn() gave 0.005316
For (46344, 51471.451913), gsl gave -nan, jn() gave 0.004961
For (46345, 51471.451913), gsl gave -nan, jn() gave 0.003618


Thanks
Paul




reply via email to

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