https://github.com/rtmigo/randomref
Creates JSON with output values from different random number generators
https://github.com/rtmigo/randomref
prng prng-algorithms random random-number-generators
Last synced: over 1 year ago
JSON representation
Creates JSON with output values from different random number generators
- Host: GitHub
- URL: https://github.com/rtmigo/randomref
- Owner: rtmigo
- License: upl-1.0
- Created: 2021-03-25T14:40:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-14T22:32:24.000Z (almost 5 years ago)
- Last Synced: 2025-01-21T15:32:19.801Z (over 1 year ago)
- Topics: prng, prng-algorithms, random, random-number-generators
- Language: Dart
- Homepage:
- Size: 1.25 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Creates JSON with output values from different random number generators (PRNG).
The generated values can be used to test the same PRNG algorithms rewritten
in other languages. This is how the [xrandom](https://github.com/rtmigo/xrandom) library is tested.
The reference PRNG algorithm implementations are usually in C99. C++ behaves
the same way when handling numbers. So we use C++ to generate the reference
values.
## Algorithms
Random 32-bit integer:
- xorshift32
- xorshift128
- xoshiro128++
- mulberry32
Random 64-bit integer:
- xorshift64
- xorshift128+
- xoshiro256++
- xoshiro256**
- splitmix64
Bounded integer:
- [divisionless](https://arxiv.org/abs/1805.10941)
Int-to-double:
- [multiplication](https://prng.di.unimi.it/)
- [bitcast](https://prng.di.unimi.it/)
- [randbl32](http://doi.acm.org/10.1145/1189756.118975)
## Compiling and running
On POSIX system with GCC:
``` shell
$ g++ main.cpp --std=c++2a -o randomref.com
$ ./randomref.com
```