From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 109d8a,ea40acba15d5d078 X-Google-NewGroupId: yes X-Google-Thread: 1014db,ea40acba15d5d078 X-Google-NewGroupId: yes X-Google-Thread: 1094ba,ea40acba15d5d078 X-Google-NewGroupId: yes X-Google-Thread: 101deb,620e03552eca5f22 X-Google-NewGroupId: yes X-Google-Thread: 103376,c5d0be666830517 X-Google-NewGroupId: yes X-Google-Attributes: gid9ef9b79ae9,gid4516fb5702,gid8d3408f8c3,gidbda4de328f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Uno Newsgroups: sci.math,comp.lang.c,comp.lang.fortran,comp.lang.pl1,comp.lang.ada Subject: Re: KISS4691, a potentially top-ranked RNG. Date: Fri, 30 Jul 2010 04:46:32 -0600 Message-ID: <8bfos5FakcU1@mid.individual.net> References: <4c4ecbee$0$12393$c30e37c6@exi-reader.telstra.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net nD7rPX0j0dAE1+CTlMVnuQ+jN/4YRxFM8cBju9/6SZdKuqIoLP Cancel-Lock: sha1:+X7LfQqnSjz0BaxxfPxgylC7Bno= User-Agent: Thunderbird 2.0.0.24 (X11/20100317) In-Reply-To: <4c4ecbee$0$12393$c30e37c6@exi-reader.telstra.net> Xref: g2news1.google.com sci.math:175428 comp.lang.c:98971 comp.lang.fortran:26101 comp.lang.pl1:1582 comp.lang.ada:12709 Date: 2010-07-30T04:46:32-06:00 List-Id: robin wrote: > "geo" wrote in message news:a82cebe3-cdb9-48af-8080-bca935eeb9b1@l14g2000yql.googlegroups.com... > |I have been asked to recommend an RNG > | (Random Number Generator) that ranks > | at or near the top in all of the categories: > | performance on tests of randomness, > | length of period, simplicity and speed. > | The most important measure, of course, is > | performance on extensive tests of randomness, and for > | those that perform well, selection may well depend > | on those other measures. > > I have already posted a PL/I version using unsigned arithmetic. > > Here is another version, this time using signed arithmetic :-- > > (NOSIZE, NOFOFL): > RNG: PROCEDURE OPTIONS (MAIN, REORDER); > > declare (xs initial (521288629), xcng initial (362436069), > Q(0:4690) ) static fixed binary (31); > > MWC: procedure () returns (fixed binary (31)); > declare (t,x,i) fixed binary (31); > declare (c initial (0), j initial (4691) ) fixed binary (31) static; > declare (t1, t2, t3) fixed binary (31); > > if j < hbound(Q,1) then j = j + 1; else j = 0; > x = Q(j); > t = isll(x,13)+c+x; > t1 = iand(x, 3) - iand(t, 3); > t2 = isrl(x, 2) - isrl(t, 2); > if t2 = 0 then t2 = t1; > if t2 > 0 then t3 = 1; else t3 = 0; > c = t3 + isrl(x, 19); > Q(j)=t; > return (t); > end MWC; > > CNG: procedure returns (fixed binary (31)); > xcng=bin(69069)*xcng+bin(123); > return (xcng); > end CNG; > > XXS: procedure returns (fixed binary (31)); > xs = ieor (xs, isll(xs, 13) ); > xs = ieor (xs, isrl(xs, 17) ); > xs = ieor (xs, isll(xs, 5) ); > return (xs); > end XXS; > > KISS: procedure returns (fixed binary (31)); > return ( MWC()+CNG+XXS ); > end KISS; > > declare (i,x) fixed binary (31); > declare y fixed decimal (11); > > Q = CNG+XXS; /* Initialize. */ > do i = 1 to 1000000000; x=MWC(); end; > put skip edit (" Expected MWC result = 3740121002", 'computed =', x) > (a, skip, x(12), a, f(11)); > y = iand(x, 2147483647); > if x < 0 then y = y + 2147483648; > put skip edit (y) (x(11), f(22)); put skip; > do i = 1 to 1000000000; x=KISS; end; > put skip edit ("Expected KISS result = 2224631993", 'computed =', x) > (a, skip, x(12), a, f(11)); > y = iand(x, 2147483647); > if x < 0 then y = y + 2147483648; > put skip edit (y) (x(11), f(22)); > > end RNG; > > If you were to comment out the PL/I command line that compiled this, what would it be? -- Uno