On 27/04/13 13:33, Graydon Hoare wrote:
On 26/04/2013 6:47 PM, Huon Wilson wrote:

This change would double or triple throughput of random f64 generation
on 64-bit platforms compared to using the 32-bit algorithm (and
increase it 10-20x compared to calling the rng in the runtime, as is
done now). On this note, f64s are generated by `a/max_u32 +
b/max_u32^2 + c/max_u32^3`, where a, b, and c are random u32s, Many
other languages just generate a single u64 and multiply by `1/max_u64`
(e.g. http://hg.python.org/cpython/file/2.7/Lib/random.py#l809, this
even uses 7 bytes, not 8), would this be an acceptable change?

I'm not expert in this area and I'm not sure if any of us are; you might know better than anyone else here. I certainly don't object to adopting the ISAAC-64 algorithm if it's well understood by experts to be an improvement over the 32bit variant. If you'd be so kind as to survey the state of this sort of thing, document it and make changes to conform to what appears to be the best practice of other libraries (following our library-editing process[1] .. mostly just leave a paper trail for others), I would certainly appreciate it.


Page created: https://github.com/mozilla/rust/wiki/Lib-rand

From a very brief initial survey, there doesn't seem to be much literature about ISAAC-64 specifically, but is extremely similar to ISAAC itself. I shall continue my investigation.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to