Skip to content

Commit 06bae44

Browse files
committed
#323-Fix in documentation erroneous periods for CWG generators
Done.
1 parent 38b7290 commit 06bae44

25 files changed

+143
-155
lines changed

README.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Notice: a comparison of the computation times for all implemented PRNGs in **Cpp
116116
<td>Cwg64</td>
117117
<td>*CWG64*</td>
118118
<td>8 x 4-bytes</td>
119-
<td>&gt;= 2^70</td>
119+
<td>&gt;= 2^64</td>
120120
<td>0</td>
121121
<td>0</td>
122122
<td>0</td>
@@ -127,7 +127,7 @@ Notice: a comparison of the computation times for all implemented PRNGs in **Cpp
127127
<td>Cwg128_64</td>
128128
<td>*CWG128-64*</td>
129129
<td>10 x 4-bytes</td>
130-
<td>&gt;= 2^71</td>
130+
<td>&gt;= 2^64</td>
131131
<td>0</td>
132132
<td>0</td>
133133
<td>0</td>
@@ -138,7 +138,7 @@ Notice: a comparison of the computation times for all implemented PRNGs in **Cpp
138138
<td>Cwg128</td>
139139
<td>*CWG128*</td>
140140
<td>16 x 4-bytes</td>
141-
<td>&gt;= 2^135</td>
141+
<td>&gt;= 2^128</td>
142142
<td>0</td>
143143
<td>0</td>
144144
<td>0</td>
@@ -835,9 +835,9 @@ Since version **2.0** of **CppRandLib** also, the newly implemented method `getr
835835

836836

837837
---
838-
### Cwg64 -- minimum 2^70 period
838+
### Cwg64 -- minimum 2^64 period
839839

840-
**Cwg64** implements the full 64 bits version of the Collatz-Weyl Generator algorithm: computations are done on 64-bits, the output generated value is coded on 64-bits also. It provides a medium period which is at minimum 2^70 (i.e. about 1.18e+21), short computation time and a four 64-bits integers internal state (x, a, weyl, s).
840+
**Cwg64** implements the full 64 bits version of the Collatz-Weyl Generator algorithm: computations are done on 64-bits, the output generated value is coded on 64-bits also. It provides a medium period which is at minimum 2^64 (i.e. about 1.84e+19), short computation time and a four 64-bits integers internal state (x, a, weyl, s).
841841

842842
This version of the CGW algorithm evaluates pseudo-random suites *output(i)* as the combination of the next instructions applied to *state(i-1)*:
843843

@@ -848,21 +848,9 @@ This version of the CGW algorithm evaluates pseudo-random suites *output(i)* as
848848

849849

850850

851-
### Cwg64 -- minimum 2^70 period
851+
### Cwg128_64 -- minimum 2^64 period
852852

853-
**Cwg64** implements the full 64 bits version of the Collatz-Weyl Generator algorithm: computations are done on 64-bits. The output generated value is coded on 64-bits also. It provides a medium period which is at minimum 2^70 (i.e. about 1.18e+21), short computation time and a four 64-bits integers internal state (x, a, weyl, s).
854-
855-
This version of the CGW algorithm evaluates pseudo-random suites *output(i)* as the combination of the next instructions applied to *state(i-1)*:
856-
857-
a(i) = a(i-1) + x(i-1)
858-
weyl(i) = weyl(i-1) + s // s is constant over time and must be odd, this is the value to modify to get multi-streams
859-
x(i) = ((x(i-1) >> 1) * ((a(i)) | 1)) ^ (weyl(i)))
860-
output(i) = (a(i) >> 48) ^ x(i)
861-
862-
863-
### Cwg128_64 -- minimum 2^71 period
864-
865-
**Cwg128_64** implements the mixed 128/64 bits version of the Collatz-Weyl Generator algorithm: computations are done on 128- and 64- bits. The output generated value is coded on 64-bits also. It provides a medium period which is at minimum 2^71 (i.e. about 2.36e+21), short computation time and a three 64-bits (a, weyl, s) plus one 128-bits integer internal state (x).
853+
**Cwg128_64** implements the mixed 128/64 bits version of the Collatz-Weyl Generator algorithm: computations are done on 128- and 64- bits. The output generated value is coded on 64-bits also. It provides a medium period which is at minimum 2^64 (i.e. about 1.84e+19), short computation time and a three 64-bits (a, weyl, s) plus one 128-bits integer internal state (x).
866854

867855
This version of the CGW algorithm evaluates pseudo-random suites *output(i)* as the combination of the next instructions applied to *state(i-1)*:
868856

@@ -873,9 +861,9 @@ This version of the CGW algorithm evaluates pseudo-random suites *output(i)* as
873861

874862

875863

876-
### Cwg128 -- minimum 2^135 period
864+
### Cwg128 -- minimum 2^128 period
877865

878-
**Cwg128** implements the full 128 bits version of the Collatz-Weyl Generator algorithm: computations are done on 128-bits. The output generated value is coded on 128-bits also. It provides a medium period which is at minimum 2^135 (i.e. about 4.36e+40), short computation time and a four 128-bits integers internal state (x, a, weyl, s).
866+
**Cwg128** implements the full 128 bits version of the Collatz-Weyl Generator algorithm: computations are done on 128-bits. The output generated value is coded on 128-bits also. It provides a medium period which is at minimum 2^128 (i.e. about 6.81e+38), short computation time and a four 128-bits integers internal state (x, a, weyl, s).
879867

880868
This version of the CGW algorithm evaluates pseudo-random suites *output(i)* as the combination of the next instructions applied to *state(i-1)*:
881869

c++11/baseclasses/basecwg.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ SOFTWARE.
7373
* implemented version. See implementation classes to get their formal
7474
* description.
7575
*
76-
* See Cwg64 for a minimum 2^70 (i.e. about 1.18e+21) period CW-Generator
76+
* See Cwg64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
7777
* with low computation time, medium period, 64- bits output values and very
7878
* good randomness characteristics.
7979
*
80-
* See Cwg128_64 for a minimum 2^71 (i.e. about 2.36e+21) period CW-Generator
80+
* See Cwg128_64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
8181
* with very low computation time, medium period, 64-bits output values and
8282
* very good randomness characteristics.
8383
*
84-
* See Cwg128 for a minimum 2^135 (i.e. about 4.36e+40) period CW-generator
84+
* See Cwg128 for a minimum 2^128 (i.e. about 6.81e+38) period CW-generator
8585
* with very low computation time, medium period, 128-bits output values and
8686
* very good randomness characteristics.
8787
*
@@ -107,9 +107,9 @@ SOFTWARE.
107107
* +------------------------------------------------------------------------------------------------------------------------------------------------+
108108
* | CppRandLib class | [8] generator name | Memory Usage | Period | time-32bits | time-64 bits | SmallCrush fails | Crush fails | BigCrush fails |
109109
* | ---------------- | ------------------ | ------------ | -------- | ----------- | ------------ | ---------------- | ----------- | -------------- |
110-
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^70 | n.a. | n.a. | 0 | 0 | 0 |
111-
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^71 | n.a. | n.a. | 0 | 0 | 0 |
112-
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^135 | n.a. | n.a. | 0 | 0 | 0 |
110+
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
111+
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
112+
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^128 | n.a. | n.a. | 0 | 0 | 0 |
113113
* +------------------------------------------------------------------------------------------------------------------------------------------------+
114114
*
115115
* * _small crush_ is a small set of simple tests that quickly tests some of

c++11/baseclasses/baserandom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ SOFTWARE.
5252
//===========================================================================
5353
/** @brief This is the base class for all pseudo-random numbers generators.
5454
*
55-
* See Cwg64 for a minimum 2^70 (i.e. about 1.18e+21) period Collatz-Weyl Generator
55+
* See Cwg64 for a minimum 2^64 (i.e. about 1.84e+19) period Collatz-Weyl Generator
5656
* with low computation time, medium period, 64- bits output values and very good
5757
* randomness characteristics.
58-
* See Cwg128_64 for a minimum 2^71 (i.e. about 2.36e+21) period C-W Generator with
58+
* See Cwg128_64 for a minimum 2^64 (i.e. about 1.84e+19) period C-W Generator with
5959
* with very low computation time, medium period, 64-bits output values and very
6060
* good randomness characteristics.
61-
* See Cwg128 for a minimum 2^135 (i.e. about 4.36e+40) period C-W generator with
61+
* See Cwg128 for a minimum 2^128 (i.e. about 6.81e+38) period C-W generator with
6262
* very low computation time, medium period, 64- bits output values and very good
6363
* randomness characteristics.
6464
*

c++11/cwg128.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ SOFTWARE.
4040

4141

4242
//===========================================================================
43-
/** @brief A 128-bits Collatz-Weyl pseudorandom Generator with a short period (4.36e+40).
43+
/** @brief A 128-bits Collatz-Weyl pseudorandom Generator with a short period (6.81e+38).
4444
*
4545
* Pseudo-random numbers generator - Collatz-Weyl pseudorandom Generators
4646
* dedicated to 128-bits calculations and 128-bits output values with large
47-
* period (min 2^135, i.e. 4.36e+40) but short computation time. All CWG
47+
* period (min 2^128, i.e. 6.81e+38) but short computation time. All CWG
4848
* algorithms offer multi streams features, by simply using different initial
4949
* settings for control value 's' - see below.
5050
*
@@ -59,11 +59,11 @@ SOFTWARE.
5959
* PRNG. 's' must be initally odd. 'a', 'weyl' and initial state 'x' may be
6060
* initialized each with any 64-bits value.
6161
*
62-
* See Cwg64 for a minimum 2^70 (i.e. about 1.18e+21) period CW-Generator
62+
* See Cwg64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
6363
* with very low computation time, medium period, 64- bits output values and
6464
* very good randomness characteristics.
6565
*
66-
* See Cwg128_64 for a minimum 2^71 (i.e. about 2.36e+21) period CW-Generator
66+
* See Cwg128_64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
6767
* with very low computation time, medium period, 64-bits output values and
6868
* very good randomness characteristics.
6969
*
@@ -89,9 +89,9 @@ SOFTWARE.
8989
* +------------------------------------------------------------------------------------------------------------------------------------------------+
9090
* | CppRandLib class | [8] generator name | Memory Usage | Period | time-32bits | time-64 bits | SmallCrush fails | Crush fails | BigCrush fails |
9191
* | ---------------- | ------------------ | ------------ | -------- | ----------- | ------------ | ---------------- | ----------- | -------------- |
92-
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^70 | n.a. | n.a. | 0 | 0 | 0 |
93-
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^71 | n.a. | n.a. | 0 | 0 | 0 |
94-
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^135 | n.a. | n.a. | 0 | 0 | 0 |
92+
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
93+
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
94+
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^128 | n.a. | n.a. | 0 | 0 | 0 |
9595
* +------------------------------------------------------------------------------------------------------------------------------------------------+
9696
*
9797
* * _small crush_ is a small set of simple tests that quickly tests some of

c++11/cwg64.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ SOFTWARE.
4040

4141

4242
//===========================================================================
43-
/** @brief A 64-bits Collatz-Weyl pseudorandom Generator with a long period (1.18e+21).
43+
/** @brief A 64-bits Collatz-Weyl pseudorandom Generator with a long period (1.84e+19).
4444
*
4545
* Pseudo-random numbers generator - Collatz-Weyl pseudorandom Generator
4646
* dedicated to 64-bits calculations and 64-bits output values with small
47-
* period (min 2^70, i.e. 1.18e+21) but short computation time. All CWG
47+
* period (min 2^64, i.e. 1.84e+19) but short computation time. All CWG
4848
* algorithms offer multi streams features, by simply using different initial
4949
* settings for control value 's' - see below.
5050
*
@@ -59,11 +59,11 @@ SOFTWARE.
5959
* PRNG. 's' must be initally odd. 'a', 'weyl' and initial state 'x' may be
6060
* initialized each with any 64-bits value.
6161
*
62-
* See Cwg128_64 for a minimum 2^71 (i.e. about 2.36e+21) period CW-Generator
62+
* See Cwg128_64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
6363
* with very low computation time, medium period, 64-bits output values and
6464
* very good randomness characteristics.
6565
*
66-
* See Cwg128 for a minimum 2^135 (i.e. about 4.36e+40) period CW-generator
66+
* See Cwg128 for a minimum 2^128 (i.e. about 6.81e+38) period CW-generator
6767
* with very low computation time, medium period, 128-bits output values and
6868
* very good randomness characteristics.
6969
*
@@ -89,9 +89,9 @@ SOFTWARE.
8989
* +------------------------------------------------------------------------------------------------------------------------------------------------+
9090
* | CppRandLib class | [8] generator name | Memory Usage | Period | time-32bits | time-64 bits | SmallCrush fails | Crush fails | BigCrush fails |
9191
* | ---------------- | ------------------ | ------------ | -------- | ----------- | ------------ | ---------------- | ----------- | -------------- |
92-
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^70 | n.a. | n.a. | 0 | 0 | 0 |
93-
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^71 | n.a. | n.a. | 0 | 0 | 0 |
94-
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^135 | n.a. | n.a. | 0 | 0 | 0 |
92+
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
93+
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
94+
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^128 | n.a. | n.a. | 0 | 0 | 0 |
9595
* +------------------------------------------------------------------------------------------------------------------------------------------------+
9696
*
9797
* * _small crush_ is a small set of simple tests that quickly tests some of

c++20/baseclasses/basecwg.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ SOFTWARE.
7474
* implemented version. See implementation classes to get their formal
7575
* description.
7676
*
77-
* See Cwg64 for a minimum 2^70 (i.e. about 1.18e+21) period CW-Generator
77+
* See Cwg64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
7878
* with low computation time, medium period, 64- bits output values and very
7979
* good randomness characteristics.
8080
*
81-
* See Cwg128_64 for a minimum 2^71 (i.e. about 2.36e+21) period CW-Generator
81+
* See Cwg128_64 for a minimum 2^64 (i.e. about 1.84e+19) period CW-Generator
8282
* with very low computation time, medium period, 64-bits output values and
8383
* very good randomness characteristics.
8484
*
85-
* See Cwg128 for a minimum 2^135 (i.e. about 4.36e+40) period CW-generator
85+
* See Cwg128 for a minimum 2^128 (i.e. about 6.81e+38) period CW-generator
8686
* with very low computation time, medium period, 128-bits output values and
8787
* very good randomness characteristics.
8888
*
@@ -108,9 +108,9 @@ SOFTWARE.
108108
* +------------------------------------------------------------------------------------------------------------------------------------------------+
109109
* | CppRandLib class | [8] generator name | Memory Usage | Period | time-32bits | time-64 bits | SmallCrush fails | Crush fails | BigCrush fails |
110110
* | ---------------- | ------------------ | ------------ | -------- | ----------- | ------------ | ---------------- | ----------- | -------------- |
111-
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^70 | n.a. | n.a. | 0 | 0 | 0 |
112-
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^71 | n.a. | n.a. | 0 | 0 | 0 |
113-
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^135 | n.a. | n.a. | 0 | 0 | 0 |
111+
* | Cwg64 | CWG64 | 8 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
112+
* | Cwg128_64 | CWG128_64 | 10 x 4-bytes | >= 2^64 | n.a. | n.a. | 0 | 0 | 0 |
113+
* | Cwg128 | CWG128 | 16 x 4-bytes | >= 2^128 | n.a. | n.a. | 0 | 0 | 0 |
114114
* +------------------------------------------------------------------------------------------------------------------------------------------------+
115115
*
116116
* * _small crush_ is a small set of simple tests that quickly tests some of

c++20/baseclasses/baserandom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ SOFTWARE.
5454
//===========================================================================
5555
/** @brief This is the base class for all pseudo-random numbers generators.
5656
*
57-
* See Cwg64 for a minimum 2^70 (i.e. about 1.18e+21) period Collatz-Weyl Generator
57+
* See Cwg64 for a minimum 2^64 (i.e. about 1.84e+19) period Collatz-Weyl Generator
5858
* with low computation time, medium period, 64- bits output values and very good
5959
* randomness characteristics.
60-
* See Cwg128_64 for a minimum 2^71 (i.e. about 2.36e+21) period C-W Generator with
60+
* See Cwg128_64 for a minimum 2^64 (i.e. about 1.84e+19) period C-W Generator with
6161
* with very low computation time, medium period, 64-bits output values and very
6262
* good randomness characteristics.
63-
* See Cwg128 for a minimum 2^135 (i.e. about 4.36e+40) period C-W generator with
63+
* See Cwg128 for a minimum 2^128 (i.e. about 6.81e+38) period C-W generator with
6464
* very low computation time, medium period, 64- bits output values and very good
6565
* randomness characteristics.
6666
*

0 commit comments

Comments
 (0)