PreviousIndexLast

[bug-gsl] Re: [Help-gsl] Underflow in gsl_sf_bessel_Jn_array (2008-07-23)

From: Brian Gough <bjg@gnu.org>
Subject: Re: [Help-gsl] Underflow in gsl_sf_bessel_Jn_array
Date: Wed, 23 Jul 2008 08:08:23 +0100
To: Jonny Taylor <j.m.taylor@............>
Cc: bug-gsl@gnu.org, help-gsl@gnu.org

At Fri, 18 Jul 2008 12:14:10 +0100,
Jonny Taylor wrote:
> The following is sufficient to demonstrate the issue.
> double besselArray[51];
> double rho = 1e-6;
> gsl_sf_bessel_Jn_array(0, 50, rho, besselArray);
>
> The problem is that the array is populated by downward recurrence, but
> J_51 and J_50 are way smaller than DBL_MIN, resulting in an error
> within the GSL library:
> gsl: gamma.c:1454: ERROR: underflow
> Default GSL error handler invoked.

I looked at the code and there's no easy way to add support for
scaling the results in GSL itself at the moment. I would recommend
that you make an estimate of n_max using the asymptotic formula for Jn.

--
Brian Gough

GNU Scientific Library -
http://www.gnu.org/software/gsl/