1 /*
2  * Copyright (c) 1996 Otmar Lendl (lendl@cosy.sbg.ac.at)
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted without a fee provided that the following
7  * conditions are met:
8  *
9  * 1. This software is only used for private, research, or academic
10  *    purposes.
11  *
12  * 2. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  *
15  * 3. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * 4. Any changes made to this package must be submitted to the author.
20  *    The legal status of the submitted changes must allow their inclusion
21  *    into this package under this license.
22  *
23  * 5. Publications in the field of pseudorandom number generation, which
24  *    made use of this package must include a reference to this package.
25  *
26  * Any use of this software in a commercial environment requires a
27  * written licence from the author. Contact Otmar Lendl
28  * (lendl@cosy.sbg.ac.at) to negotiate the terms.
29  *
30  * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
31  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
32  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
33  *
34  * IN NO EVENT SHALL OTMAR LENDL BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
35  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
36  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
37  * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
38  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
39  * OF THIS SOFTWARE.
40  *
41  */
42 /*
43  *
44  *  prng_def.h	Shortcuts for various generators.
45  *
46  *  Author:	Otmar Lendl (lendl@cosy.sbg.ac.at)
47  *
48  *  Last Modification: Thu Nov 14 19:10:04 MET 1996
49  *
50  */
51 
52 /* Modification History:
53 96/11/14: Added eicgs
54 96/10/14: Added full periode dicgs
55 96/08/02: Added a list of LCGs from Charly's paper
56 96/07/26: First Version.
57 */
58 
59 
60 static char prng_shortcuts[][70] = {
61 
62 /* simple inversives .. */
63 
64 	"eicg1",	"EICG(2147483647,1,0,0)",
65 	"eicg7",	"EICG(2147483647,7,0,0)",
66 	"icg",		"ICG(2147483647,1,1,0)",
67 
68 /* Common LCGs */
69 
70   /* classic ones .. */
71 
72 	"minstd",	"LCG(2147483647,16807,0,1)",
73 	"fish",		"LCG(2147483647,950706376,0,1)",
74 	"ansic",	"LCG(2147483648,1103515245,12345,12345)",
75 	"randu",	"LCG(2147483648,65539,0,1)",         /* VERY BAD ! */
76 	"simscript",	"LCG(2147483647,630360016,0,1)",
77 	"bcslib",	"LCG(34359738368,30517578125,7261067085,0)",
78 	"simula",	"LCG(34359738368,30517578125,0,1)",
79 	"bcpl",		"LCG(4294967296,2147001325,715136305,0)",
80 	"urn12",	"LCG(2147483648,452807053,0,1)",
81 	"apple",	"LCG(34359738368,1220703125,0,1)",
82 	"super-duper",	"LCG(4294967296,69069,0,1)",
83 	"hoaglin1",	"LCG(2147483647,1078318381,0,1)",
84 	"hoaglin2",	"LCG(2147483647,1203248318,0,1)",
85 	"hoaglin",	"LCG(2147483647,397204094,0,1)",
86 	"hoaglin3",	"LCG(2147483647,397204094,0,1)",
87 	"hoaglin4",	"LCG(2147483647,2027812808,0,1)",
88 	"hoaglin5",	"LCG(2147483647,1323257245,0,1)",
89 	"hoaglin6",	"LCG(2147483647,764261123,0,1)",
90 
91   /* newer ones */
92 
93 	"nag",		"LCG(576460752303423488,302875106592253,0,530242871347629333)",
94 	"drand48",	"LCG(281474976710656,25214903917,11,0)",
95 	"cray",		"LCG(281474976710656,44485709377909,0,1)",
96 	"maple",	"LCG(999999999989,427619669081,0,1)",
97 	"derive",	"LCG(4294967296,3141592653,1,0)",
98 	"crand",	"LCG(4294967296,663608941,0,1)",
99 
100 /* baby generators ... */
101 
102 	"b-meicg",		"MEICG(1163,11,7,1)",
103 	"b-lcg1",		"LCG(256,69,5,1)",
104 	"b-lcg2",		"LCG(256,53,1,1)",
105 	"b-eicg1",		"EICG(257,6,1,1)",
106 	"b-eicg2",		"EICG(257,30,1,1)",
107 
108 /* dicgs ... */
109 
110 	"dicg2",		"DICG(2,1,1,1)",
111 	"dicg3",		"DICG(3,2,1,1)",
112 	"dicg4",		"DICG(4,1,1,1)",
113 	"dicg5",		"DICG(5,5,1,1)",
114 	"dicg6",		"DICG(6,2,1,1)",
115 	"dicg9",		"DICG(9,5,1,1)",
116 	"dicg10",		"DICG(10,1,1,1)",
117 	"dicg11",		"DICG(11,2,1,1)",
118 	"dicg12",		"DICG(12,1,1,1)",
119 	"dicg18",		"DICG(18,1,1,1)",
120 	"dicg23",		"DICG(23,2,1,1)",
121 	"dicg30",		"DICG(30,17928205,6,0)",
122 	"dicg60",		"DICG(60,8831526502400,42,0)",
123 
124 /* for benchmarking: eicgs with p close to powers of 2 */
125 
126 	"eicg-k1",	"eicg(2,1,0,0)",
127 	"eicg-k2",	"eicg(3,1,0,0)",
128 	"eicg-k3",	"eicg(7,1,0,0)",
129 	"eicg-k4",	"eicg(13,1,0,0)",
130 	"eicg-k5",	"eicg(31,1,0,0)",
131 	"eicg-k6",	"eicg(61,1,0,0)",
132 	"eicg-k7",	"eicg(127,1,0,0)",
133 	"eicg-k8",	"eicg(251,1,0,0)",
134 	"eicg-k9",	"eicg(509,1,0,0)",
135 	"eicg-k10",	"eicg(1021,1,0,0)",
136 	"eicg-k11",	"eicg(2039,1,0,0)",
137 	"eicg-k12",	"eicg(4093,1,0,0)",
138 	"eicg-k13",	"eicg(8191,1,0,0)",
139 	"eicg-k14",	"eicg(16381,1,0,0)",
140 	"eicg-k15",	"eicg(32749,1,0,0)",
141 	"eicg-k16",	"eicg(65521,1,0,0)",
142 	"eicg-k17",	"eicg(131071,1,0,0)",
143 	"eicg-k18",	"eicg(262139,1,0,0)",
144 	"eicg-k19",	"eicg(524287,1,0,0)",
145 	"eicg-k20",	"eicg(1048573,1,0,0)",
146 	"eicg-k21",	"eicg(2097143,1,0,0)",
147 	"eicg-k22",	"eicg(4194301,1,0,0)",
148 	"eicg-k23",	"eicg(8388593,1,0,0)",
149 	"eicg-k24",	"eicg(16777213,1,0,0)",
150 	"eicg-k25",	"eicg(33554393,1,0,0)",
151 	"eicg-k26",	"eicg(67108859,1,0,0)",
152 	"eicg-k27",	"eicg(134217689,1,0,0)",
153 	"eicg-k28",	"eicg(268435399,1,0,0)",
154 	"eicg-k29",	"eicg(536870909,1,0,0)",
155 	"eicg-k30",	"eicg(1073741789,1,0,0)",
156 	"eicg-k31",	"eicg(2147483647,1,0,0)",
157 	"eicg-k32",	"eicg(4294967291,1,0,0)",
158 	"eicg-k33",	"eicg(8589934583,1,0,0)",
159 	"eicg-k34",	"eicg(17179869143,1,0,0)",
160 	"eicg-k35",	"eicg(34359738337,1,0,0)",
161 	"eicg-k36",	"eicg(68719476731,1,0,0)",
162 	"eicg-k37",	"eicg(137438953447,1,0,0)",
163 	"eicg-k38",	"eicg(274877906899,1,0,0)",
164 	"eicg-k39",	"eicg(549755813881,1,0,0)",
165 	"eicg-k40",	"eicg(1099511627689,1,0,0)",
166 	"eicg-k41",	"eicg(2199023255531,1,0,0)",
167 	"eicg-k42",	"eicg(4398046511093,1,0,0)",
168 	"eicg-k43",	"eicg(8796093022151,1,0,0)",
169 	"eicg-k44",	"eicg(17592186044399,1,0,0)",
170 	"eicg-k45",	"eicg(35184372088777,1,0,0)",
171 	"eicg-k46",	"eicg(70368744177643,1,0,0)",
172 	"eicg-k47",	"eicg(140737488355213,1,0,0)",
173 	"eicg-k48",	"eicg(281474976710597,1,0,0)",
174 	"eicg-k49",	"eicg(562949953421231,1,0,0)",
175 	"eicg-k50",	"eicg(1125899906842597,1,0,0)",
176 	"eicg-k51",	"eicg(2251799813685119,1,0,0)",
177 	"eicg-k52",	"eicg(4503599627370449,1,0,0)",
178 	"eicg-k53",	"eicg(9007199254740881,1,0,0)",
179 	"eicg-k54",	"eicg(18014398509481951,1,0,0)",
180 	"eicg-k55",	"eicg(36028797018963913,1,0,0)",
181 	"eicg-k56",	"eicg(72057594037927931,1,0,0)",
182 	"eicg-k57",	"eicg(144115188075855859,1,0,0)",
183 	"eicg-k58",	"eicg(288230376151711717,1,0,0)",
184 	"eicg-k59",	"eicg(576460752303423433,1,0,0)",
185 	"eicg-k60",	"eicg(1152921504606846883,1,0,0)",
186 	"eicg-k61",	"eicg(2305843009213693951,1,0,0)",
187 	"eicg-k62",	"eicg(4611686018427387847,1,0,0)",
188 	"eicg-k63",	"eicg(9223372036854775783,1,0,0)",
189 
190 /* for testing ... */
191 
192 	"eicg-t1",	"EICG(2147483647,291211,19461721,51831648)",
193 	"eicg-t2",	"EICG(2147483647,91731613,946721,181531791)",
194 
195 /* shortcuts for external ones */
196 
197 	"tt800",	"external(tt800)",
198 	"ctg",		"external(ctg,2,8,16)",
199 	"mrg",		"external(mrg,1,0,0,0,0)",
200 	"cmrg",		"external(cmrg,1,1,1,1,1,1)",
201 
202 	"",		"" };
203 
204