Re: [Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread camel-cdr
‐‐‐ Original Message ‐‐‐ On Saturday, February 6, 2021 3:29 PM, Robert Kern wrote: > On Sat, Feb 6, 2021 at 7:27 AM wrote: > >>> Well, I can tell you why it needs to be backward compatible! I use random >>> numbers fairly frequently, and to unit test them I set a specific seed and >>>

Re: [Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread camel-cdr
> Well, I can tell you why it needs to be backward compatible! I use random > numbers fairly frequently, and to unit test them I set a specific seed and > then make sure I get the same answers. Hmm, I guess that makes sense. I tried to adjust my algorithms to do the same thing with the same bit

Re: [Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread Robert Kern
On Sat, Feb 6, 2021 at 7:27 AM wrote: > Well, I can tell you why it needs to be backward compatible! I use random > numbers fairly frequently, and to unit test them I set a specific seed and > then make sure I get the same answers. > > Hmm, I guess that makes sense. I tried to adjust my algorith

Re: [Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread Charles R Harris
On Sat, Feb 6, 2021 at 5:27 AM wrote: > Well, I can tell you why it needs to be backward compatible! I use random > numbers fairly frequently, and to unit test them I set a specific seed and > then make sure I get the same answers. > > Hmm, I guess that makes sense. I tried to adjust my algorith

[Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread camel-cdr
I tried to implement a different implementation of the ziggurat method for generating standard normal distributions that is about twice as fast and uses 2/3 of the memory than the old one. I tested the implementation separately and am very confident it's correct, but it does fail 28 test in cove

Re: [Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread Kevin Sheppard
Have you benchmarked it using the generator interface? The structure of this as a no monolithic generator makes it a good deal slower than generating in straight C (with everything inline). While I'm not sure a factor of 2 is enough to justify a change (for me 10x, 1.2x is not but I don't know whe

Re: [Numpy-discussion] Question about optimizing random_standard_normal

2021-02-06 Thread Tom Swirly
Well, I can tell you why it needs to be backward compatible! I use random numbers fairly frequently, and to unit test them I set a specific seed and then make sure I get the same answers. If your change went in (and I were using numpy normal distributions, which I am not) then my tests would brea