Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.independent

Topic: RNGs: A Super KISS
Replies: 14   Last Post: Feb 26, 2013 10:53 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Calumnist

Posts: 554
Registered: 12/11/04
Re: RNGs: A Super KISS
Posted: Nov 3, 2009 3:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Tue, 03 Nov 2009 07:46:27 -0800, George Marsaglia wrote: ...
> For those mesmerized (or Mersenne-ized?) by a RNG with period 2^19937-1,
> I offer one here with period 54767*2^1337279---over 10^396564 times as
> long. It is one of my CMWC (Complimentary-Multiply-With-Carry) RNGs, and
> is suggested here as one of the components of a super-long-period KISS
> (Keep-It-Simple-Stupid) RNG.

...
> static unsigned long Q[41790],indx=41790,carry=362436,xcng=1236789,xs=521288629;
...
> {unsigned long i,x;
...
> printf(" x=%d.\nDoes x=-872412446?\n",x);
...
> Running this program should produce 10^9 KISSes in some 7-15 seconds.
...
> So I again invite you to cut, paste, compile and run the above C
> program.
> 1000 million KISSes should be generated, and the specified result
> appear [...]


I've snipped the program except for three lines that apparently must
differ depending upon cpu word length. On my 64-bit Athlon X2 5200+
(1GHz) with gcc 4.1.2, and %d changed to %ld, the output (after 7.5
seconds) contains "x=2904265093743181565."; or, with instead long
changed to int in two places, "x=-872412446." (after 7.3 seconds).

--
jiw




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.