##### Keywords
prng (2) random (8)
##### Permissions
Viewable by Everyone
Editable by All Siafoo Users
Meet people who work on similar things as you – get help if you need it

# Wichmann-Hill 1

 In Brief The Wichmann-Hill algorithm is a three seed pseudo-random number generator. The algorithm generates numbers between 0.0 and 1.0 with a cycle of . According to [Bevington] the algorithm is free of correlations and is a good generator for most purposes.... more
 Implementation Difficulty
` 1 function get_random(seed_1, seed_2, seed_3): 2  3     seed_1 = 171 * (seed_1 % 177) - 2*(seed_1 / 177) 4      5     if seed_1 < 0: seed_1 += 30269 6      7     seed_2 = 172 * (seed_2 % 176) - 35*(seed_2 / 176) 8      9     if seed_2 < 0: seed_2 += 3030710         11     seed_3 = 170 * (seed_3 % 178) - 63*(seed_3 / 178)12     13     if seed_2 < 0: seed_2 += 3032314     15     temp = seed_1 / 30269 + seed_2/30307 + seed_3/3032316 17     return temp - int(temp)`

The Wichmann-Hill algorithm is a three seed pseudo-random number generator. The algorithm generates numbers between 0.0 and 1.0 with a cycle of . According to [Bevington] the algorithm is free of correlations and is a good generator for most purposes.

 [Bevington] Philip Bevington, Data Reduction and Error Analysis for the Physical Sciences, McGraw-Hill Science/Engineering/Math
Implementations
A simple (unoptimized) implementation of the Wichmann-Hill pseudo-random number generator. The prng requires three seeds.