CRAN Package Check Results for Package Bessel

Last updated on 2026-07-23 09:50:48 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.7-0 6.10 65.48 71.58 OK
r-devel-linux-x86_64-debian-gcc 0.7-0 6.12 45.69 51.81 ERROR
r-devel-linux-x86_64-fedora-clang 0.7-0 11.00 102.16 113.16 OK
r-devel-linux-x86_64-fedora-gcc 0.7-0 52.66 OK
r-devel-windows-x86_64 0.7-0 14.00 94.00 108.00 OK
r-patched-linux-x86_64 0.7-0 8.93 61.29 70.22 OK
r-release-linux-x86_64 0.7-0 8.49 61.32 69.81 OK
r-release-macos-arm64 0.7-0 2.00 24.00 26.00 OK
r-release-macos-x86_64 0.7-0 6.00 80.00 86.00 OK
r-release-windows-x86_64 0.7-0 11.00 94.00 105.00 OK
r-oldrel-macos-arm64 0.7-0 OK
r-oldrel-macos-x86_64 0.7-0 6.00 86.00 92.00 OK
r-oldrel-windows-x86_64 0.7-0 14.00 105.00 119.00 OK

Check Details

Version: 0.7-0
Check: tests
Result: ERROR Running ‘Airy-tsts.R’ [1s/1s] Running ‘Bessel_asymp.R’ [1s/1s] Running ‘Hankel-tsts.R’ [1s/2s] Running ‘IJKY.R’ [1s/1s] Running the tests in ‘tests/IJKY.R’ failed. Complete output: > library(Bessel) > > #### Test cases for the Bessel functions I(), J(), K(), Y() > #### ----------------------------------- > > all.eq <- function(x,y, tol=1e-15,...) all.equal(x, rep_len(y,length(x)), tol=tol, ...) > > (op <- options(width=max(99, getOption("width")), warn = 0, + CBoundsCheck = TRUE, # check if .C and .Fortran ... for array over-runs.. [we had such a bug] + nwarnings = 999, warnPartialMatchArgs = FALSE)) # all.equal(*,*, tol = ..) $width [1] 80 $warn [1] 0 $CBoundsCheck [1] FALSE $nwarnings [1] 50 $warnPartialMatchArgs [1] FALSE > > isOSunix <- .Platform$OS.type == "unix" > windows <- !isOSunix > > stop_or_w <- if(isOSunix) stop else warning > > ### --- For real arguments -- Comparisons with bessel[IJYK]() > > x <- c(1e-6, 0.1, 1:10, 20, 100, 200)# larger x : less (relative) accuracy (??) > nus <- c(-6, -5.9, -1.1, .1, 1:4, 10, 20) > ## From R 2.10.1 (or 2.10.0 patched, >= Nov.23 2009) on, this works, previously > ## R"s besselJ() had an inaccuracy that we have corrected here ! > ## FIXME ? ---- we currently need to fudge for negative nu > ## note that (nu != -6 but nu ~ -6, |x| << |nu|) is still unstable, > ## since sin(nu*pi) ~ 0 (but not exactly!) and besselK() is large > nS <- 10 > for(F in c("I","J","K","Y")) { + cat("\n", F," --- nu : ") + zF <- get(paste0("Bessel", F)) # our pkg 'Bessel' + FF <- get(paste0("bessel", F)) # base R + stopifnot(is.function(zF), is.function(FF)) + for(nu in nus) { + x. <- x + spec <- FALSE ## nu < 0 && F %in% c("I","J") + cat(format(nu), if(spec)"* " else " ", sep="") + zr <- zF(x., nu, nSeq = nS) + rr <- outer(x., nu+ sign(nu)*(seq_len(nS)-1), FF) + stopifnot(all.equal(zr, rr, tol = 500e-16)) + }; cat("\n") + } I --- nu : -6 -5.9 -1.1 0.1 1 2 3 4 10 20 J --- nu : -6 -5.9 -1.1 0.1 1 2 3 4 10 20 K --- nu : -6 -5.9 -1.1 0.1 1 2 3 4 10 20 Y --- nu : -6 -5.9 -1.1 0.1 1 2 3 4 10 20 > > zr0 <- if(file.exists(sf <- "zr_IJKY.rds")) { readRDS(sf) + } else { print(saveRDS(zr, file=sf, version=2)) ; zr } > > ## Show: > all.equal(zr, zr0, tol = 0) [1] "Mean relative difference: 2.647444e-16" > > if(!isTRUE(ae <- all.equal(zr, zr0, tol = 1e-12))) + stop_or_w(ae) > > > ## "limit z -> 0 does not exist (there are many complex "Inf"s), > ## but for z = real, z >=0 is -Inf > stopifnot(BesselY(0,1) == -Inf,# == besselY(0,1), + is.nan(BesselY(0+0i, 1))) > > ### *Large* arguments , > ### However, base::bessel*(): only I() and K() have 'expon.scaled' > > x <- c(1000*(1:20), 20000*2^(1:20)) > str(rI <- BesselI(x, 10, nSeq = 5, expon.scaled=TRUE)) num [1:40, 1:5] 0.012 0.0087 0.00716 0.00623 0.00559 ... There were 20 warnings (use warnings() to see them) > > if(getRversion() >= "2.8.2") { ## besselI(), besselJ() with larger working range + ri2 <- outer(x, 10+seq_len(5)-1, besselI, expon.scaled=TRUE) + stopifnot(all.equal(rI[1:20,], ri2[1:20,], tol = 8e-16)) + stopifnot(all.equal(rI[1:35,], ri2[1:35,], tol = 0.04))# base::besselI is underflowing to zero + } ## R >= 2.8.2 > > rI0 <- if(file.exists(sf <- "r_I.rds")) { readRDS(sf) + } else { print(saveRDS(rI, sf, version=2)) ; rI } > > ri2.0 <- if(file.exists(sf <- "r_i2.rds")) { readRDS(sf) + } else { print(saveRDS(ri2, sf, version=2)); ri2 } > > ## Show the closeness (on different platforms): > all.equal(rI, rI0, tolerance = 0) [1] TRUE > all.equal(ri2, ri2.0, tolerance = 0) [1] TRUE > > stopifnot(exprs = { + all.equal(rI, rI0, tolerance = if(windows) 1e-10 else 1e-14) + all.equal(ri2, ri2.0, tolerance = if(windows) 1e-10 else 1e-14) + }) > > > ## e.g. this x is too large: > x. <- 1310720000 > BesselI(x., 10, nSeq = 5, expon.scaled=TRUE) [,1] [,2] [,3] [,4] [,5] [1,] NaN NaN NaN NaN NaN Warning message: In BesselI(x., 10, nSeq = 5, expon.scaled = TRUE) :*** buffer overflow detected ***: terminated Aborted Flavor: r-devel-linux-x86_64-debian-gcc