bugGNU Scientific Library - Bugs: bug #40755, Sporadic nan's from...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #40755: Sporadic nan's from gsl_sf_bessel_Jn an related functions

Submitted by:  Rhys Ulerich <rhysu>
Submitted on:  Sat 30 Nov 2013 04:27:29 PM UTC  
 
Category: Accuracy problemSeverity: 3 - Normal
Operating System: Status: None
Assigned to: NoneOpen/Closed: Open
Release: 

Sat 30 Nov 2013 04:27:29 PM UTC, original submission:

From http://lists.gnu.org/archive/html/bug-gsl/2013-11/msg00008.html and behavior confirmed on GSL 1.16:

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

Rhys Ulerich <rhysu>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rhysu (Submitted the item)
  • -unavailable- added by rhysu
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 30 Nov 2013 04:27:29 PM UTCrhysuCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup