[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] Bessel Jnu domain error
From: |
Jonathan Taylor |
Subject: |
Re: [Bug-gsl] Bessel Jnu domain error |
Date: |
Fri, 18 May 2012 17:43:20 +0100 |
> In the documentation, there are no specifications for the values of nu in
> the evaluation of bessel_Jnu. However after running the command for nu < 0,
> a domain error was shot at me. After looking at the source code, it indeed
> shows that a domain error is thrown when nu < 0. The cylinder Bessel
> function however is defined when nu < 0 (for x > 0), so the documentation
> should reflect that the routines only work when nu >= 0. This caused a bit
> of a headache for me today and I figured I'd spare someone else from this.
>
> Can the case of nu < 0 be easily implemented numerically? I am going to go
> through the source code and see if I can get it to work for nu < 0 over the
> next day or two.
I wasn't entirely sure from your message whether you know the relationship
between nu>0 and nu<0, but for Bessel functions of the first kind there is a
very simple relationship - see
http://mathworld.wolfram.com/BesselFunctionoftheFirstKind.html
equation 51. Of course it might be better if the source code handled this
explicitly, but you can very easily write a wrapper that calls through to gsl
to obtain J_|m|(x) and returns J_m(x).
Jonny.