Wichmann–Hill is a pseudorandom number generator proposed in 1982 by Brian Wichmann and David Hill. In its core, numbers are generated by taking the fractional part of a sum of rectangularly distributed numbers from imperfect algorithms. As the addition of fractional parts of numbers will be rectangularly distributed even if only one of the numbers is rectangularly distributed, the method is an appropriate generator. In its crude form, three number generators are used to create a pseudorandom sequence with cycle exceeding
Implementation
The following pseudocode is for implementation on machines capable of integer arithmetic up to 30,323:
On machines capable of integer arithmetic up to 5,212,632, the more compact version gives identical results: