native Erlang version of SFMT PRNG

Kenji Rikitake <>
Sun Jul 4 09:32:01 CEST 2010


A crude pure Erlang version of SFMT
(SIMD-oriented Fast Mersenne Twister) PRNG:
http://github.com/jj1bdx/sfmt-erlang

Note: this code is still ~300 times slower than the C code of SFMT
even when HiPE enabled on Erlang/OTP R14A at FreeBSD 7.3-RELEASE x86;
a NIF set will boost the speed.  I've already dissected the original
SFMT code for a thread-safe implementation at:
http://github.com/jj1bdx/sfmt-extstate

Kenji Rikitake
(well, if nobody does something for me, I have to do it anyway :))

In the message <>
dated Sun, May 30, 2010 at 04:52:56PM +0900,
Kenji Rikitake <> writes:
> Anybody has implemented a NIF or port version of Mersenne Twister or SFMT?
> http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html
> 
> (Mersenne Twister has been incorporated as the default RNG for Python
> and R, so far as I know.)


More information about the erlang-questions mailing list