home bbs files messages ]

Just a sample of the Echomail archive

COMPLANC:

<< oldest | < older | list | newer > | newest >> ]

 Message 242,539 of 243,097 
 Janis Papanagnou to Michael S 
 Re: srand(0) 
 23 Dec 25 10:54:23 
 
From: janis_papanagnou+ng@hotmail.com

On 2025-12-23 10:18, Michael S wrote:
>
> When I need PRNG then I am typically not deeply concerned about size of
> its internal state. On the other hand, I don't want to care about
> potentially insufficient randomness of the output (not in crypto
> sense). On the 3rd hand, vectors that I generate with PRNG tend to be
> big and I don't like to wait, so I do care somewhat about speed.
> Those 3 factors together plus availability long ago made MT19937-64
> into my personal default PRNG of  choice.

I've never intensified my knowledge in direction of MT algorithms.

>
> MT19937-64 is available out of the box(*) in C++. But not in C,
> unfortunately.

This is really strange given that the name ("Mersenne Twister") is
that prominent.

Looking that up I find at least "C" code for MT19937 in Wikipedia
https://de.wikipedia.org/wiki/Mersenne-Twister
It's based on 32 bit logic it seems; interpreting your "MT19937-64"
I assume you're looking for a 64 bit based version?

>
> At higher theoretical level MT is a generalization of LFSR, but it is
> not obvious when one looks at implementation.

Well, at least there's the 'mod' operations all based on powers of 2
along with all the binary op's which suggests some (non-arithmetic)
bit-register type of algorithm, but the multiplication with 0x9908b0df
(5 * 513496723) - which I'd suppose be hard to realize as/with LFSR -
may suggest some other generator type.

Janis

--- SoupGate-Win32 v1.05
 * Origin: you cannot sedate... all the things you hate (1:229/2)

<< oldest | < older | list | newer > | newest >> ]


(c) 1994,  bbs@darkrealms.ca