After some experiments, I don't think it's a bug. In the documentation (
http://www.gnu.org/software/gsl/manual/html_node/Regular-Modified-Spherical-Bessel-Functions.html),
gsl_sf_bessel_i0_scaled
and gsl_sf_bessel_i0_scaled_e are defined as follows:

  These routines compute the scaled regular modified spherical Bessel
function of zeroth order, \exp(-|x|) i_0(x).

where

  i_l(x) = \sqrt{\pi/(2x)} I_{l+1/2}(x)

If you use the formula for i_0(x) from the documentation, Wolfram Alpha,
which is based on Mathematica, gives different values (-1 and 1) for one
sided limits:

http://www.wolframalpha.com/input/?i=lim+exp%28-%7Cx%7C%29+sqrt%28pi%2F%282x%29%29+BesselI%5B1%2F2%2C+x%5D+as+x+-%3E+0%2B

However, assuming \sqrt(x) = i \sqrt(-x) for negative x, gives

i_0(x) = \exp(-|x|) sinh(x) / x

and i_0(0) = 1 which is consistent with the GSL implementation.

Best regards,
Victor

On Wed, Jul 11, 2012 at 5:16 PM, [email protected] <
[email protected]> wrote:

> Hi All,
>
> Is there any particular reason that gsl_sf_bessel_i0_scaled(0) returns 1
> instead of NaN, or is it a bug? The function has different one-sided limits
> at 0 (-1 and 1).
>
> Thanks,
> Victor
>

Reply via email to