Jeff Lewis
2003-Jun-24 16:26 UTC
[R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1
I'm attempting to compile and install R version 1.7.1 for my statistical geneticists. It seems to compile correctly -- that is, it compiles without errors -- but the regression test is failing in the following manner: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> ## log> stopifnot(all.equal(log(1:10), log(1:10, exp(1)))) > stopifnot(all.equal(log10(30), log(30, 10))) > stopifnot(all.equal(log2(2^pi), 2^log2(pi))) > stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps)Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < .Machine$double.eps is not TRUE Execution halted =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran compilers and perl 5.6.0. I found the above error in a file named 'reg-tests-1.Rout.fail'. Any help you can give me would be most appreciated. Thanks, Jeff
Peter Dalgaard BSA
2003-Jun-24 17:19 UTC
[R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1
"Jeff Lewis" <jlewis at genomecorp.com> writes:> I'm attempting to compile and install R version 1.7.1 for my statistical > geneticists. It seems to compile correctly -- that is, it compiles > without errors -- but the regression test is failing in the following > manner: > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> > ## log > > stopifnot(all.equal(log(1:10), log(1:10, exp(1)))) > > stopifnot(all.equal(log10(30), log(30, 10))) > > stopifnot(all.equal(log2(2^pi), 2^log2(pi))) > > stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps) > Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < .Machine$double.eps is > not TRUE > Execution halted > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> > I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran compilers and > perl 5.6.0. I found the above error in a file named > 'reg-tests-1.Rout.fail'. Any help you can give me would be most > appreciated.Well, it seems to be an accuracy issue, so the first question would be what the values on both sides of the equality are (just start up R and enter the expressions on te command line). You might have 1) Completely wrong results in complex arithmetic 2) Slightly less than optimal accuracy 3) An underestimated .Machine$double.eps Case 2) seems most likely, but case 3) has been observed with buggy compilers that optimize calculations where they shouldn't. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Jeff Lewis
2003-Jun-24 18:42 UTC
[R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1
> -----Original Message----- > From: Peter Dalgaard BSA [mailto:p.dalgaard at biostat.ku.dk] > Sent: Tuesday, June 24, 2003 1:20 PM > To: Jeff Lewis > Cc: r-help at stat.math.ethz.ch > Subject: Re: [R] R-1.7.1 regression test failure on > alphaev68-dec-osf5.1 > > > "Jeff Lewis" <jlewis at genomecorp.com> writes: > > > I'm attempting to compile and install R version 1.7.1 for > my statistical > > geneticists. It seems to compile correctly -- that is, it compiles > > without errors -- but the regression test is failing in the > following > > manner: > > > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> > > ## log > > > stopifnot(all.equal(log(1:10), log(1:10, exp(1)))) > > > stopifnot(all.equal(log10(30), log(30, 10))) > > > stopifnot(all.equal(log2(2^pi), 2^log2(pi))) > > > stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps) > > Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < > .Machine$double.eps is > > not TRUE > > Execution halted > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> > > > I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran > compilers and > > perl 5.6.0. I found the above error in a file named > > 'reg-tests-1.Rout.fail'. Any help you can give me would be most > > appreciated. > > Well, it seems to be an accuracy issue, so the first question would be > what the values on both sides of the equality are (just start up R and > enter the expressions on te command line). You might have > > 1) Completely wrong results in complex arithmetic > 2) Slightly less than optimal accuracy > 3) An underestimated .Machine$double.eps > > Case 2) seems most likely, but case 3) has been observed with buggy > compilers that optimize calculations where they shouldn't.Thanks for the quick response. The two sides of the equality are definately different. Here's what I'm seeing =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> pi [1] 3.141593> 1i[1] 0+1i> pi*1i[1] 0+3.141593i> exp(pi*1i)[1] -1+1.224647e-16i> log(exp(pi*1i))[1] 0+3.141593i> log(exp(pi*1i)) / 1i[1] 3.141593+0i> pi - log(exp(pi*1i)) / 1i[1] 4.440892e-16+0i> Mod(pi - log(exp(pi*1i)) / 1i)[1] 4.440892e-16> .Machine$double.eps[1] 2.220446e-16> Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps[1] FALSE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I get the same thing from R 1.6.2, which I compiled about six months ago. Is there anything I can/should do to fix this?
Jeff Lewis
2003-Jun-25 15:15 UTC
[R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1
> > Thanks for the quick response. The two sides of the equality are > > definately different. Here's what I'm seeing > > > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> > > pi > > [1] 3.141593 > > > > > 1i > > [1] 0+1i > > > > > pi*1i > > [1] 0+3.141593i > > > > > exp(pi*1i) > > [1] -1+1.224647e-16i > > > > > log(exp(pi*1i)) > > [1] 0+3.141593i > > > > > log(exp(pi*1i)) / 1i > > > > [1] 3.141593+0i > > > > > pi - log(exp(pi*1i)) / 1i > > [1] 4.440892e-16+0i > > > > > Mod(pi - log(exp(pi*1i)) / 1i) > > [1] 4.440892e-16 > > > > > .Machine$double.eps > > [1] 2.220446e-16 > > > > > Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps > > [1] FALSE > > > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> > > > I get the same thing from R 1.6.2, which I compiled about six months > > ago. Is there anything I can/should do to fix this? > > Not really. It seems that your platform just has slightly less > accurate complex log/exp routines than the most common ones (Linux and > Sparc/Solaris both give exact zero). Probably the check is simply > overly stringent. > > You might want to change the check to say ... < 3*.Machine$double.eps > or so and rerun, to check whether the rest of the checks pass.I removed this test from the file 'reg-tests-1.R' and reran the checks. All other checks passed with flying colors. Thanks for the help.