Running examples in ‘Bessel-Ex.R’ failed
The error most likely occurred in:

> ### Name: bI
> ### Title: Bessel I() function Simple Series Representation
> ### Aliases: bI besselIs
> ### Keywords: math
> 
> ### ** Examples
> 
> (nus <- c(outer((0:3)/4, 1:5, `+`)))
 [1] 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50
[16] 4.75 5.00 5.25 5.50 5.75
> stopifnot(
+   all.equal(besselIs(1:10, 1), # our R code
+             besselI (1:10, 1)) # internal C code w/ different algorithm
+   ,
+   sapply(nus, function(nu)
+    all.equal(besselIs(1:10, nu, expon.scale=TRUE), # our R code
+              BesselI (1:10, nu, expon.scale=TRUE)) # TOMS644 code
+    )
+   ,
+   ## complex argument [gives warnings  'nterm=800' may be too small]
+   sapply(nus, function(nu)
+    all.equal(besselIs((1:10)*(1+1i), nu, expon.scale=TRUE), # our R code
+              BesselI ((1:10)*(1+1i), nu, expon.scale=TRUE)) # TOMS644 code
+    )
+ )
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 3+3i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 10+10i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 3+3i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 10+10i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 3+3i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 10+10i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 10+10i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 10+10i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 10+10i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 4+4i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 8+8i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 8+8i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 8+8i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 8+8i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 5+5i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 6+6i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 7+7i
Warning in FUN(X[[i]], ...) :  'nterm=800' may be too small for 8+8i
> 
> ## Large 'nu' ...
> x <- (0:20)/4
> (bx <- besselI(x, nu=200))# base R's -- gives (mostly wrong) warnings
Warning in besselI(x, nu = 200) :
  bessel_i(0.25,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(0.5,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(0.75,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(1,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(1.25,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(1.5,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(1.75,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(2,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(2.25,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(2.5,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(2.75,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(3,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(3.25,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(3.5,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(3.75,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(4,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(4.25,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(4.5,nu=200): precision lost in result
Warning in besselI(x, nu = 200) :
  bessel_i(4.75,nu=200): precision lost in result
 [1]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
 [6]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
[11]  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00  0.000000e+00
[16]  0.000000e+00  0.000000e+00  0.000000e+00 3.552652e-305 1.770194e-300
[21] 5.065429e-296
> if(require("Rmpfr")) { ## Use high precision (notably large exponent range) numbers:
+   Bx <- besselIs(mpfr(x, 64), nu=200)
+   all.equal(Bx, bx, tol = 1e-15)# TRUE -- warning were mostly wrong; specifically:
+   cbind(bx, Bx)
+   signif(asNumeric(1 - (bx/Bx)[19:21]), 4) # only [19] had lost accuracy
+ 
+   ## With*out* mpfr numbers -- using log -- is accurate (here)
+   (lbx <- besselIs(     x,      nu=200, log=TRUE))
+   lBx <-  besselIs(mpfr(x, 64), nu=200, log=TRUE)
+   stopifnot(all.equal(asNumeric(log(Bx)), lbx, tol=1e-15),
+ 	    all.equal(lBx, lbx, tol=4e-16))
+ } # Rmpfr
Loading required package: Rmpfr
Loading required package: gmp

Attaching package: ‘gmp’

The following objects are masked from ‘package:base’:

    %*%, apply, crossprod, matrix, tcrossprod

C code of R package 'Rmpfr': GMP using 64 bits per limb


Attaching package: ‘Rmpfr’

The following object is masked from ‘package:gmp’:

    outer

The following objects are masked from ‘package:stats’:

    dbinom, dgamma, dnbinom, dnorm, dpois, dt, pnorm

The following objects are masked from ‘package:base’:

    cbind, pmax, pmin, rbind

Error in target == current : comparison of these types is not implemented
Calls: all.equal -> all.equal -> .local -> all.equal.numeric
Execution halted