AW: [Gretl-users] bessel functions

Klein, Christoph christoph.klein at
Thu Jun 18 03:48:46 EDT 2009

I'm not very familiar with the bessel function and numerical calculation of it, but I think in the mentioned range it works quite well. If you need a more professional implementation I could copy'n' paste the gsl code into a new function for gretl. I think gsl and gretl both use GPL3.
I *really* need besselK for fractional orders :)

Von: gretl-users-bounces at [gretl-users-bounces at] im Auftrag von Allin Cottrell [cottrell at]
Gesendet: Donnerstag, 18. Juni 2009 05:27
An: Gretl list
Betreff: Re: [Gretl-users] bessel functions

On Wed, 17 Jun 2009, Klein, Christoph wrote:

> I'm working on the bessel code right now. The attached patch
> implements a bessel function which can be called like this:
> bessel(<type>, <order>, <value>) example bessel("K",0.5,1).

Wow!  How great to get such a well worked-out patch!  I have
added to CVS most of what you submitted, in a slightly
trimmed-down version that (for now) only accepts a scalar value
for the order of the Bessel function.

> the function works for J,I,K,Y bessel functions. For K bessel
> there was no support for fractional orders in cephes, thats why
> there is additonal code for these cases. the fractional order
> for k and negative orders for I work reasonably well in the
> range lambda<10 and value<20. The attached test script checks
> against the implementation of R.

Nice!  I'll check against libgsl too.  On an initial scan it seems
that most things are fine but the Bessel 'K' function goes a bit
strange for large values of X (as you say, values < 20 are OK).

Allin Cottrell
Gretl-users mailing list
Gretl-users at

More information about the Gretl-users mailing list