Warning: this generator should not be used for cryptographic work.
NO WARRANTY
Slightly adapted Squeak code for fileIn into ST/X.
The original comment was:
A pseudo-random number generator; see below for references.
This generator is much slower than Squeak's Random class.
It automatically seeds itself based on the millisecond clock.
Using the generator:
randy := RandomTT800 new.
randy seed: anInteger. 'optional; never use zero'
aRandom := randy next.
Example (InspectIt):
| r |
r := RandomTT800 new.
(1 to: 50) collect: [ :n | r next ].
===================================================================
Originally a C-program for TT800 : July 8th 1996 Version
by M. Matsumoto, email: matumoto@math.keio.ac.jp
Generates one pseudorandom number with double precision which is uniformly distributed
on [0,1]-interval for each call. One may choose any initial 25 seeds except all zeros.
See: ACM Transactions on Modelling and Computer Simulation,
Vol. 4, No. 3, 1994, pages 254-266.
ABSTRACT
The twisted GFSR generators proposed in a previous article have a defect in k-distribution for k larger
than the order of recurrence.
In this follow up article, we introduce and analyze a new TGFSR variant having better k-distribution property.
We provide an efficient algorithm to obtain the order of equidistribution, together with a tight upper bound
on the order.
We discuss a method to search for generators attaining this bound, and we list some of these such generators.
The upper bound turns out to be (sometimes far) less than the maximum order of equidistribution for a generator
of that period length, but far more than that for a GFSR with a working are of the same size.
Previous paper:
ACM Transactions on Modeling and Computer Simulation
Volume 2 , Issue 3 (1992) Pages 179-194
Twisted GFSR generators
Makoto Matsumoto, and Yoshiharu Kurita
ABSTRACT
The generalized feed back shift register (GFSR) algorithm suggested by Lewis and Payne is a widely used pseudorandom number generator, but has the following serious drawbacks: (1) an initialization scheme to assure higher order equidistribution is involved and is time consuming; (2) each bit of the
generated words constitutes an m-sequence based on a primitive trinomials, which shows poor randomness with respect to weight distribution; (3) a large working area is necessary; (4) the period of sequence is far shorter than the theoretical upper bound. This paper presents the twisted GFSR (TGFSR) algorithm, a slightly but essentially modified version of the GFSR, which solves all the above problems without loss of merit. Some practical TGFSR generators were implemented and passed strict empirical tests. These new generators are most suitable for simulation of a large distributive system, which requires a number of mutually independent pseudorandom number generators with compact size.