Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
math/rand: documentation on rng.go is lacking important context and information #36133
Does this issue reproduce with the latest release?
What did you expect to see?
Details about the algorithm used, links to source material, context about why this algorithm was used and how it differs from other methods.
What did you see instead?
A single vague comment listing two names, without the title of sources used, the name of the algorithm used, or any details whatsoever. The names alone don't seem to be sufficient for finding the source material (at least based on a good amount of googling)
It seems like I'm not the only person having this issue:
Could provide some more context on what algorithm is being used, why it was chosen, and how it differs from something like mersenne twister? I think it would be valuable knowledge, and a good addition to that documentation.
For whoever might update the documentation: the default Source is a lagged Fibonacci generator with j=273, k=607.
To answer how it differs from Mersenne Twister, LFG is essentially a simple LFSR over elements in GF(2^64), which as #21835 mentions has a number of empirical and theoretical problems; MT is a linear recurrence over a polynomial in GF(2^19937) in its usual implementation with another linear transform applied to its outputs, giving it strong theoretical performance. (I can offer more details on the differences if desired later, but I have a final to take now.)
While I agree that