[Rd] two bessel function bugs for nu<0

From: Hiroyuki Kawakatsu <hkawakat_at_gmail.com>
Date: Mon, 18 Jun 2007 23:33:05 +0100


#bug 1: besselI() for nu<0 and expon.scaled=TRUE
#tested with R-devel (2007-06-17 r41981)
x <- 2.3
nu <- -0.4
print(paste(besselI(x, nu, TRUE), "=", exp(-x)*besselI(x, nu, FALSE)))
#fix:
#$ diff bessel_i_old.c bessel_i_new.c
#57c57
#< bessel_k(x, -alpha, expo) * ((ize == 1)? 2. : 2.*exp(-x))/M_PI
#---
#> bessel_k(x, -alpha, expo) * ((ize == 1)? 2. : 2.*exp(-2.0*x))/M_PI

#bug 2: besselY() for nu<0
#don't know how to check in R; a few random checks against mathematica 5.2
#fix:
#$ diff bessel_y_old.c bessel_y_new.c
#55c55
#< return(bessel_y(x, -alpha) + bessel_j(x, -alpha) * sin(-M_PI * alpha));
#---
#> return(bessel_y(x, -alpha) * cos(M_PI * alpha) - bessel_j(x,
-alpha) * sin(M_PI * alpha));

h.

-- 
----------------------------------
Hiroyuki Kawakatsu
Business School
Dublin City University
Dublin 9, Ireland
Tel +353 (0)1 700 7496

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 18 Jun 2007 - 22:37:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Jun 2007 - 11:35:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.