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

 
 

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

bug #36152: Incorrect asymptotics of spherical Bessel functions

Submitter:  Susi Lehtola <jussilehtola>
Submitted:  Wed 11 Apr 2012 11:43:45 AM UTC
   
 
Category:  Accuracy problem Severity:  3 - Normal
Operating System:  Status:  None
Assigned to:  None Open/Closed:  Open
Release: 

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

A fixing suggestion is submitted with Bug #45746.

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

partial fix for j0/j1 in rev 4844

Patrick Alken <psa>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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
  • -email is unavailable- added by eytang (Posted a comment)
  • -email is unavailable- added by psa (Posted a comment)
  • -email is unavailable- added by jussilehtola (Submitted the item)
  •  

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-04-11 jussilehtola Attached File- Added testbessel.c, #25629

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code