Function rgsl::types::rng::algorithms::taus2

source ·
pub fn taus2() -> RngType
Expand description

This is a maximally equidistributed combined Tausworthe generator by L’Ecuyer. The sequence is,

x_n = (s1_n ^^ s2_n ^^ s3_n)

where,

s1_{n+1} = (((s1_n&4294967294)<<12)^^(((s1_n<<13)^^s1_n)>>19)) s2_{n+1} = (((s2_n&4294967288)<< 4)^^(((s2_n<< 2)^^s2_n)>>25)) s3_{n+1} = (((s3_n&4294967280)<<17)^^(((s3_n<< 3)^^s3_n)>>11))

computed modulo 2^32. In the formulas above ^^ denotes “exclusive-or”. Note that the algorithm relies on the properties of 32-bit unsigned integers and has been implemented using a bitmask of 0xFFFFFFFF to make it work on 64 bit machines.

The period of this generator is 2^88 (about 10^26). It uses 3 words of state per generator. For more information see,

P. L’Ecuyer, “Maximally Equidistributed Combined Tausworthe Generators”, Mathematics of Computation, 65, 213 (1996), 203–213.

The generator gsl_rng_taus2 uses the same algorithm as gsl_rng_taus but with an improved seeding procedure described in the paper,

P. L’Ecuyer, “Tables of Maximally Equidistributed Combined LFSR Generators”, Mathematics of Computation, 68, 225 (1999), 261–269

The generator gsl_rng_taus2 should now be used in preference to gsl_rng_taus.