package randii

  1. Overview
  2. Docs
A pure OCaml port of the Random123 counter based random number generator from DEShaw Research

Install

Dune Dependency

Authors

Maintainers

Sources

1.0.0.tar.gz
md5=1f8f3a98495497cece0131f11c0297e7
sha512=4377b604e5debe94ba98e980ffdbb92e936306460b7db65eee2d1d5493f0abc12f54982527d49351b8461e3208ac158aed79a932575872956e849a432d058e85

Description

Currently implements the Threefry 2&4 digit 32&64 bit random number generators

Published: 19 Mar 2023

README

randii

OCaml port of Random123 - a counter based random number generator.

This library is a pure OCaml port of the Random123 Threefry algorithms as described in Parallel Random Numbers: As Easy as 1, 2, 3, Salmon, Moraes, Dror & Shaw, SC11, Seattle, Washington, USA, 2011, ACM and originally implemented here.

In terms of number representations this library depends only on ocaml-integers with an additional dependency on zarith if one wants to run the test suite.

Testing

There is a simple CLI tool for basic testing, please see

$ randii --help

for more information.

The test suite uses Known Answer Tests from the test suite of the original implementation - specifically the Threefry data in kat_vectors and old_kat_vectors.

There is also an executable for running the Threefry implementations through the SmallCrush battery of tests via OCaml testu01:

$ dune exec -- u01/smallcrush.exe

WARNING it takes a while to run.

TODOs

  • basic arithmetic for ctr_t type,

  • make dependence on testu01 a with-test dep

Dependencies (7)

  1. testu01 >= "1.2.3-0.2"
  2. dune >= "3.0" & > "1.5"
  3. integers >= "0.4.0"
  4. fmt >= "0.9.0"
  5. cmdliner >= "1.1.1"
  6. logs >= "0.7.0"
  7. ocaml >= "4.08"

Dev Dependencies (4)

  1. odoc with-doc
  2. bisect_ppx with-test & >= "2.6.0"
  3. zarith with-test & >= "1.12"
  4. alcotest with-test

Used by

None

Conflicts

None