Re: [Rd] Numerical accuracy of matrix multiplication

2016-09-20 Thread Alexis Sarda
I just realized that I was actually using a different random number generator, could that be a valid reason for the discrepancy? The code should be: RNGkind("L'Ecuyer") set.seed(883) x <- rnorm(100) x %*% x - sum(x^2) # equal to 1.421085e-14 Regards, Alexis Sarda. On Tue, Sep 20, 2016 at

Re: [Rd] Numerical accuracy of matrix multiplication

2016-09-20 Thread Martin Maechler
> Alexis Sarda > on Tue, 20 Sep 2016 17:33:49 +0200 writes: > I just realized that I was actually using a different random number > generator, could that be a valid reason for the discrepancy? > The code should be: > RNGkind("L'Ecuyer") >

Re: [Rd] Numerical accuracy of matrix multiplication

2016-09-20 Thread Martin Maechler
> peter dalgaard > on Fri, 16 Sep 2016 13:33:11 +0200 writes: > On 16 Sep 2016, at 12:41 , Alexis Sarda wrote: >> Hello, >> >> while testing the crossprod() function under Linux, I noticed the following: >> >>

Re: [Rd] Numerical accuracy of matrix multiplication

2016-09-16 Thread peter dalgaard
On 16 Sep 2016, at 12:41 , Alexis Sarda wrote: > Hello, > > while testing the crossprod() function under Linux, I noticed the following: > > set.seed(883) > x <- rnorm(100) > x %*% x - sum(x^2) # equal to 1.421085e-14 > > Is this difference normal? It seems to be

[Rd] Numerical accuracy of matrix multiplication

2016-09-16 Thread Alexis Sarda
Hello, while testing the crossprod() function under Linux, I noticed the following: set.seed(883) x <- rnorm(100) x %*% x - sum(x^2) # equal to 1.421085e-14 Is this difference normal? It seems to be rather large for double precision. Regards, Alexis. [[alternative HTML version