logoalt Hacker News

Xorshift Generators

88 pointsby tobrlast Saturday at 12:47 PM43 commentsview on HN

Comments

jabltoday at 6:57 AM

A number of years ago I implemented xoshiro256** for the GFortran compiler. Previously it used Marsaglia's KISS generator, which wasn't bad but perhaps no longer state of the art on the TESTU1 etc. tests. Additionally, xoshiro256** can be used in parallel by multiple threads; that took a bit of clever hacking to work around the limitations of the Fortran intrinsics API.

larsbrinkhofftoday at 4:59 AM

Xorshift-36 for the PDP-10, with help from Sebastiano Vigna.

https://github.com/larsbrinkhoff/xoroshiro-36

delducalast Saturday at 2:50 PM

I’ve replaced Lua’s random by this. I’ve posted about it here https://nullonerror.org/2025/08/02/replacing-lua-s-math-rand...

show 1 reply
saithoundlast Saturday at 3:45 PM

Ah yes, Xorshift, the RANDU [1] of the 21st century [2].

There is no real use case for better non-CS generators, as explained by adrian_b back in 2021 [3].

[1] https://en.wikipedia.org/wiki/RANDU [2] https://arxiv.org/abs/1908.10020 [3] https://news.ycombinator.com/item?id=28886698

show 2 replies
AlanZucconilast Saturday at 4:20 PM

I'm really curious... How did you manage to post this link before I did?

show 1 reply
smusamashahlast Saturday at 6:15 PM

> No multiplications. No divisions. No lookup tables. Just a few bitwise instructions.

Would have appreciated this article more if it was written by a human.

show 1 reply