Code Monkey home page Code Monkey logo

haskell-random123's Introduction

Random123

This is a Haskell port of counter-based random number generators from Random123 library v1.07 (with a minor bugfix). The description of algorithms can be also found in Salmon et al., P. Int. C. High. Perform. 16 (2011).

Contributing

When making changes to the library, run (or update, if necessary) functionality tests. This can be done as

$ cabal configure --enable-tests
$ cabal build
$ cabal test

or just by executing cd test; ./test.sh. You can also check the performance by running benchmarks as

$ cabal configure --enable-benchmarks
$ cabal build
$ cabal bench

or by executing cd test; ./test_perf.sh. Benchmarks will create a report file test_perf.html in the folder where they were executed from.

TODO

  • Performance issues:

    • According to Salmon et al., Threefry-4x64 should be the fastest algorithm on CPUs. This is not what I'm seeing; need to investigate it further. If it is made faster, it should be used as the default bijection for CBRNG32/64 instead of philox4.
    • 32-bit Threefry shows suprisingly low performance (see Bijection benchmark group).
    • In general, there seems to be a lot of optimizations that can be done, in particular in terms of strategically placed strictness enforcement.
  • Current split implementation is a quick solution that kind of works (much like StdGen's one). A mathematically robust implementation is required (and CBRNGs by nature should be well-suited for this). Moreover, it would be great to have some tests that could distinguish "bad" split from a "good" one.

haskell-random123's People

Contributors

fjarri avatar keyholder avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.