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 11 Apr 2012 11:43:45 AM UTC  
 
Category: Accuracy problemSeverity: 3 - Normal
Operating System: Status: None
Assigned to: NoneOpen/Closed: Open
Release: 

Tue 23 Jul 2013 05:28:04 PM UTC, comment #3:

partial fix for j0/j1 in rev 4844

Patrick Alken <psa>
Project Administrator
Tue 23 Jul 2013 03:57:43 PM UTC, 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>

int
main()
{
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 20 Jun 2013 06:46:03 PM UTC, comment #1:

A quick fix is to
if(x>1.0/DBL_EPSILON)
return 0.0;

since things go wrong exactly around there.

Susi Lehtola <jussilehtola>
Wed 11 Apr 2012 11:43:45 AM UTC, 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 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 11 Apr 2012 11:43:45 AM UTCjussilehtolaAttached File-=>Added testbessel.c, #25629

    Back to the top


    Powered by Savane 3.1-cleanup