Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-20 Thread Serguei Sokol
Le 19/08/2021 à 19:01, Sokol Serguei a écrit : Le 19/08/2021 à 17:41, Sokol Serguei a écrit : Le 19/08/2021 à 17:04, Naeem Khoshnevis a écrit : Thank you so much, everyone, for responding to this email. Dirk, * I didn't think about testing _equality_ of doubles because the numbers are

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Sokol Serguei
Le 19/08/2021 à 17:41, Sokol Serguei a écrit : Le 19/08/2021 à 17:04, Naeem Khoshnevis a écrit : Thank you so much, everyone, for responding to this email. Dirk, * I didn't think about testing _equality_ of doubles because the numbers are significantly different (e.g., instead of 0.5,

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Sokol Serguei
Le 19/08/2021 à 17:04, Naeem Khoshnevis a écrit : Thank you so much, everyone, for responding to this email. Dirk, * I didn't think about testing _equality_ of doubles because the numbers are significantly different (e.g., instead of 0.5, chooses 1.5). However, that is a valid point

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Dirk Eddelbuettel
On 19 August 2021 at 10:04, Naeem Khoshnevis wrote: | Thank you so much, everyone, for responding to this email. Thanks for circling back! This was a pretty impressive thread as you got three distinct answers that all added some value :) Dirk -- https://dirk.eddelbuettel.com | @eddelbuettel |

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Naeem Khoshnevis
Thank you so much, everyone, for responding to this email. Dirk, - I didn't think about testing _equality_ of doubles because the numbers are significantly different (e.g., instead of 0.5, chooses 1.5). However, that is a valid point, and I should be aware of that. - You are right ab

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Iñaki Ucar
On Thu, 19 Aug 2021 at 04:53, Dirk Eddelbuettel wrote: > > > Naeem, > > I would simplify, simplify, simplify -- as 'Rcpp FAQ 7.31' reminds us all, > testing _equality_ of doubles is challenging anyway. > > Besides, it may make sense to would ascertain first you get what you want in > _purely seria

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-19 Thread Sokol Serguei
HI, I cannot help with your bug. However... Le 19/08/2021 à 04:17, Naeem Khoshnevis a écrit : Dear all, I wrote a function using Rcpp; it is a simple function; however, it significantly improves the performance. Compared to what? The same algorithm with plenty for-loop re-written in R? T

Re: [Rcpp-devel] Rcpp function results are different on different systems

2021-08-18 Thread Dirk Eddelbuettel
Naeem, I would simplify, simplify, simplify -- as 'Rcpp FAQ 7.31' reminds us all, testing _equality_ of doubles is challenging anyway. Besides, it may make sense to would ascertain first you get what you want in _purely serial modes_ and then move to OpenMP. Dirk -- https://dirk.eddelbuettel.

[Rcpp-devel] Rcpp function results are different on different systems

2021-08-18 Thread Naeem Khoshnevis
Dear all, I wrote a function using Rcpp; it is a simple function; however, it significantly improves the performance. I realized that on some systems, the result of the function is different from others. For example, on the following systems (on rhub), the results are identical and are correct: