I just tried the rsync version of R-1.1.0 on one of my alphas: It compiles without problems (gcc/g77 2.95.2, system is DU4.0E) but make check stops in base-Ex.R at> X <- cbind(1, 1:7) > str(s <- svd(X)); D <- diag(s$d)List of 3 $ d: num [1:2] 12.07 1.16 $ u: num [1:7, 1:2] -0.0976 -0.1788 -0.2601 -0.3413 -0.4225 ... $ v: num [1:2, 1:2] -0.198 -0.980 -0.980 0.198> stopifnot(abs(X - s$u %*% D %*% t(s$v)) < Eps)# X = U D V'Error: abs(X - s$"u" %*% D %*% t(s$"v")) < Eps is not TRUE Execution halted if I repeat all the svd tests manually I get:> > hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") } > str(X <- hilbert(9)[,1:6])num [1:9, 1:6] 1.000 0.500 0.333 0.250 0.200 ...> str(s <- svd(X))List of 3 $ d: num [1:6] 1.67e+00 2.77e-01 2.22e-02 1.08e-03 3.24e-05 ... $ u: num [1:9, 1:6] -0.724 -0.428 -0.312 -0.248 -0.206 ... $ v: num [1:6, 1:6] -0.736 -0.443 -0.327 -0.263 -0.220 ...> Eps <- 10 * .Machine$double.eps > D <- diag(s$d) > abs(X - s$u %*% D %*% t(s$v)) < Eps[,1] [,2] [,3] [,4] [,5] [,6] [1,] TRUE TRUE TRUE TRUE TRUE TRUE [2,] TRUE TRUE TRUE TRUE TRUE TRUE [3,] TRUE TRUE TRUE TRUE TRUE TRUE [4,] TRUE TRUE TRUE TRUE TRUE TRUE [5,] TRUE TRUE TRUE TRUE TRUE TRUE [6,] TRUE TRUE TRUE TRUE TRUE TRUE [7,] TRUE TRUE TRUE TRUE TRUE TRUE [8,] TRUE TRUE TRUE TRUE TRUE TRUE [9,] TRUE TRUE TRUE TRUE TRUE TRUE> abs(D - t(s$u) %*% X %*% s$v) < Eps[,1] [,2] [,3] [,4] [,5] [,6] [1,] TRUE TRUE TRUE TRUE TRUE TRUE [2,] TRUE TRUE TRUE TRUE TRUE TRUE [3,] TRUE TRUE TRUE TRUE TRUE TRUE [4,] TRUE TRUE TRUE TRUE TRUE TRUE [5,] TRUE TRUE TRUE TRUE TRUE TRUE [6,] TRUE TRUE TRUE TRUE TRUE TRUE> X <- cbind(1, 1:7) > str(s <- svd(X)); D <- diag(s$d)List of 3 $ d: num [1:2] 12.07 1.16 $ u: num [1:7, 1:2] -0.0976 -0.1788 -0.2601 -0.3413 -0.4225 ... $ v: num [1:2, 1:2] -0.198 -0.980 -0.980 0.198> abs(X - s$u %*% D %*% t(s$v)) < Eps[,1] [,2] [1,] TRUE TRUE [2,] TRUE TRUE [3,] TRUE TRUE [4,] TRUE TRUE [5,] TRUE TRUE [6,] TRUE FALSE [7,] TRUE TRUE> abs(D - t(s$u) %*% X %*% s$v) < Eps[,1] [,2] [1,] FALSE TRUE [2,] TRUE TRUE and the errors are:> abs(X - s$u %*% D %*% t(s$v)) - Eps[,1] [,2] [1,] -2.109424e-15 -2.220446e-16 [2,] -1.998401e-15 -8.881784e-16 [3,] -2.220446e-15 -1.776357e-15 [4,] -1.998401e-15 -1.332268e-15 [5,] -1.998401e-15 -1.332268e-15 [6,] -1.998401e-15 4.440892e-16 [7,] -1.332268e-15 -2.220446e-15> abs(D - t(s$u) %*% X %*% s$v) - Eps[,1] [,2] [1,] 3.108624e-15 -8.881784e-16 [2,] -1.165734e-15 -2.220446e-15 4.440892e-16 and 3.108624e-15 Eps was:> Eps[1] 2.220446e-15 This seems to be ok, I tried in Fortran EPSMCH=DLAMCH('E') WRITE(*,*)"eps:",EPSMCH and got eps: 2.22044605E-16 I compiled --whithout-dxml, so I'm not using any special numeric library. When I comment out the few lines for svd the tests from base-Ex.R complete successfully. All other tests succeed (other libraries and strict and sloppy specific tests) Albrecht ...................................................................... | Albrecht Gebhardt Tel.: (++43 463) 2700/832 | | Institut fuer Mathematik Fax : (++43 463) 2700/834 | | Universitaet Klagenfurt mailto:albrecht.gebhardt@uni-klu.ac.at | | Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard | | A-9020 Klagenfurt, Austria | `--------------------------------------------------------------------' -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Albrecht Gebhardt <albrecht.gebhardt@uni-klu.ac.at> writes:> > abs(X - s$u %*% D %*% t(s$v)) - Eps > [,1] [,2] > [1,] -2.109424e-15 -2.220446e-16 > [2,] -1.998401e-15 -8.881784e-16 > [3,] -2.220446e-15 -1.776357e-15 > [4,] -1.998401e-15 -1.332268e-15 > [5,] -1.998401e-15 -1.332268e-15 > [6,] -1.998401e-15 4.440892e-16 > [7,] -1.332268e-15 -2.220446e-15 > > abs(D - t(s$u) %*% X %*% s$v) - Eps > [,1] [,2] > [1,] 3.108624e-15 -8.881784e-16 > [2,] -1.165734e-15 -2.220446e-15 > > 4.440892e-16 and 3.108624e-15 > > Eps was: > > Eps > [1] 2.220446e-15...> eps: 2.22044605E-16So one of the calculations end up at about 5.3e-15 which is over 20 times the machine epsilon. OK, Hilbert matrices are nasty and AFAIR Alpha hardware doesn't have the extended precision of Intel FPUs but does this look reasonable enough that we should just use a bigger Eps? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 2 Jun 2000, Albrecht Gebhardt wrote:> On Fri, 2 Jun 2000, Albrecht Gebhardt wrote: > > > > > I just tried the rsync version of R-1.1.0 on one of my alphas: > > It compiles without problems (gcc/g77 2.95.2, system is DU4.0E) > > ......... > > > > I compiled --whithout-dxml, so I'm not using any special numeric library. > > > > Sorry I mixed something up in my report: In this compile I used the alpha > specific DXML library, in my rpms I omit it with --without-dxml (because > it sometimes crashes). I will try once more now without dxml, may be this > changes something, don't know if it gets used at all in the svd code. >That was the reason. Now without DXML I pass the test without modifying Eps:> X <- cbind(1, 1:7) > str(s <- svd(X)); D <- diag(s$d)List of 3 $ d: num [1:2] 12.07 1.16 $ u: num [1:7, 1:2] -0.0976 -0.1788 -0.2601 -0.3413 -0.4225 ... $ v: num [1:2, 1:2] -0.198 -0.980 -0.980 0.198> abs(X - s$u %*% D %*% t(s$v)) < Eps[,1] [,2] [1,] TRUE TRUE [2,] TRUE TRUE [3,] TRUE TRUE [4,] TRUE TRUE [5,] TRUE TRUE [6,] TRUE TRUE [7,] TRUE TRUE> abs(D - t(s$u) %*% X %*% s$v) < Eps[,1] [,2] [1,] TRUE TRUE [2,] TRUE TRUE So may be it is better do disable dxml support by default in ./configure? The following patch should do this: --- configure.in.orig Fri Jun 2 23:10:20 2000 +++ configure.in Fri Jun 2 23:10:02 2000 @@ -122,7 +122,7 @@ else use_dxml=true; fi], - use_dxml=true) + use_dxml=false) AC_ARG_WITH(atlas, [ --with-atlas use ATLAS library (if available)], Albrecht ...................................................................... | Albrecht Gebhardt Tel.: (++43 463) 2700/832 | | Institut fuer Mathematik Fax : (++43 463) 2700/834 | | Universitaet Klagenfurt mailto:albrecht.gebhardt@uni-klu.ac.at | | Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard | | A-9020 Klagenfurt, Austria | `--------------------------------------------------------------------' -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._