R Under development (unstable) (2023-10-11 r85316 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(round) > > ## Utilities (sync with ../man/roundX.Rd ! ) > > ##' maybe add to package -- it's really useful here : > formatF <- function(x, ...) noquote(format(x, scientific=FALSE, drop0trailing=TRUE, ...)) > > same_cols <- function(m) all(m == m[,1]) > matPm <- function(y) { + matplot(y=y, type = "l", lwd = 2, xlab = "i", ylab = deparse(substitute(y))) + abline(h = 0, lty=2, col="gray") + legend("topleft", legend = setdiff(roundVersions, "r3"), + col = 1:6, lty = 1:5, lwd = 2, bty = "n") + } > > str(.M <- .Machine, digits = 8) List of 29 $ double.eps : num 2.220446e-16 $ double.neg.eps : num 1.110223e-16 $ double.xmin : num 2.2250739e-308 $ double.xmax : num 1.7976931e+308 $ double.base : int 2 $ double.digits : int 53 $ double.rounding : int 5 $ double.guard : int 0 $ double.ulp.digits : int -52 $ double.neg.ulp.digits : int -53 $ double.exponent : int 11 $ double.min.exp : int -1022 $ double.max.exp : int 1024 $ integer.max : int 2147483647 $ sizeof.long : int 4 $ sizeof.longlong : int 8 $ sizeof.longdouble : int 16 $ sizeof.pointer : int 8 $ sizeof.time_t : int 8 $ longdouble.eps : num 1.0842022e-19 $ longdouble.neg.eps : num 5.4210109e-20 $ longdouble.digits : int 64 $ longdouble.rounding : int 5 $ longdouble.guard : int 0 $ longdouble.ulp.digits : int -63 $ longdouble.neg.ulp.digits: int -64 $ longdouble.exponent : int 15 $ longdouble.min.exp : int -16382 $ longdouble.max.exp : int 16384 > capabilities() jpeg png tiff tcltk X11 aqua TRUE TRUE TRUE TRUE FALSE FALSE http/ftp sockets libxml fifo cledit iconv TRUE TRUE FALSE TRUE FALSE TRUE NLS Rprof profmem cairo ICU long.double TRUE TRUE TRUE TRUE TRUE TRUE libcurl TRUE > str(.M[grep("^sizeof", names(.M))]) ## also differentiate long-double.. List of 5 $ sizeof.long : int 4 $ sizeof.longlong : int 8 $ sizeof.longdouble: int 16 $ sizeof.pointer : int 8 $ sizeof.time_t : int 8 > (b64 <- .M$sizeof.pointer == 8) [1] TRUE > (arch <- Sys.info()[["machine"]]) [1] "x86-64" > (onWindows <- .Platform$OS.type == "windows") [1] TRUE > (hasLD <- unname(capabilities("long.double"))) [1] TRUE > (validLD <- hasLD && + (.M$longdouble.digits > .M$double.digits) && + (.M$longdouble.min.exp <= 8L * .M$double.min.exp)) [1] TRUE > win32 <- onWindows && !b64 > doExtras <- round:::doExtras() > > if(!dev.interactive(orNone=TRUE)) pdf("round-tst.pdf") > options(width = 150) # for wide "tables" > > dd <- 0:12 > x55 <- 55 + as.numeric(vapply(dd+1, function(k) paste0(".", strrep("5",k)), "")) > rnd.x <- roundAll(x55, dd) > formatF(rnd.x, digits = 14) sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 56 56 56 56 56 56 56 56 56 [2,] 55.5 55.6 55.5 55.5 55.6 55.6 55.5 55.5 55.5 [3,] 55.55 55.56 55.55 55.55 55.56 55.56 55.56 55.56 55.56 [4,] 55.556 55.556 55.556 55.556 55.556 55.556 55.556 55.556 55.556 [5,] 55.5555 55.5556 55.5555 55.5555 55.5556 55.5556 55.5555 55.5555 55.5555 [6,] 55.55555 55.55556 55.55555 55.55555 55.55556 55.55556 55.55556 55.55556 55.55556 [7,] 55.555555 55.555556 55.555555 55.555555 55.555556 55.555556 55.555555 55.555555 55.555555 [8,] 55.5555556 55.5555556 55.5555556 55.5555556 55.5555556 55.5555556 55.5555556 55.5555556 55.5555556 [9,] 55.55555555 55.55555556 55.55555555 55.55555555 55.55555556 55.55555556 55.55555555 55.55555555 55.55555555 [10,] 55.555555555 55.555555556 55.555555555 55.555555555 55.555555556 55.555555556 55.555555556 55.555555556 55.555555556 [11,] 55.5555555556 55.5555555556 55.5555555556 55.5555555556 55.5555555556 55.5555555556 55.5555555556 55.5555555556 55.5555555556 [12,] 55.55555555556 55.55555555556 55.55555555556 55.55555555556 55.55555555556 55.55555555556 55.55555555556 55.55555555556 55.55555555556 [13,] 55.555555555556 55.555555555556 55.555555555556 55.555555555556 55.555555555556 55.555555555556 55.555555555556 55.555555555556 55.555555555556 > ## and the deviations from "r3d.C": > noquote(cbind(dig = format(dd), format(rnd.x - rnd.x[,"r3d.C"], + zero.print = ".", digits = 4))) dig sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 0 . . . . . . . . . [2,] 1 . 1e-01 . . 1e-01 1e-01 . . . [3,] 2 -1e-02 . -1e-02 -1e-02 . . . . . [4,] 3 . . . . . . . . . [5,] 4 . 1e-04 . . 1e-04 1e-04 . . . [6,] 5 -1e-05 . -1e-05 -1e-05 . . . . . [7,] 6 . 1e-06 . . 1e-06 1e-06 . . . [8,] 7 . . . . . . . . . [9,] 8 . 1e-08 . . 1e-08 1e-08 . . . [10,] 9 -1e-09 . -1e-09 -1e-09 . . . . . [11,] 10 . . . . . . . . . [12,] 11 . . . . . . . . . [13,] 12 . . . . . . . . . > ## FIXME: test ! > > ## Had a bug in "r3d.C we don't want --- are getting into denormalized regions! > xx <- c(7e-304 + , pi*10^-(300:323) + , 5e-324) # = 4.94..e-324, the 'mm' number > dig <- 305:340 > okD <- dig <= 323L > (typV <- setdiff(roundVersions, c("r0.C", "r1.C"))) [1] "sprintf" "r1a.C" "r2.C" "r2a.C" "r3.C" "r3d.C" "r3" > (no_printf <- setdiff(roundVersions, "sprintf")) [1] "r0.C" "r1.C" "r1a.C" "r2.C" "r2a.C" "r3.C" "r3d.C" "r3" > (no_LDOUBLE <- setdiff(roundVersions, "r3.C")) # BDR's valgrind-ed version has NaN here (for 7e-304) [1] "sprintf" "r0.C" "r1.C" "r1a.C" "r2.C" "r2a.C" "r3d.C" "r3" > epsC <- .Machine$double.eps > for(x in xx) { + cat("\n", x, ":\n") + dx <- x - roundAll(x, dig) + print(cbind(dig = dig, "d+l10" = dig + .30103*(ilogb(x) + .5), + "|dx|/x" = abs(dx)/x)[okD,], digits = 4) + ## FIXME: can do much more rational tests: err |dx| =~ 10^-dd (if dd > 0) + if(validLD) { + if(x == 7e-304) { ## denormalized etc + stopifnot(abs(dx) < 10* x * epsC) + } + else stopifnot(is.finite(dx)) + stopifnot(dx[!okD, typV] == 0) + } else { # no 'long double' -- Lnx 64b: interestingly "sprintf" is quite a bit affected + stopifnot(is.finite(dx[,no_LDOUBLE])) + cat("No (proper) long_double capability\n") + ## FIXME .. apart from "sprintf" things look good ... "yeah.." + ## ----- TODO derive from above print( .... abs(dx)/x) + if(FALSE) stopifnot(abs(dx/x)[!okD, no_printf] < 10 * epsC) + } + } 7e-304 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 1.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 1.156e-16 [2,] 306 2.712 0 6.938e-16 6.938e-16 6.938e-16 6.938e-16 6.938e-16 0 6.938e-16 0.000e+00 [3,] 307 3.712 0 4.626e-16 4.626e-16 4.626e-16 4.626e-16 4.626e-16 0 4.626e-16 0.000e+00 [4,] 308 4.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 0.000e+00 [5,] 309 5.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 0.000e+00 [6,] 310 6.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 0.000e+00 [7,] 311 7.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 0.000e+00 [8,] 312 8.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 4.626e-16 0.000e+00 [9,] 313 9.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 0.000e+00 [10,] 314 10.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 6.938e-16 0.000e+00 [11,] 315 11.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 5.782e-16 0.000e+00 [12,] 316 12.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 6.938e-16 0.000e+00 [13,] 317 13.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 6.938e-16 0.000e+00 [14,] 318 14.712 0 5.782e-16 5.782e-16 5.782e-16 5.782e-16 5.782e-16 0 6.938e-16 0.000e+00 [15,] 319 15.712 0 5.782e-16 5.782e-16 5.782e-16 0.000e+00 0.000e+00 0 0.000e+00 0.000e+00 [16,] 320 16.712 0 5.782e-16 5.782e-16 5.782e-16 0.000e+00 0.000e+00 0 0.000e+00 0.000e+00 [17,] 321 17.712 0 5.782e-16 5.782e-16 5.782e-16 0.000e+00 0.000e+00 0 0.000e+00 0.000e+00 [18,] 322 18.712 0 5.782e-16 5.782e-16 5.782e-16 0.000e+00 0.000e+00 0 0.000e+00 0.000e+00 [19,] 323 19.712 0 5.782e-16 5.782e-16 5.782e-16 0.000e+00 0.000e+00 0 0.000e+00 0.000e+00 3.141593e-300 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 5.626 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 [2,] 306 6.626 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 [3,] 307 7.626 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 [4,] 308 8.626 1.143e-09 1.143e-09 1.143e-09 1.143e-09 1.143e-09 1.143e-09 1.143e-09 1.143e-09 1.143e-09 [5,] 309 9.626 1.306e-10 1.143e-09 1.143e-09 1.143e-09 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.000e+00 [6,] 310 10.626 3.249e-12 1.143e-09 1.143e-09 1.143e-09 3.249e-12 3.249e-12 3.249e-12 3.249e-12 0.000e+00 [7,] 311 11.626 6.586e-14 1.143e-09 1.143e-09 1.143e-09 6.522e-14 6.522e-14 6.586e-14 6.543e-14 0.000e+00 [8,] 312 12.626 6.586e-14 1.143e-09 1.143e-09 1.143e-09 6.522e-14 6.522e-14 6.586e-14 6.522e-14 0.000e+00 [9,] 313 13.626 2.322e-15 1.143e-09 1.143e-09 1.143e-09 1.689e-15 1.689e-15 2.322e-15 1.689e-15 0.000e+00 [10,] 314 14.626 8.443e-16 1.143e-09 1.143e-09 1.143e-09 1.689e-15 1.689e-15 8.443e-16 1.689e-15 0.000e+00 [11,] 315 15.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [12,] 316 16.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [13,] 317 17.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [14,] 318 18.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [15,] 319 19.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [16,] 320 20.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [17,] 321 21.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [18,] 322 22.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [19,] 323 23.626 0.000e+00 1.143e-09 1.143e-09 1.143e-09 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 3.141593e-301 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 4.422 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 [2,] 306 5.422 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 [3,] 307 6.422 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 [4,] 308 7.422 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 1.477e-08 [5,] 309 8.422 1.143e-09 1.477e-08 1.477e-08 1.477e-08 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.000e+00 [6,] 310 9.422 1.306e-10 1.477e-08 1.477e-08 1.477e-08 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.000e+00 [7,] 311 10.422 3.249e-12 1.477e-08 1.477e-08 1.477e-08 3.248e-12 3.248e-12 3.249e-12 3.248e-12 0.000e+00 [8,] 312 11.422 6.583e-14 1.477e-08 1.477e-08 1.477e-08 6.517e-14 6.517e-14 6.583e-14 6.530e-14 0.000e+00 [9,] 313 12.422 6.583e-14 1.477e-08 1.477e-08 1.477e-08 6.517e-14 6.517e-14 6.583e-14 6.517e-14 0.000e+00 [10,] 314 13.422 2.111e-15 1.477e-08 1.477e-08 1.477e-08 1.451e-15 1.451e-15 2.111e-15 1.451e-15 0.000e+00 [11,] 315 14.422 1.055e-15 1.477e-08 1.477e-08 1.477e-08 1.451e-15 1.451e-15 1.055e-15 1.583e-15 0.000e+00 [12,] 316 15.422 1.319e-16 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [13,] 317 16.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [14,] 318 17.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [15,] 319 18.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [16,] 320 19.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [17,] 321 20.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [18,] 322 21.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [19,] 323 22.422 0.000e+00 1.477e-08 1.477e-08 1.477e-08 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 3.141593e-302 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 3.518 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 [2,] 306 4.518 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 [3,] 307 5.518 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 [4,] 308 6.518 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 [5,] 309 7.518 1.477e-08 1.103e-07 1.103e-07 1.103e-07 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.000e+00 [6,] 310 8.518 1.143e-09 1.103e-07 1.103e-07 1.103e-07 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.000e+00 [7,] 311 9.518 1.306e-10 1.103e-07 1.103e-07 1.103e-07 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.000e+00 [8,] 312 10.518 3.249e-12 1.103e-07 1.103e-07 1.103e-07 3.248e-12 3.248e-12 3.249e-12 3.248e-12 0.000e+00 [9,] 313 11.518 6.596e-14 1.103e-07 1.103e-07 1.103e-07 6.530e-14 6.530e-14 6.596e-14 6.547e-14 0.000e+00 [10,] 314 12.518 6.596e-14 1.103e-07 1.103e-07 1.103e-07 6.530e-14 6.530e-14 6.596e-14 6.530e-14 0.000e+00 [11,] 315 13.518 2.309e-15 1.103e-07 1.103e-07 1.103e-07 1.649e-15 1.649e-15 2.309e-15 1.649e-15 0.000e+00 [12,] 316 14.518 8.245e-16 1.103e-07 1.103e-07 1.103e-07 1.649e-15 1.649e-15 8.245e-16 1.484e-15 0.000e+00 [13,] 317 15.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [14,] 318 16.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [15,] 319 17.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [16,] 320 18.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [17,] 321 19.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [18,] 322 20.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [19,] 323 21.518 0.000e+00 1.103e-07 1.103e-07 1.103e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 3.141593e-303 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 2.615 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 [2,] 306 3.615 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 [3,] 307 4.615 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 [4,] 308 5.615 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 8.447e-07 [5,] 309 6.615 1.103e-07 8.447e-07 8.447e-07 8.447e-07 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0.000e+00 [6,] 310 7.615 1.477e-08 8.447e-07 8.447e-07 8.447e-07 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.000e+00 [7,] 311 8.615 1.143e-09 8.447e-07 8.447e-07 8.447e-07 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.000e+00 [8,] 312 9.615 1.306e-10 8.447e-07 8.447e-07 8.447e-07 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.000e+00 [9,] 313 10.615 3.249e-12 8.447e-07 8.447e-07 8.447e-07 3.248e-12 3.248e-12 3.249e-12 3.248e-12 0.000e+00 [10,] 314 11.615 6.576e-14 8.447e-07 8.447e-07 8.447e-07 6.514e-14 6.514e-14 6.576e-14 6.534e-14 0.000e+00 [11,] 315 12.615 6.576e-14 8.447e-07 8.447e-07 8.447e-07 6.514e-14 6.514e-14 6.576e-14 6.514e-14 0.000e+00 [12,] 316 13.615 2.267e-15 8.447e-07 8.447e-07 8.447e-07 1.649e-15 1.649e-15 2.267e-15 1.443e-15 0.000e+00 [13,] 317 14.615 1.031e-15 8.447e-07 8.447e-07 8.447e-07 1.649e-15 1.649e-15 1.031e-15 1.649e-15 0.000e+00 [14,] 318 15.615 0.000e+00 8.447e-07 8.447e-07 8.447e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [15,] 319 16.615 0.000e+00 8.447e-07 8.447e-07 8.447e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [16,] 320 17.615 0.000e+00 8.447e-07 8.447e-07 8.447e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [17,] 321 18.615 0.000e+00 8.447e-07 8.447e-07 8.447e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [18,] 322 19.615 0.000e+00 8.447e-07 8.447e-07 8.447e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [19,] 323 20.615 0.000e+00 8.447e-07 8.447e-07 8.447e-07 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 3.141593e-304 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 1.411 1.324e-02 1.324e-02 1.324e-02 1.324e-02 1.324e-02 1.324e-02 1.324e-02 1.324e-02 1.324e-02 [2,] 306 2.411 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 5.070e-04 [3,] 307 3.411 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 1.297e-04 [4,] 308 4.411 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 2.338e-06 [5,] 309 5.411 8.447e-07 2.338e-06 2.338e-06 2.338e-06 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0.000e+00 [6,] 310 6.411 1.103e-07 2.338e-06 2.338e-06 2.338e-06 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0.000e+00 [7,] 311 7.411 1.477e-08 2.338e-06 2.338e-06 2.338e-06 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.000e+00 [8,] 312 8.411 1.143e-09 2.338e-06 2.338e-06 2.338e-06 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.000e+00 [9,] 313 9.411 1.306e-10 2.338e-06 2.338e-06 2.338e-06 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.000e+00 [10,] 314 10.411 3.249e-12 2.338e-06 2.338e-06 2.338e-06 3.248e-12 3.248e-12 3.249e-12 3.249e-12 0.000e+00 [11,] 315 11.411 6.596e-14 2.338e-06 2.338e-06 2.338e-06 6.532e-14 6.532e-14 6.596e-14 6.545e-14 0.000e+00 [12,] 316 12.411 6.596e-14 2.338e-06 2.338e-06 2.338e-06 6.532e-14 6.532e-14 6.596e-14 6.532e-14 0.000e+00 [13,] 317 13.411 2.319e-15 2.338e-06 2.338e-06 2.338e-06 1.675e-15 1.675e-15 2.319e-15 1.675e-15 0.000e+00 [14,] 318 14.411 9.018e-16 2.338e-06 2.338e-06 2.338e-06 1.675e-15 1.675e-15 9.018e-16 1.546e-15 0.000e+00 [15,] 319 15.411 0.000e+00 2.338e-06 2.338e-06 2.338e-06 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [16,] 320 16.411 0.000e+00 2.338e-06 2.338e-06 2.338e-06 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [17,] 321 17.411 0.000e+00 2.338e-06 2.338e-06 2.338e-06 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [18,] 322 18.411 0.000e+00 2.338e-06 2.338e-06 2.338e-06 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [19,] 323 19.411 0.000e+00 2.338e-06 2.338e-06 2.338e-06 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 3.141593e-305 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 0.5082 4.507e-02 0.0450703 0.0450703 0.0450703 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0.0450703 [2,] 306 1.5082 1.324e-02 0.0132394 0.0132394 0.0132394 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0.0132394 [3,] 307 2.5082 5.070e-04 0.0005070 0.0005070 0.0005070 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0.0005070 [4,] 308 3.5082 1.297e-04 0.0001297 0.0001297 0.0001297 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0.0001297 [5,] 309 4.5082 2.338e-06 0.0001297 0.0001297 0.0001297 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0.0000000 [6,] 310 5.5082 8.447e-07 0.0001297 0.0001297 0.0001297 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0.0000000 [7,] 311 6.5082 1.103e-07 0.0001297 0.0001297 0.0001297 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0.0000000 [8,] 312 7.5082 1.477e-08 0.0001297 0.0001297 0.0001297 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.0000000 [9,] 313 8.5082 1.143e-09 0.0001297 0.0001297 0.0001297 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.0000000 [10,] 314 9.5082 1.306e-10 0.0001297 0.0001297 0.0001297 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.0000000 [11,] 315 10.5082 3.249e-12 0.0001297 0.0001297 0.0001297 3.248e-12 3.248e-12 3.249e-12 3.249e-12 0.0000000 [12,] 316 11.5082 6.587e-14 0.0001297 0.0001297 0.0001297 6.522e-14 6.522e-14 6.587e-14 6.538e-14 0.0000000 [13,] 317 12.5082 6.587e-14 0.0001297 0.0001297 0.0001297 6.522e-14 6.522e-14 6.587e-14 6.522e-14 0.0000000 [14,] 318 13.5082 2.255e-15 0.0001297 0.0001297 0.0001297 1.610e-15 1.610e-15 2.255e-15 1.610e-15 0.0000000 [15,] 319 14.5082 9.662e-16 0.0001297 0.0001297 0.0001297 1.610e-15 1.610e-15 9.662e-16 1.610e-15 0.0000000 [16,] 320 15.5082 0.000e+00 0.0001297 0.0001297 0.0001297 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.0000000 [17,] 321 16.5082 0.000e+00 0.0001297 0.0001297 0.0001297 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.0000000 [18,] 322 17.5082 0.000e+00 0.0001297 0.0001297 0.0001297 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.0000000 [19,] 323 18.5082 0.000e+00 0.0001297 0.0001297 0.0001297 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.0000000 3.141593e-306 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -0.3949 1.000e+00 1.000000 1.000000 1.000000 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.000000 [2,] 306 0.6051 4.507e-02 0.045070 0.045070 0.045070 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0.045070 [3,] 307 1.6051 1.324e-02 0.013239 0.013239 0.013239 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0.013239 [4,] 308 2.6051 5.070e-04 0.000507 0.000507 0.000507 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0.000507 [5,] 309 3.6051 1.297e-04 0.000507 0.000507 0.000507 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0.000000 [6,] 310 4.6051 2.338e-06 0.000507 0.000507 0.000507 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0.000000 [7,] 311 5.6051 8.447e-07 0.000507 0.000507 0.000507 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0.000000 [8,] 312 6.6051 1.103e-07 0.000507 0.000507 0.000507 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0.000000 [9,] 313 7.6051 1.477e-08 0.000507 0.000507 0.000507 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.000000 [10,] 314 8.6051 1.143e-09 0.000507 0.000507 0.000507 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.000000 [11,] 315 9.6051 1.306e-10 0.000507 0.000507 0.000507 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.000000 [12,] 316 10.6051 3.249e-12 0.000507 0.000507 0.000507 3.248e-12 3.248e-12 3.249e-12 3.248e-12 0.000000 [13,] 317 11.6051 6.583e-14 0.000507 0.000507 0.000507 6.522e-14 6.522e-14 6.583e-14 6.522e-14 0.000000 [14,] 318 12.6051 6.583e-14 0.000507 0.000507 0.000507 6.522e-14 6.522e-14 6.583e-14 6.502e-14 0.000000 [15,] 319 13.6051 2.013e-15 0.000507 0.000507 0.000507 1.409e-15 1.409e-15 2.013e-15 1.409e-15 0.000000 [16,] 320 14.6051 1.208e-15 0.000507 0.000507 0.000507 1.409e-15 1.409e-15 1.208e-15 1.610e-15 0.000000 [17,] 321 15.6051 2.013e-16 0.000507 0.000507 0.000507 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000000 [18,] 322 16.6051 0.000e+00 0.000507 0.000507 0.000507 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000000 [19,] 323 17.6051 0.000e+00 0.000507 0.000507 0.000507 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000000 3.141593e-307 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -1.5991 1.000e+00 1.00000 1.00000 1.00000 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.00000 [2,] 306 -0.5991 1.000e+00 1.00000 1.00000 1.00000 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.00000 [3,] 307 0.4009 4.507e-02 0.04507 0.04507 0.04507 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0.04507 [4,] 308 1.4009 1.324e-02 0.01324 0.01324 0.01324 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0.01324 [5,] 309 2.4009 5.070e-04 0.01324 0.01324 0.01324 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0.00000 [6,] 310 3.4009 1.297e-04 0.01324 0.01324 0.01324 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0.00000 [7,] 311 4.4009 2.338e-06 0.01324 0.01324 0.01324 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0.00000 [8,] 312 5.4009 8.447e-07 0.01324 0.01324 0.01324 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0.00000 [9,] 313 6.4009 1.103e-07 0.01324 0.01324 0.01324 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0.00000 [10,] 314 7.4009 1.477e-08 0.01324 0.01324 0.01324 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.00000 [11,] 315 8.4009 1.143e-09 0.01324 0.01324 0.01324 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.00000 [12,] 316 9.4009 1.306e-10 0.01324 0.01324 0.01324 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.00000 [13,] 317 10.4009 3.249e-12 0.01324 0.01324 0.01324 3.248e-12 3.248e-12 3.249e-12 3.248e-12 0.00000 [14,] 318 11.4009 6.567e-14 0.01324 0.01324 0.01324 6.517e-14 6.517e-14 6.567e-14 6.517e-14 0.00000 [15,] 319 12.4009 6.567e-14 0.01324 0.01324 0.01324 6.517e-14 6.517e-14 6.567e-14 6.505e-14 0.00000 [16,] 320 13.4009 2.013e-15 0.01324 0.01324 0.01324 1.510e-15 1.510e-15 2.013e-15 1.384e-15 0.00000 [17,] 321 14.4009 1.132e-15 0.01324 0.01324 0.01324 1.510e-15 1.510e-15 1.132e-15 1.510e-15 0.00000 [18,] 322 15.4009 1.258e-16 0.01324 0.01324 0.01324 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.00000 [19,] 323 16.4009 0.000e+00 0.01324 0.01324 0.01324 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.00000 3.141593e-308 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -2.5021 1.000e+00 1.00000 1.00000 1.00000 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.00000 [2,] 306 -1.5021 1.000e+00 1.00000 1.00000 1.00000 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.00000 [3,] 307 -0.5021 1.000e+00 1.00000 1.00000 1.00000 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1.00000 [4,] 308 0.4979 4.507e-02 0.04507 0.04507 0.04507 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0.04507 [5,] 309 1.4979 1.324e-02 0.04507 0.04507 0.04507 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0.00000 [6,] 310 2.4979 5.070e-04 0.04507 0.04507 0.04507 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0.00000 [7,] 311 3.4979 1.297e-04 0.04507 0.04507 0.04507 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0.00000 [8,] 312 4.4979 2.338e-06 0.04507 0.04507 0.04507 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0.00000 [9,] 313 5.4979 8.447e-07 0.04507 0.04507 0.04507 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0.00000 [10,] 314 6.4979 1.103e-07 0.04507 0.04507 0.04507 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0.00000 [11,] 315 7.4979 1.477e-08 0.04507 0.04507 0.04507 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0.00000 [12,] 316 8.4979 1.143e-09 0.04507 0.04507 0.04507 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0.00000 [13,] 317 9.4979 1.306e-10 0.04507 0.04507 0.04507 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0.00000 [14,] 318 10.4979 3.249e-12 0.04507 0.04507 0.04507 3.248e-12 3.248e-12 3.249e-12 3.248e-12 0.00000 [15,] 319 11.4979 6.589e-14 0.04507 0.04507 0.04507 6.527e-14 6.527e-14 6.589e-14 6.542e-14 0.00000 [16,] 320 12.4979 6.589e-14 0.04507 0.04507 0.04507 6.527e-14 6.527e-14 6.589e-14 6.527e-14 0.00000 [17,] 321 13.4979 2.202e-15 0.04507 0.04507 0.04507 1.730e-15 1.730e-15 2.202e-15 1.573e-15 0.00000 [18,] 322 14.4979 9.436e-16 0.04507 0.04507 0.04507 1.730e-15 1.730e-15 9.436e-16 1.573e-15 0.00000 [19,] 323 15.4979 0.000e+00 0.04507 0.04507 0.04507 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.00000 3.141593e-309 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -3.4052 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -2.4052 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -1.4052 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -0.4052 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 0.5948 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [6,] 310 1.5948 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [7,] 311 2.5948 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [8,] 312 3.5948 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [9,] 313 4.5948 2.338e-06 1 1 1 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0 [10,] 314 5.5948 8.447e-07 1 1 1 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0 [11,] 315 6.5948 1.103e-07 1 1 1 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0 [12,] 316 7.5948 1.477e-08 1 1 1 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0 [13,] 317 8.5948 1.143e-09 1 1 1 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0 [14,] 318 9.5948 1.306e-10 1 1 1 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0 [15,] 319 10.5948 3.246e-12 1 1 1 3.246e-12 3.246e-12 3.246e-12 3.246e-12 0 [16,] 320 11.5948 6.291e-14 1 1 1 6.291e-14 6.291e-14 6.291e-14 6.291e-14 0 [17,] 321 12.5948 6.291e-14 1 1 1 6.291e-14 6.291e-14 6.291e-14 6.291e-14 0 [18,] 322 13.5948 0.000e+00 1 1 1 1.573e-15 1.573e-15 0.000e+00 1.573e-15 0 [19,] 323 14.5948 0.000e+00 1 1 1 1.573e-15 1.573e-15 0.000e+00 0.000e+00 0 3.141593e-310 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -4.6094 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -3.6094 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -2.6094 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -1.6094 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -0.6094 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 0.3906 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [7,] 311 1.3906 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [8,] 312 2.3906 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [9,] 313 3.3906 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [10,] 314 4.3906 2.338e-06 1 1 1 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0 [11,] 315 5.3906 8.447e-07 1 1 1 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0 [12,] 316 6.3906 1.103e-07 1 1 1 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0 [13,] 317 7.3906 1.477e-08 1 1 1 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0 [14,] 318 8.3906 1.143e-09 1 1 1 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0 [15,] 319 9.3906 1.306e-10 1 1 1 1.306e-10 1.306e-10 1.306e-10 1.306e-10 0 [16,] 320 10.3906 3.240e-12 1 1 1 3.240e-12 3.240e-12 3.240e-12 3.240e-12 0 [17,] 321 11.3906 6.291e-14 1 1 1 6.291e-14 6.291e-14 6.291e-14 6.291e-14 0 [18,] 322 12.3906 6.291e-14 1 1 1 6.291e-14 6.291e-14 6.291e-14 6.291e-14 0 [19,] 323 13.3906 0.000e+00 1 1 1 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0 3.141593e-311 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -5.5124 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -4.5124 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -3.5124 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -2.5124 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -1.5124 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -0.5124 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 0.4876 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [8,] 312 1.4876 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [9,] 313 2.4876 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [10,] 314 3.4876 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [11,] 315 4.4876 2.338e-06 1 1 1 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0 [12,] 316 5.4876 8.447e-07 1 1 1 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0 [13,] 317 6.4876 1.103e-07 1 1 1 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0 [14,] 318 7.4876 1.477e-08 1 1 1 1.477e-08 1.477e-08 1.477e-08 1.477e-08 0 [15,] 319 8.4876 1.143e-09 1 1 1 1.143e-09 1.143e-09 1.143e-09 1.143e-09 0 [16,] 320 9.4876 1.307e-10 1 1 1 1.307e-10 1.307e-10 1.307e-10 1.307e-10 0 [17,] 321 10.4876 3.303e-12 1 1 1 3.303e-12 3.303e-12 3.303e-12 3.303e-12 0 [18,] 322 11.4876 1.573e-13 1 1 1 1.573e-13 1.573e-13 1.573e-13 1.573e-13 0 [19,] 323 12.4876 1.573e-13 1 1 1 1.573e-13 1.573e-13 1.573e-13 1.573e-13 0 3.141593e-312 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -6.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -5.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -4.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -3.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -2.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -1.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -0.4155 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 0.5845 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [9,] 313 1.5845 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [10,] 314 2.5845 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [11,] 315 3.5845 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [12,] 316 4.5845 2.338e-06 1 1 1 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0 [13,] 317 5.5845 8.447e-07 1 1 1 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0 [14,] 318 6.5845 1.103e-07 1 1 1 1.103e-07 1.103e-07 1.103e-07 1.103e-07 0 [15,] 319 7.5845 1.478e-08 1 1 1 1.478e-08 1.478e-08 1.478e-08 1.478e-08 0 [16,] 320 8.5845 1.140e-09 1 1 1 1.140e-09 1.140e-09 1.140e-09 1.140e-09 0 [17,] 321 9.5845 1.321e-10 1 1 1 1.321e-10 1.321e-10 1.321e-10 1.321e-10 0 [18,] 322 10.5845 4.718e-12 1 1 1 4.718e-12 4.718e-12 4.718e-12 4.718e-12 0 [19,] 323 11.5845 1.573e-12 1 1 1 1.573e-12 1.573e-12 1.573e-12 1.573e-12 0 3.141593e-313 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -7.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -6.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -5.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -4.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -3.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -2.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -1.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -0.6197 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 0.3803 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [10,] 314 1.3803 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [11,] 315 2.3803 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [12,] 316 3.3803 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [13,] 317 4.3803 2.338e-06 1 1 1 2.338e-06 2.338e-06 2.338e-06 2.338e-06 0 [14,] 318 5.3803 8.447e-07 1 1 1 8.447e-07 8.447e-07 8.447e-07 8.447e-07 0 [15,] 319 6.3803 1.102e-07 1 1 1 1.102e-07 1.102e-07 1.102e-07 1.102e-07 0 [16,] 320 7.3803 1.475e-08 1 1 1 1.475e-08 1.475e-08 1.475e-08 1.475e-08 0 [17,] 321 8.3803 1.164e-09 1 1 1 1.164e-09 1.164e-09 1.164e-09 1.164e-09 0 [18,] 322 9.3803 1.101e-10 1 1 1 1.101e-10 1.101e-10 1.101e-10 1.101e-10 0 [19,] 323 10.3803 1.573e-11 1 1 1 1.573e-11 1.573e-11 1.573e-11 1.573e-11 0 3.141593e-314 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -8.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -7.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -6.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -5.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -4.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -3.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -2.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -1.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 -0.5227 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [10,] 314 0.4773 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [11,] 315 1.4773 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [12,] 316 2.4773 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [13,] 317 3.4773 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [14,] 318 4.4773 2.339e-06 1 1 1 2.339e-06 2.339e-06 2.339e-06 2.339e-06 0 [15,] 319 5.4773 8.445e-07 1 1 1 8.445e-07 8.445e-07 8.445e-07 8.445e-07 0 [16,] 320 6.4773 1.104e-07 1 1 1 1.104e-07 1.104e-07 1.104e-07 1.104e-07 0 [17,] 321 7.4773 1.494e-08 1 1 1 1.494e-08 1.494e-08 1.494e-08 1.494e-08 0 [18,] 322 8.4773 1.101e-09 1 1 1 1.101e-09 1.101e-09 1.101e-09 1.101e-09 0 [19,] 323 9.4773 1.573e-10 1 1 1 1.573e-10 1.573e-10 1.573e-10 1.573e-10 0 3.141593e-315 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -9.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -8.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -7.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -6.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -5.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -4.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -3.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -2.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 -1.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [10,] 314 -0.4258 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [11,] 315 0.5742 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [12,] 316 1.5742 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [13,] 317 2.5742 5.070e-04 1 1 1 5.070e-04 5.070e-04 5.070e-04 5.070e-04 0 [14,] 318 3.5742 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [15,] 319 4.5742 2.340e-06 1 1 1 2.340e-06 2.340e-06 2.340e-06 2.340e-06 0 [16,] 320 5.5742 8.429e-07 1 1 1 8.429e-07 8.429e-07 8.429e-07 8.429e-07 0 [17,] 321 6.5742 1.117e-07 1 1 1 1.117e-07 1.117e-07 1.117e-07 1.117e-07 0 [18,] 322 7.5742 1.573e-08 1 1 1 1.573e-08 1.573e-08 1.573e-08 1.573e-08 0 [19,] 323 8.5742 0.000e+00 1 1 1 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0 3.141593e-316 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -10.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -9.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -8.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -7.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -6.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -5.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -4.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -3.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 -2.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [10,] 314 -1.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [11,] 315 -0.63 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [12,] 316 0.37 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [13,] 317 1.37 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [14,] 318 2.37 5.069e-04 1 1 1 5.069e-04 5.069e-04 5.069e-04 5.069e-04 0 [15,] 319 3.37 1.297e-04 1 1 1 1.297e-04 1.297e-04 1.297e-04 1.297e-04 0 [16,] 320 4.37 2.359e-06 1 1 1 2.359e-06 2.359e-06 2.359e-06 2.359e-06 0 [17,] 321 5.37 8.335e-07 1 1 1 8.335e-07 8.335e-07 8.335e-07 8.335e-07 0 [18,] 322 6.37 1.258e-07 1 1 1 1.258e-07 1.258e-07 1.258e-07 1.258e-07 0 [19,] 323 7.37 0.000e+00 1 1 1 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0 3.141593e-317 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -11.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -10.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -9.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -8.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -7.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -6.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -5.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -4.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 -3.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [10,] 314 -2.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [11,] 315 -1.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [12,] 316 -0.533 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [13,] 317 0.467 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [14,] 318 1.467 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [15,] 319 2.467 5.072e-04 1 1 1 5.072e-04 5.072e-04 5.072e-04 5.072e-04 0 [16,] 320 3.467 1.294e-04 1 1 1 1.294e-04 1.294e-04 1.294e-04 1.294e-04 0 [17,] 321 4.467 2.044e-06 1 1 1 2.044e-06 2.044e-06 2.044e-06 2.044e-06 0 [18,] 322 5.467 1.101e-06 1 1 1 1.101e-06 1.101e-06 1.101e-06 1.101e-06 0 [19,] 323 6.467 1.573e-07 1 1 1 1.573e-07 1.573e-07 1.573e-07 1.573e-07 0 3.141591e-318 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -12.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -11.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -10.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -9.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -8.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -7.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -6.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -5.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 -4.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [10,] 314 -3.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [11,] 315 -2.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [12,] 316 -1.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [13,] 317 -0.4361 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [14,] 318 0.5639 4.507e-02 1 1 1 4.507e-02 4.507e-02 4.507e-02 4.507e-02 0 [15,] 319 1.5639 1.324e-02 1 1 1 1.324e-02 1.324e-02 1.324e-02 1.324e-02 0 [16,] 320 2.5639 5.064e-04 1 1 1 5.064e-04 5.064e-04 5.064e-04 5.064e-04 0 [17,] 321 3.5639 1.305e-04 1 1 1 1.305e-04 1.305e-04 1.305e-04 1.305e-04 0 [18,] 322 4.5639 3.145e-06 1 1 1 3.145e-06 3.145e-06 3.145e-06 3.145e-06 0 [19,] 323 5.5639 0.000e+00 1 1 1 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0 3.141566e-319 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -13.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [2,] 306 -12.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [3,] 307 -11.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [4,] 308 -10.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 1 [5,] 309 -9.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [6,] 310 -8.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [7,] 311 -7.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [8,] 312 -6.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [9,] 313 -5.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [10,] 314 -4.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [11,] 315 -3.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [12,] 316 -2.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [13,] 317 -1.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [14,] 318 -0.6403 1.000e+00 1 1 1 1.000e+00 1.000e+00 1.000e+00 1.000e+00 0 [15,] 319 0.3597 4.506e-02 1 1 1 4.506e-02 4.506e-02 4.506e-02 4.506e-02 0 [16,] 320 1.3597 1.323e-02 1 1 1 1.323e-02 1.323e-02 1.323e-02 1.323e-02 0 [17,] 321 2.3597 5.033e-04 1 1 1 5.033e-04 5.033e-04 5.033e-04 5.033e-04 0 [18,] 322 3.3597 1.415e-04 1 1 1 1.415e-04 1.415e-04 1.415e-04 1.415e-04 0 [19,] 323 4.3597 1.573e-05 1 1 1 1.573e-05 1.573e-05 1.573e-05 1.573e-05 0 3.141763e-320 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -14.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [2,] 306 -13.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [3,] 307 -12.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [4,] 308 -11.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [5,] 309 -10.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [6,] 310 -9.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [7,] 311 -8.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [8,] 312 -7.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [9,] 313 -6.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [10,] 314 -5.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [11,] 315 -4.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [12,] 316 -3.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [13,] 317 -2.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [14,] 318 -1.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [15,] 319 -0.5433 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [16,] 320 0.4567 0.045133 1 1 1 0.045133 0.045133 0.045133 0.045133 0 [17,] 321 1.4567 0.013367 1 1 1 0.013367 0.013367 0.013367 0.013367 0 [18,] 322 2.4567 0.000629 1 1 1 0.000629 0.000629 0.000629 0.000629 0 [19,] 323 3.4567 0.000000 1 1 1 0.000000 0.000000 0.000000 0.000000 0 3.137317e-321 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -15.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [2,] 306 -14.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [3,] 307 -13.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [4,] 308 -12.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 1 [5,] 309 -11.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [6,] 310 -10.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [7,] 311 -9.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [8,] 312 -8.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [9,] 313 -7.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [10,] 314 -6.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [11,] 315 -5.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [12,] 316 -4.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [13,] 317 -3.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [14,] 318 -2.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [15,] 319 -1.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [16,] 320 -0.4464 1.000000 1 1 1 1.000000 1.000000 1.000000 1.000000 0 [17,] 321 0.5536 0.044094 1 1 1 0.044094 0.044094 0.044094 0.044094 0 [18,] 322 1.5536 0.012598 1 1 1 0.012598 0.012598 0.012598 0.012598 0 [19,] 323 2.5536 0.001575 1 1 1 0.001575 0.001575 0.001575 0.001575 0 3.112614e-322 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -16.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 1 [2,] 306 -15.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 1 [3,] 307 -14.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 1 [4,] 308 -13.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 1 [5,] 309 -12.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [6,] 310 -11.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [7,] 311 -10.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [8,] 312 -9.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [9,] 313 -8.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [10,] 314 -7.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [11,] 315 -6.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [12,] 316 -5.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [13,] 317 -4.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [14,] 318 -3.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [15,] 319 -2.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [16,] 320 -1.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [17,] 321 -0.6506 1.00000 1 1 1 1.00000 1.00000 1.00000 1.00000 0 [18,] 322 0.3494 0.03175 1 1 1 0.03175 0.03175 0.03175 0.03175 0 [19,] 323 1.3494 0.00000 1 1 1 0.00000 0.00000 0.00000 0.00000 0 2.964394e-323 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -17.5536 1 1 1 1 1 1 1 1 1 [2,] 306 -16.5536 1 1 1 1 1 1 1 1 1 [3,] 307 -15.5536 1 1 1 1 1 1 1 1 1 [4,] 308 -14.5536 1 1 1 1 1 1 1 1 1 [5,] 309 -13.5536 1 1 1 1 1 1 1 1 0 [6,] 310 -12.5536 1 1 1 1 1 1 1 1 0 [7,] 311 -11.5536 1 1 1 1 1 1 1 1 0 [8,] 312 -10.5536 1 1 1 1 1 1 1 1 0 [9,] 313 -9.5536 1 1 1 1 1 1 1 1 0 [10,] 314 -8.5536 1 1 1 1 1 1 1 1 0 [11,] 315 -7.5536 1 1 1 1 1 1 1 1 0 [12,] 316 -6.5536 1 1 1 1 1 1 1 1 0 [13,] 317 -5.5536 1 1 1 1 1 1 1 1 0 [14,] 318 -4.5536 1 1 1 1 1 1 1 1 0 [15,] 319 -3.5536 1 1 1 1 1 1 1 1 0 [16,] 320 -2.5536 1 1 1 1 1 1 1 1 0 [17,] 321 -1.5536 1 1 1 1 1 1 1 1 0 [18,] 322 -0.5536 1 1 1 1 1 1 1 1 0 [19,] 323 0.4464 0 1 1 1 0 0 0 0 0 4.940656e-324 : dig d+l10 sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 305 -18.1557 1 1 1 1 1 1 1 1 1 [2,] 306 -17.1557 1 1 1 1 1 1 1 1 1 [3,] 307 -16.1557 1 1 1 1 1 1 1 1 1 [4,] 308 -15.1557 1 1 1 1 1 1 1 1 1 [5,] 309 -14.1557 1 1 1 1 1 1 1 1 0 [6,] 310 -13.1557 1 1 1 1 1 1 1 1 0 [7,] 311 -12.1557 1 1 1 1 1 1 1 1 0 [8,] 312 -11.1557 1 1 1 1 1 1 1 1 0 [9,] 313 -10.1557 1 1 1 1 1 1 1 1 0 [10,] 314 -9.1557 1 1 1 1 1 1 1 1 0 [11,] 315 -8.1557 1 1 1 1 1 1 1 1 0 [12,] 316 -7.1557 1 1 1 1 1 1 1 1 0 [13,] 317 -6.1557 1 1 1 1 1 1 1 1 0 [14,] 318 -5.1557 1 1 1 1 1 1 1 1 0 [15,] 319 -4.1557 1 1 1 1 1 1 1 1 0 [16,] 320 -3.1557 1 1 1 1 1 1 1 1 0 [17,] 321 -2.1557 1 1 1 1 1 1 1 1 0 [18,] 322 -1.1557 1 1 1 1 1 1 1 1 0 [19,] 323 -0.1557 1 1 1 1 1 1 1 1 0 > > > ###--- keep in sync with ../man/roundX.Rd ------------------ > > ## There now have "exhaustive small digit cases" > ## where the conclusion could be that "r1" is best > > ### More studies -- Study of small digits cases ---------------------------------------- > > ## 1. all numbers in [0,1] > set.seed(47) > I <- c(0:999, randI(1000, 4), randI(2000, 5), randI(3000, 6)) > ndI <- 1L + as.integer(log10(pmax(1,I))) # number of (decimal) digits of I > Ix <- I + 0.5 > x <- Ix / (10^ndI) # numbers to be rounded; all of the form .5 > SM <- roundAll(x, digits = ndI) > print(cbind(x, ndI, SM)[1:100,], digits = 9) x ndI sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 [1,] 0.050 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 [2,] 0.150 1 0.10 0.20 0.20 0.20 0.20 0.20 0.10 0.10 0.10 [3,] 0.250 1 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 [4,] 0.350 1 0.30 0.40 0.40 0.40 0.40 0.40 0.30 0.30 0.30 [5,] 0.450 1 0.40 0.40 0.40 0.40 0.40 0.40 0.40 0.40 0.40 [6,] 0.550 1 0.60 0.60 0.60 0.60 0.60 0.60 0.60 0.60 0.60 [7,] 0.650 1 0.60 0.60 0.60 0.60 0.60 0.60 0.70 0.70 0.70 [8,] 0.750 1 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 [9,] 0.850 1 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 [10,] 0.950 1 0.90 1.00 1.00 1.00 1.00 1.00 0.90 0.90 0.90 [11,] 0.105 2 0.10 0.10 0.10 0.10 0.10 0.10 0.10 0.10 0.10 [12,] 0.115 2 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 [13,] 0.125 2 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 [14,] 0.135 2 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 [15,] 0.145 2 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 [16,] 0.155 2 0.15 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 [17,] 0.165 2 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.16 [18,] 0.175 2 0.17 0.18 0.18 0.18 0.18 0.18 0.17 0.17 0.17 [19,] 0.185 2 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 [20,] 0.195 2 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 [21,] 0.205 2 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 0.20 [22,] 0.215 2 0.21 0.22 0.22 0.22 0.22 0.22 0.22 0.22 0.22 [23,] 0.225 2 0.22 0.22 0.22 0.22 0.22 0.22 0.22 0.22 0.22 [24,] 0.235 2 0.23 0.24 0.24 0.24 0.24 0.24 0.23 0.23 0.23 [25,] 0.245 2 0.24 0.24 0.24 0.24 0.24 0.24 0.24 0.24 0.24 [26,] 0.255 2 0.26 0.26 0.26 0.26 0.26 0.26 0.26 0.26 0.26 [27,] 0.265 2 0.26 0.26 0.26 0.26 0.26 0.26 0.26 0.26 0.26 [28,] 0.275 2 0.28 0.28 0.28 0.28 0.28 0.28 0.28 0.28 0.28 [29,] 0.285 2 0.28 0.28 0.28 0.28 0.28 0.28 0.28 0.28 0.28 [30,] 0.295 2 0.29 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 [31,] 0.305 2 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 0.30 [32,] 0.315 2 0.32 0.32 0.32 0.32 0.32 0.32 0.32 0.32 0.32 [33,] 0.325 2 0.32 0.32 0.32 0.32 0.32 0.32 0.32 0.32 0.32 [34,] 0.335 2 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 [35,] 0.345 2 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 [36,] 0.355 2 0.35 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 [37,] 0.365 2 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 0.36 [38,] 0.375 2 0.38 0.38 0.38 0.38 0.38 0.38 0.38 0.38 0.38 [39,] 0.385 2 0.38 0.38 0.38 0.38 0.38 0.38 0.38 0.38 0.38 [40,] 0.395 2 0.40 0.40 0.40 0.40 0.40 0.40 0.40 0.40 0.40 [41,] 0.405 2 0.40 0.40 0.40 0.40 0.40 0.40 0.41 0.41 0.41 [42,] 0.415 2 0.41 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 [43,] 0.425 2 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 0.42 [44,] 0.435 2 0.43 0.44 0.44 0.44 0.44 0.44 0.44 0.44 0.44 [45,] 0.445 2 0.44 0.44 0.44 0.44 0.44 0.44 0.44 0.44 0.44 [46,] 0.455 2 0.46 0.46 0.46 0.46 0.46 0.46 0.46 0.46 0.46 [47,] 0.465 2 0.46 0.46 0.46 0.46 0.46 0.46 0.47 0.47 0.47 [48,] 0.475 2 0.47 0.48 0.48 0.48 0.48 0.48 0.48 0.48 0.48 [49,] 0.485 2 0.48 0.48 0.48 0.48 0.48 0.48 0.48 0.48 0.48 [50,] 0.495 2 0.49 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50 [51,] 0.505 2 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50 0.50 [52,] 0.515 2 0.52 0.52 0.52 0.52 0.52 0.52 0.52 0.52 0.52 [53,] 0.525 2 0.52 0.52 0.52 0.52 0.52 0.52 0.52 0.52 0.52 [54,] 0.535 2 0.54 0.54 0.54 0.54 0.54 0.54 0.54 0.54 0.54 [55,] 0.545 2 0.54 0.55 0.55 0.55 0.55 0.55 0.54 0.54 0.54 [56,] 0.555 2 0.56 0.56 0.56 0.56 0.56 0.56 0.56 0.56 0.56 [57,] 0.565 2 0.56 0.56 0.56 0.56 0.56 0.56 0.56 0.56 0.56 [58,] 0.575 2 0.57 0.57 0.57 0.57 0.57 0.57 0.58 0.58 0.58 [59,] 0.585 2 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 0.58 [60,] 0.595 2 0.59 0.60 0.60 0.60 0.60 0.60 0.60 0.60 0.60 [61,] 0.605 2 0.60 0.60 0.60 0.60 0.60 0.60 0.60 0.60 0.60 [62,] 0.615 2 0.61 0.62 0.62 0.62 0.62 0.62 0.62 0.62 0.62 [63,] 0.625 2 0.62 0.62 0.62 0.62 0.62 0.62 0.62 0.62 0.62 [64,] 0.635 2 0.64 0.64 0.64 0.64 0.64 0.64 0.64 0.64 0.64 [65,] 0.645 2 0.64 0.64 0.64 0.64 0.64 0.64 0.64 0.64 0.64 [66,] 0.655 2 0.66 0.66 0.66 0.66 0.66 0.66 0.66 0.66 0.66 [67,] 0.665 2 0.66 0.66 0.66 0.66 0.66 0.66 0.66 0.66 0.66 [68,] 0.675 2 0.68 0.68 0.68 0.68 0.68 0.68 0.68 0.68 0.68 [69,] 0.685 2 0.68 0.68 0.68 0.68 0.68 0.68 0.69 0.69 0.69 [70,] 0.695 2 0.69 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 [71,] 0.705 2 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 0.70 [72,] 0.715 2 0.71 0.72 0.72 0.72 0.72 0.72 0.72 0.72 0.72 [73,] 0.725 2 0.72 0.72 0.72 0.72 0.72 0.72 0.72 0.72 0.72 [74,] 0.735 2 0.73 0.74 0.74 0.74 0.74 0.74 0.74 0.74 0.74 [75,] 0.745 2 0.74 0.74 0.74 0.74 0.74 0.74 0.74 0.74 0.74 [76,] 0.755 2 0.76 0.76 0.76 0.76 0.76 0.76 0.76 0.76 0.76 [77,] 0.765 2 0.76 0.76 0.76 0.76 0.76 0.76 0.76 0.76 0.76 [78,] 0.775 2 0.78 0.78 0.78 0.78 0.78 0.78 0.78 0.78 0.78 [79,] 0.785 2 0.78 0.78 0.78 0.78 0.78 0.78 0.78 0.78 0.78 [80,] 0.795 2 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 [81,] 0.805 2 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 0.80 [82,] 0.815 2 0.81 0.82 0.82 0.82 0.82 0.82 0.81 0.81 0.81 [83,] 0.825 2 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 0.82 [84,] 0.835 2 0.83 0.84 0.84 0.84 0.84 0.84 0.84 0.84 0.84 [85,] 0.845 2 0.84 0.84 0.84 0.84 0.84 0.84 0.84 0.84 0.84 [86,] 0.855 2 0.85 0.86 0.86 0.86 0.86 0.86 0.86 0.86 0.86 [87,] 0.865 2 0.86 0.86 0.86 0.86 0.86 0.86 0.86 0.86 0.86 [88,] 0.875 2 0.88 0.88 0.88 0.88 0.88 0.88 0.88 0.88 0.88 [89,] 0.885 2 0.88 0.88 0.88 0.88 0.88 0.88 0.88 0.88 0.88 [90,] 0.895 2 0.90 0.90 0.90 0.90 0.90 0.90 0.90 0.90 0.90 [91,] 0.905 2 0.90 0.90 0.90 0.90 0.90 0.90 0.90 0.90 0.90 [92,] 0.915 2 0.92 0.92 0.92 0.92 0.92 0.92 0.92 0.92 0.92 [93,] 0.925 2 0.92 0.92 0.92 0.92 0.92 0.92 0.92 0.92 0.92 [94,] 0.935 2 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94 [95,] 0.945 2 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94 0.94 [96,] 0.955 2 0.95 0.96 0.96 0.96 0.96 0.96 0.96 0.96 0.96 [97,] 0.965 2 0.96 0.96 0.96 0.96 0.96 0.96 0.96 0.96 0.96 [98,] 0.975 2 0.97 0.98 0.98 0.98 0.98 0.98 0.98 0.98 0.98 [99,] 0.985 2 0.98 0.98 0.98 0.98 0.98 0.98 0.98 0.98 0.98 [100,] 0.995 2 0.99 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 > ## sprintf *is* quite different from the r[12]* R versions ... > > ## Error, assuming "r3" to be best, as it *does* really go to nearest: > errM <- SM - SM[,"r3"] > rbind(exact = colSums(err0 <- errM != 0) , # (can have very small irrelevant differences) + relevant= colSums(errT <- abs(errM) > .001*10^-ndI)) # --> sprintf clearly 2nd best (has changed +1) sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 exact 1460 1829 1829 1829 1829 1829 2 0 0 relevant 1459 1828 1828 1828 1828 1828 1 0 0 > ## For F30 Linux 64-bit (gcc): > ## sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 > ## exact 1494 1829 1829 1829 1829 1829 2 0 0 > ## relevant 1493 1828 1828 1828 1828 1828 1 0 0 > > > ## The middle round() versions ("r0*", "r1*", "r2*") all give the same (here, for x in [0,1]): > (ver012 <- grep("^r[012]", roundVersions, value=TRUE)) [1] "r0.C" "r1.C" "r1a.C" "r2.C" "r2a.C" > stopifnot(same_cols(errM[, ver012])) > > ## Visualization of error happening > cumErr <- apply(errT[,colnames(SM) != "r3"], 2L, cumsum) > matPm(cumErr) > sp <- search() > if(require("Matrix")) { + showSp <- function(m) print(image(as(m, "sparseMatrix"), aspect = 4, + ## fails, bug in lattice? useRaster = !dev.interactive(TRUE) && (nrow(m) >= 2^12), + border.col = if(nrow(m) < 1e3) adjustcolor(1, 1/2) else NA)) + showSp(errM[1:100,]) + showSp(errM) + showSp(errM != 0) + } Loading required package: Matrix > > ## 2. Numbers of varying sizes : > n <- length(I) > n1 <- round(n*.4) > n2 <- n - n1 > set.seed(7) > dp <- sample(c(sample( -2:2, n1, replace=TRUE), + sample(c(-1,1), n2, replace=TRUE) * rpois(n2, lambda = pi))) > stopifnot(length(dp) == n) > nd2 <- ndI + dp > nd2[nd2 == 0] <- 1 + rpois(sum(nd2 == 0), 0.5) > x <- Ix / (10^nd2) > S2 <- roundAll(x, digits = nd2) # --> warning "NAs introduced by coercion" > ## "Error", assuming "r3" to be best, as it *does* really go to nearest: > dP <- nd2 >= 0 # as negative digits don't work for "sprintf" > err2 <- S2[dP,] - S2[dP, "r3"] > rbind(exact = colSums(err0 <- err2 != 0), # (not quite correct) + relevant= colSums(err2T <- abs(err2) > .01*10^-nd2[dP])) # --> sprintf is *worst* ! sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 exact 1617 1454 1503 1503 1454 1454 1 0 0 relevant 1616 1453 1502 1502 1453 1453 0 0 0 > ## For F30 Linux 64-bit (gcc): > ## sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 > ## exact 1639 1454 1503 1503 1454 1454 1 0 0 > ## relevant 1638 1453 1502 1502 1453 1453 0 0 0 > > ## Visualization of error happening > cumEr2 <- apply(err2T, 2L, cumsum) > matPm(cumEr2[,colnames(S2) != "r3"]) > ## Really 4 distinct groups: r0-r2* || r1* || sprintf || r3* > plot(hclust(dist(t(cumEr2)/1e6, "manhattan"))) > > if(require("Matrix")) { + showSp(err2[1:100,]) + showSp(err2) + showSp(err2 != 0) + } > stopifnot(same_cols(err2[, c("r0.C", "r2.C", "r2a.C")])) > > ## The "3C" versions *not* identical to the last bit but > stopifnot(same_cols(err2T[, c("r3.C", "r3d.C")])) # the "3C" versions are equivalent > > > ## 3. Even more "widely varying" sizes and digits: > set.seed(43) > I <- c(0:9999, randI(2000, 6), randI(8000, 8), randI(20000, 11), randI(40000, 12)) > ndI <- 1L + as.integer(log10(pmax(1,I))) # number of (decimal) digits of I > Ix <- I + 0.5 > n <- length(I) > n1 <- round(n*.4) > n2 <- n - n1 ## length(I) =: n == n1+n2 > set.seed(7) > dp <- sample(c(sample(-2:2, n1, replace=TRUE), + sample(c(-1,1), n2, replace=TRUE) * rpois(n2, lambda = 7))) > stopifnot(length(dp) == n) > nd3 <- ndI + dp ## nd3 := #{digits} to round to .. should all be >= 1 : > nd3[nd3 == 0] <- 1 + rpois(sum(nd3 == 0), 0.5) > x <- Ix / (10^nd3) > S3 <- roundAll(x, digits = nd3) # --> warnings ... > ## err3 := "Error", assuming "r3" to be correct .. > dP <- nd3 >= 0 # as negative digits don't work for "sprintf" > err3 <- S3[dP,] - S3[dP, "r3"] > > rbind(exact = colSums(err3. <- err3 != 0), # (not quite correct) + relevant= colSums(err3T <- abs(err3) > .01*10^-nd3[dP])) # --> sprintf is *worst* ! sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 exact 18831 16570 16974 16974 16570 16570 737 0 0 relevant 18580 16564 16968 16968 16564 16564 488 0 0 > ## For F30 Linux 64-bit (gcc): > ## sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 > ## exact 18958.17108 17512 17512 17108 17108 752 688 0 (earlier 2020?) > ## exact 18885 17108 17512 17512 17108 17108 752 688 0 > ## relevant 18609 16762 17166 17166 16762 16762 464 357 0 > > ## "r0*" and "r2*" are the same (here), and so are the two "r1*" : > stopifnot(same_cols(err3[, vg1 <- c("r0.C", "r2.C", "r2a.C")]), + same_cols(err3[, vg2 <- c("r1.C", "r1a.C")])) > > > ## Visualization of error happening > cumEr3 <- apply(err3T, 2L, cumsum) > matPm(cumEr3[,colnames(S3) != "r3"]) > plot(hclust(dist(t(cumEr3)/1e6, "manhattan"))) > > if(require("Matrix")) { + showSp(err3[1:100,]) # 0:99 + showSp(err3[1:1000,]) # 0:999 + showSp(err3) + showSp(err3 != 0) # B/W version of the above + } > > ## if(!any(sp == "package:Matrix")) detach("package:Matrix") > > if(doExtras && require("gmp")) { + ## version from ../vignettes/rationalRound.Rmd + ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if(print(packageVersion("gmp")) < "0.6-1") { + ## From 'gmp's namespace, usually "hidden", needed here : + is.whole.bigq <- gmp:::is.whole.bigq + biginteger_mod <- gmp:::biginteger_mod + .mod.bigz <- function(e1, e2) .Call(biginteger_mod, e1, e2) + + ##' rounding to integer a la "nearbyint()" -- i.e. "round to even" + round0 <- function(x) { + nU <- as.bigz.bigq(xU <- x + as.bigq(1, 2)) # traditional round: .5 rounded up + if(any(I <- is.whole.bigq(xU))) { # I <==> x == .5 : "hard case" + I[I] <- .mod.bigz(nU[I], 2L) == 1L # rounded up is odd ==> round *down* + nU[I] <- nU[I] - 1L + } + nU + } + + roundQ <- function(x, digits = 0, r0 = round0) { + ## round(x * 10^d) / 10^d + p10 <- as.bigz(10) ^ digits + r0(x * p10) / p10 + } + } + + roundAllX <- function(x, digits, versions = roundVersions) { + M <- cbind(roundAll(x, digits, versions=versions), + xctQ = asNumeric(roundQ(as.bigq(x), digits))) + rownames(M) <- format(x) + M + } + S3q <- roundAllX(x, digits = nd3) # --> warnings ... + if(length(w <- warnings())) print(summary(w)) + + ## err3q := "Error", assuming "xctQ" to be correct .. + dP <- nd3 >= 0 # as negative digits don't work for "sprintf" + err3q <- S3q[dP,] - S3q[dP, "xctQ"] + print( + rbind(exact = colSums( err3q != 0), + relevant= colSums(err3qT <- abs(err3q) > .01*10^-nd3[dP])) + ) + ## For F30 Linux 64-bit (gcc): + ## sprintf r0.C r1.C r1a.C r2.C r2a.C r3.C r3d.C r3 + ## ............... + + ## "r0*" and "r2*" are the same (here), and so are the two "r1*" : + stopifnot(same_cols(err3q[, vg1]), + same_cols(err3q[, vg2])) + + ## Visualization of error happening + cumEr3q <- apply(err3qT, 2L, cumsum) + matPm(cumEr3q[,colnames(S3q) != "xctQ"]) + mtext('Comparison with "exact rational" ("xctQ") :') + plot(hclust(dist(t(cumEr3q)/1e6, "manhattan"))) + + ## if(!any(sp == "package:gmp")) detach("package:gmp") + } > > > ## digits < 0, large |digits| ---- was wrong in R <= 3.6.x --- > > M <- .Machine$double.xmax > options(digits=4) > round(M , -(1:400)) # the horror for R <= 3.6.x: many 'Inf' (early on); ending in all NaN; [1] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [14] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [27] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [40] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [53] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [66] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [79] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [92] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [105] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [118] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [131] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [144] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [157] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [170] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [183] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [196] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [209] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [222] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [235] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [248] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [261] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [274] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [287] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 [300] 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.798e+308 1.797e+308 1.790e+308 1.700e+308 1.000e+308 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [313] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [326] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [339] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [352] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [365] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [378] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 [391] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 > ## for R >= 4.0.0, now ends in {1.797, 1.79, 1.7, 1}e308 0 0 0 ... 0 > round(M/2, -(0:320)) # much better for R <= 3.6; still ending in NaN [1] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [14] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [27] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [40] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [53] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [66] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [79] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [92] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [105] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [118] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [131] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [144] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [157] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [170] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [183] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [196] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [209] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [222] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [235] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [248] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [261] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [274] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [287] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.988e+307 [300] 8.988e+307 8.988e+307 8.988e+307 8.988e+307 8.989e+307 8.988e+307 8.990e+307 9.000e+307 9.000e+307 1.000e+308 0.000e+00 0.000e+00 0.000e+00 [313] 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 0.000e+00 > round(3141.5, -(0:320)) # ditto : "only" NaN [1] 3142 3140 3100 3000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [30] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [59] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [88] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [117] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [146] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [175] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [204] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [233] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [262] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [291] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [320] 0 0 > ## much of this is tested now in /tests/reg-tests-1d.R, ~line 3666 > > > proc.time() user system elapsed 4.54 0.34 4.87