bugGNU Scientific Library - Bugs: bug #36152, Incorrect asymptotics of spherical...


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

bug #36152: Incorrect asymptotics of spherical Bessel functions

Submitted by:  Susi Lehtola <jussilehtola>
Submitted on:  Wed Apr 11 11:43:45 2012  
Category: Accuracy problemSeverity: 3 - Normal
Operating System: Status: None
Assigned to: NoneOpen/Closed: Open

Thu Aug 13 06:10:25 2015, comment #4:

A fixing suggestion is submitted with Bug #45746.

Enyi Tang <eytang>
Tue Jul 23 17:28:04 2013, comment #3:

partial fix for j0/j1 in rev 4844

Patrick Alken <psa>
Project Administrator
Tue Jul 23 15:57:43 2013, comment #2:

The problem with gsl_sf_bessel_j0 is related to gsl_sf_sin (see the following program). Program output is:

y_gsl = 9.155440021830e+41 y = -6.452512852658e-01

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include <gsl/gsl_math.h>
#include <gsl/gsl_sf_trig.h>

double y, y_gsl;
const double x = 1.0e20;

y_gsl = gsl_sf_sin(x);
y = sin(x);

fprintf(stderr, "y_gsl = %.12e y = %.12e\n", y_gsl, y);
return 0;

Patrick Alken <psa>
Project Administrator
Thu Jun 20 18:46:03 2013, comment #1:

A quick fix is to
return 0.0;

since things go wrong exactly around there.

Susi Lehtola <jussilehtola>
Wed Apr 11 11:43:45 2012, original submission:

There's something seriously wrong with the spherical Bessel functions. j_n (x) should go to zero as 1/x when x \to \infty. However, the values computed by GSL actually diverge!

Test case attached. As you can see, the values turn bad for j_0 at around x=1e18.

Susi Lehtola <jussilehtola>


Attached Files
file #25629:  testbessel.c added by jussilehtola (320B - text/x-csrc)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by eytang (Posted a comment)
  • -unavailable- added by psa (Posted a comment)
  • -unavailable- added by jussilehtola (Submitted the item)

    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
    Wed Apr 11 11:43:45 2012jussilehtolaAttached File-=>Added testbessel.c, #25629

    Back to the top

    Powered by Savane 3.1-cleanup1