Post Reply 
50g: an interesting RAND anomaly
03-19-2018, 02:57 PM
Post: #14
RE: 50g: an interesting RAND anomaly
(03-19-2018 02:23 PM)John Keith Wrote:  I'm rather fond of Xorshift+ because it is robust and well-tested, and is fast and simple to implement on processors that lack hardware multiply. I'm not sure that David wants to implement a new PRNG, though, just to randomize a list as efficiently as possible with the built-in one.

John's right. I'm perfectly happy using the built-in RAND seed, which also has the side-benefit of allowing the user to influence the outcome with a call to RDZ.

The current problem with doing that is determining the best way to convert that seed to a rather smaller integer in the range 1..<list size>. This would also be an issue with any other method that produces a large seed, which may have been one of the reasons Paul recommended a Tausworthe generator. As I've mentioned, doing this with integer operations is preferred for performance reasons.

For what it's worth, my earlier suggestion to "fold" the hex version of the RAND seed with an XOR of the two halves was inspired by looking at the XORSHIFT+ code. Much simpler than the full implementation, of course, but given that the seed had already gone through the RAND LCG, I was hoping a single XOR might be enough. While there is some anecdotal evidence that it may be comparable to the RAND standard (RAND * CEIL), I'm at a loss for a reasonable way to test it.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
50g: an interesting RAND anomaly - DavidM - 03-17-2018, 05:02 PM
RE: 50g: an interesting RAND anomaly - ttw - 03-18-2018, 02:03 AM
RE: 50g: an interesting RAND anomaly - DavidM - 03-19-2018 02:57 PM
RE: 50g: an interesting RAND anomaly - ttw - 03-19-2018, 06:31 PM
RE: 50g: an interesting RAND anomaly - ttw - 03-19-2018, 07:35 PM



User(s) browsing this thread: 1 Guest(s)