@@ -33,7 +33,7 @@ class Cwg128_64( BaseCWG ):
3333 """
3434 Pseudo-random numbers generator - Collatz-Weyl pseudorandom Generator
3535 dedicated to 128-bits calculations and 64-bits output values with small
36- period (min 2^71 , i.e. 2.36e+21 ) but short computation time. All CWG
36+ period (min 2^64 , i.e. 1.84e+19 ) but short computation time. All CWG
3737 algorithms offer multi streams features, by simply using different initial
3838 settings for control value 's' - see below.
3939
@@ -52,11 +52,11 @@ class Cwg128_64( BaseCWG ):
5252 PRNG. 's' must be initally odd. 'a', 'weyl' and initial state 'x' may be
5353 initialized each with any 64-bits value.
5454
55- See Cwg64 for a minimum 2^70 (i.e. about 1.18e+21 ) period CW-Generator
55+ See Cwg64 for a minimum 2^64 (i.e. about 1.84e+19 ) period CW-Generator
5656 with very low computation time, medium period, 64 bits output values and
5757 very good randomness characteristics.
5858
59- See Cwg128 for a minimum 2^135 (i.e. about 4.36e+40 ) period CW-generator
59+ See Cwg128 for a minimum 2^128 (i.e. about 6.81e+38 ) period CW-generator
6060 with very low computation time, medium period, 128 bits output values and
6161 very good randomness characteristics.
6262
@@ -72,9 +72,9 @@ class Cwg128_64( BaseCWG ):
7272
7373 | PyRandLib class | [8] generator name | Memory Usage | Period | time-32bits | time-64 bits | SmallCrush fails | Crush fails | BigCrush fails |
7474 | --------------- | ------------------ | ------------- | -------- | ----------- | ------------ | ---------------- | ----------- | -------------- |
75- | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^70 | n.a. | n.a. | 0 | 0 | 0 |
76- | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^71 | n.a. | n.a. | 0 | 0 | 0 |
77- | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^135 | n.a. | n.a. | 0 | 0 | 0 |
75+ | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
76+ | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
77+ | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^128 | n.a. | n.a. | 0 | 0 | 0 |
7878
7979 * _small crush_ is a small set of simple tests that quickly tests some of
8080 the expected characteristics for a pretty good PRNG;
@@ -120,7 +120,7 @@ def next(self) -> int:
120120 self ._weyl = (self ._weyl + self ._s ) & 0xffff_ffff_ffff_ffff
121121 self ._state = (((self ._state | 1 ) * (self ._a >> 1 )) ^ self ._weyl ) & 0xffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff
122122 # returns the xored-shifted output value
123- return ( self ._state ^ (self ._a >> 48 )) & 0xffff_ffff_ffff_ffff
123+ return self ._state ^ (self ._a >> 48 )
124124
125125
126126 #-------------------------------------------------------------------------
0 commit comments