1. RNG Diehard results for Eu 'rand'
- Posted by Brian Broker <bkb at CNW.COM> Feb 14, 2000
- 572 views
I generated 3 sets of results from the numbers generated by the following code: ---------------------------------------- integer noshift, shifted, concat atom rn, rn2 -- random #'s not shifted -- noshift = open( "noshift.txt", "w" ) for i = 1 to 400000 do for j = 1 to 10 do -- random # from 1 to #3FFFFFFF rn = rand( #3FFFFFFF ) printf( noshift, "%08x", { rn } ) end for puts( noshift, "\n" ) end for close( noshift ) ---------------------------------------- -- random #'s shifted -- shifted = open( "shifted.txt", "w" ) for i = 1 to 400000 do for j = 1 to 10 do -- random # from 4 to #FFFFFFFC rn = rand( #3FFFFFFF ) * 4 printf( shifted, "%08x", { rn } ) end for puts( shifted, "\n" ) end for close( shifted ) ---------------------------------------- -- 2 16-bit random #'s concatenated -- concat = open( "concat.txt", "w" ) for i = 1 to 400000 do for j = 1 to 10 do -- 2 16-bit #s from #0000 to #FFFF rn = rand( #10000 ) - 1 rn2 = rand( #10000 ) - 1 printf( concat, "%04x%04x", { rn, rn2 } ) end for puts( concat, "\n" ) end for close( concat ) ---------------------------------------- I do not have time to analyze the results at the moment (I didn't even read all of the documentation...) but you can download them from http://cnw.com/~bkb/results.zip The testing on the unshifted results ended prematurely for whatever reason and the overall results look the ugliest for these numbers... -- Brian
2. Re: RNG Diehard results for Eu 'rand'
- Posted by Joel Crook <joel at MAIL.K-A.COM> Feb 14, 2000
- 612 views
Your code is MUCH better than mine --- then again I just started learning the language... seems my data file fails after the third test. Your results indicate the rand() function does indeed fail a number of the tests At 06:27 PM 02/14/2000 -0500, you wrote: >I generated 3 sets of results from the numbers generated by the following >code: > >---------------------------------------- >integer noshift, shifted, concat >atom rn, rn2 > > >-- random #'s not shifted -- >noshift = open( "noshift.txt", "w" ) > >for i = 1 to 400000 do > for j = 1 to 10 do > -- random # from 1 to #3FFFFFFF > rn = rand( #3FFFFFFF ) > printf( noshift, "%08x", { rn } ) > end for > puts( noshift, "\n" ) >end for > >close( noshift ) > >---------------------------------------- > >-- random #'s shifted -- >shifted = open( "shifted.txt", "w" ) > >for i = 1 to 400000 do > for j = 1 to 10 do > -- random # from 4 to #FFFFFFFC > rn = rand( #3FFFFFFF ) * 4 > printf( shifted, "%08x", { rn } ) > end for > puts( shifted, "\n" ) >end for > >close( shifted ) > >---------------------------------------- > >-- 2 16-bit random #'s concatenated -- >concat = open( "concat.txt", "w" ) > >for i = 1 to 400000 do > for j = 1 to 10 do > -- 2 16-bit #s from #0000 to #FFFF > rn = rand( #10000 ) - 1 > rn2 = rand( #10000 ) - 1 > printf( concat, "%04x%04x", { rn, rn2 } ) > end for > puts( concat, "\n" ) >end for > >close( concat ) >---------------------------------------- > >I do not have time to analyze the results at the moment (I didn't even read >all of the documentation...) but you can download them from >http://cnw.com/~bkb/results.zip > >The testing on the unshifted results ended prematurely for whatever reason >and the overall results look the ugliest for these numbers... > >-- Brian