From: robin on 3 Aug 2010 06:41 "Uno" <merrilljensen(a)q.com> wrote in message news:8bfos5FakcU1(a)mid.individual.net... | robin wrote: | > 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? ???
From: James Waldby on 3 Aug 2010 13:15 On Tue, 03 Aug 2010 20:41:15 +1000, robin wrote: > "Uno" <merrilljensen> wrote: [snip code] >> If you were to comment out the PL/I command line that compiled this, >> what would it be? > > ??? Does that mean you don't understand Uno's question, or don't know the answer? In case you don't understand the question, it appears to be: "What command is used to compile the code?" -- jiw
From: Dann Corbit on 3 Aug 2010 13:35 In article <i39iqp$sg7$1(a)news.eternal-september.org>, no(a)no.no says... > > On Tue, 03 Aug 2010 20:41:15 +1000, robin wrote: > > "Uno" <merrilljensen> wrote: > [snip code] > >> If you were to comment out the PL/I command line that compiled this, > >> what would it be? > > > > ??? > > Does that mean you don't understand Uno's question, > or don't know the answer? > > In case you don't understand the question, it appears > to be: "What command is used to compile the code?" It will depend on the operating system. Probably JCL along the lines of: // EXEC PL1LFCLG,REGION.PL1L=256K
From: Peter Flass on 3 Aug 2010 16:34 Dann Corbit wrote: > In article <i39iqp$sg7$1(a)news.eternal-september.org>, no(a)no.no says... >> On Tue, 03 Aug 2010 20:41:15 +1000, robin wrote: >>> "Uno" <merrilljensen> wrote: >> [snip code] >>>> If you were to comment out the PL/I command line that compiled this, >>>> what would it be? >>> ??? >> Does that mean you don't understand Uno's question, >> or don't know the answer? >> >> In case you don't understand the question, it appears >> to be: "What command is used to compile the code?" > > It will depend on the operating system. > Probably JCL along the lines of: > // EXEC PL1LFCLG,REGION.PL1L=256K or "plic -C" <filename>
From: sturlamolden on 3 Aug 2010 22:59
On 3 Aug, 06:37, Dann Corbit <dcor...(a)connx.com> wrote: > Mersenne Twister 19937 speed, single (Hz): 1.63278e+008 > Mersenne Twister 19937 speed, array (Hz): 1.3697e+008 > KISS 4691 speed, single (Hz): 1.86338e+008 > KISS 4691 speed, array (Hz): 1.87675e+008 Those numbers are in 100 million samples per second (10^8), so you have the same order of magnitude I reported. The array version of KISS is inlined (by macro expansion). These numbers are likely dependent on compiler and hardware. In you case, KISS4691 is always faster than MT19937. That is what I expected to see on my laptop as well, but did not. The speed difference is not very substantial, though, less than a factor of 2. I am more concerned about numerical quality. Which one should we use based on that? Sturla |