tinymt-erlang: Tiny Mersenne Twister (TinyMT) for Erlang
- Version: 0.2.0-pre
- Release date: 19-MAY-2014
- Edited and written by Kenji Rikitake
- Email contact: firstname.lastname@example.org
Travis CI build status for the master branch
Copyright (c) 2012-2014 Kenji Rikitake and Kyoto University. All rights reserved.
Copyright (c) 2011-2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima University, and the University of Tokyo. All rights reserved.
See the file
LICENSE for the license (new/simplified BSD license). (Note:
license of rebar is Apache 2.0 License.)
Details of TinyMT algorithm
This software is based on Tiny Mersenne Twister (TinyMT) Version 1.0.1 by Mutsuo Saito (Hiroshima University) and Makoto Matsumoto (The University of Tokyo). See http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/TINYMT/index.html. Also see https://github.com/jj1bdx/TinyMT/ for my fork of the reference code.
Changes from the old version
- Old NIF-supported version tagged as
- Old include file can be found in version tagged as
- NIF support removed
- Type specs updated for 17.0 (notably
- The internal state now have opaque type
- EDoc comment added: do
make docfor generating the documentation
- New functions for changing generation parameters
- Common Test suite added as
- Removed EUnit code
- HiPE options can be activatied in
Test bug: In versions released previously before 13-JAN-2014,
_n_). This bug would have been affected the evaluation result of the Erlang Workshop 2012 paper. The re-measured loop test execution time of
random:uniform_s/1is approx. 70 to 80 percent of that of
random:uniform_s/2. This bug was found with the dialyzer program of R16B03.
In versions released previously before 31-MAY-2012 (inclusive),
seed0/0had a wrong value in the
#status2member of the record which exceeded the limit of 2^32. This has been fixed by the corresponding 32-bit value.
On execution speed
The HiPE version is about two to three times faster than non-HiPE version, measured in overall execution time, on x86_64/amd64 architectures. (see
test-scripts/testspeed.escript) If you need a fast execution, compile with the HiPE option. (see
The non-HiPE version is about six times slower than
randommodule on x86_64/amd64, measured by
fprof. This is presumably due to increased computational complexity of the algorithm.
- FreeBSD/amd64 10-STABLE with Erlang/OTP 17.0
- OS X 10.9.2 with Erlang/OTP 17.0
- Travis CI Ubuntu 12.04 LTS with Erlang/OTP 17.0
Make options (of erlang.mk)
Makefileworks on both BSD/GNU make
Makefile.tinymtis the real GNU make file; edit this file for modification
- Execution speed benchmark:
- See also erlang.mk for the details
- More documentation and code
- More evaluation and refactoring
- Kenji Rikitake
- Mutsuo Saito
- Makoto Matsumoto
- Dave "dizzyd" Smith
- Tuncer Ayaz
- Ryosuke "Voluntas" Nakai
- Loïc Hoguin
Kenji Rikitake used the supercomputer service provided by Academic Center for Computing and Media Studies (ACCMS), Kyoto University, for testing this program and fundamental studies of TinyMT generation parameters.
Kenji Rikitake thanks the Program Committee of ACM Erlang Workshop 2012 to give him a chance to present this work as a Practice and Application paper.