All Projects → libmir → Mir Random

libmir / Mir Random

Advanced Random Number Generators

Programming Languages

d
599 projects

Projects that are alternatives of or similar to Mir Random

Rando.js
The world's easiest, most powerful random function.
Stars: ✭ 659 (+2096.67%)
Mutual labels:  random-generation, random
Randomkit
Random data generation in Swift
Stars: ✭ 1,458 (+4760%)
Mutual labels:  random-generation, random
Random compat
PHP 5.x support for random_bytes() and random_int()
Stars: ✭ 7,950 (+26400%)
Mutual labels:  random-generation, random
Generatedata
A powerful, feature-rich, random test data generator.
Stars: ✭ 1,883 (+6176.67%)
Mutual labels:  random-generation, random
datagen
Java lib that generates random data (numbers, strings, dates) - mostly to facilitate Randomized Testing.
Stars: ✭ 56 (+86.67%)
Mutual labels:  random, random-generation
relude-random
Composable random generators based on the PCG paper
Stars: ✭ 15 (-50%)
Mutual labels:  random, random-generation
Easy Random
The simple, stupid random Java beans/records generator
Stars: ✭ 1,095 (+3550%)
Mutual labels:  random-generation, random
RandomGenKt
Kotlin port of RandomGen
Stars: ✭ 28 (-6.67%)
Mutual labels:  random, random-generation
jRand
A Java library to generate random data for all sorts of things. Java random data faker
Stars: ✭ 27 (-10%)
Mutual labels:  random, random-generation
strgen
A Python module for a template language that generates randomized data
Stars: ✭ 34 (+13.33%)
Mutual labels:  random, random-generation
Markovnamegenerator
✒️ Markov process-based procedural name and word generator
Stars: ✭ 300 (+900%)
Mutual labels:  random-generation, random
Librmath.js
Javascript Pure Implementation of Statistical R "core" numerical libRmath.so
Stars: ✭ 425 (+1316.67%)
Mutual labels:  random
Dharma
Generation-based, context-free grammar fuzzer.
Stars: ✭ 416 (+1286.67%)
Mutual labels:  random
Qml Snippet
some qml snippet.
Stars: ✭ 9 (-70%)
Mutual labels:  random
Mockneat
MockNeat is a Java 8+ library that facilitates the generation of arbitrary data for your applications.
Stars: ✭ 410 (+1266.67%)
Mutual labels:  random-generation
Kolpa
A fake data generator written in and for Go
Stars: ✭ 645 (+2050%)
Mutual labels:  random-generation
Handyswift
Handy Swift features that didn't make it into the Swift standard library.
Stars: ✭ 403 (+1243.33%)
Mutual labels:  random
Portable Snippets
Collection of miscellaneous portable C snippets.
Stars: ✭ 397 (+1223.33%)
Mutual labels:  random
Gommon
Common packages for Go
Stars: ✭ 389 (+1196.67%)
Mutual labels:  random
Session Token
Secure, efficient, simple random session token generation
Stars: ✭ 12 (-60%)
Mutual labels:  random

Dub version Dub downloads License

Circle CI Build Status Build status Gitter

mir-random

Advanced Random Number Generators

Documentation - http://mir-random.libmir.org/

This library is for general-purpose random number generation. Do not use it for cryptography or secret generation.

Example (3 seconds)

void main()
{
    import mir.random;
    import mir.random.variable: normalVar;
    import mir.random.algorithm: randomSlice;

    auto sample = normalVar.randomSlice(10);

    import std.stdio;
    sample[$.randIndex].writeln;
}

Example (10 seconds)

void main()
{
    import mir.random;
    import mir.random.variable: normalVar;
    import mir.random.algorithm: randomSlice;

    // Engines are allocated on stack or global
    auto rng = Random(unpredictableSeed);
    auto sample = rng.randomSlice(normalVar, 10);

    import std.stdio;
    sample[rng.randIndex($)].writeln;
}

Comparison with Phobos

  • Does not depend on DRuntime (Better C concept)
random (new implementation and API)
  • Mir Random rand!float/rand!double/rand!real generates saturated real random numbers in (-1, 1). For example, rand!real can produce more than 2^78 unique numbers. In other hand, std.random.uniform01!real produces less than 2^31 unique numbers with default Engine.
  • Mir Random fixes Phobos integer underflow bugs.
  • Additional optimization was added for enumerated types.
  • Random nd-array (ndslice) generation.
  • Bounded integer generation in randIndex uses Daniel Lemire's fast alternative to modulo reduction. The throughput increase measured for randIndex!uint on an x86-64 processor compiled with LDC 1.6.0 was 1.40x for Mt19937_64 and 1.73x for Xoroshiro128Plus. The throughput increase measured for randIndex!ulong was 2.36x for Mt19937_64 and 4.25x for Xoroshiro128Plus.
random.variable (new)
  • Uniform
  • Exponential
  • Gamma
  • Normal
  • Cauchy
  • ...
random.ndvariable (new)
  • Simplex
  • Sphere
  • Multivariate Normal
  • ...
random.algorithm (new)
  • Ndslice and range API adaptors
random.engine.* (fixed, reworked, new)
  • opCall API instead of range interface is used (similar to C++)
  • No default and copy constructors are allowed for generators.
  • unpredictableSeed has not state, returns size_t
  • unpredictableSeed!UIntType overload for seeds of any unsigned type (merged to Phobos)
  • Any unsigned generators are allowed.
  • min property was removed. Any integer generator can normalize its minimum down to zero.
  • Mt19937: +100% performance for initialization. (merged to Phobos)
  • Mt19937: +54% performance for generation. (merged to Phobos)
  • Mt19937: fixed to be more CPU cache friendly. (merged to Phobos)
  • 64-bit Mt19937 initialization is fixed (merged to Phobos)
  • 64-bit Mt19937 is default for 64-bit targets
  • Permuted Congruential Generators (new)
  • SplitMix generators (new)
  • Fixed XorshiftEngine's support for non-uint word sizes & allow various shift directions (merged to Phobos)
  • XorshiftStar Generators (new)
  • Xoroshiro128Plus generator (new)
  • Xoshiro256StarStar & Xoshiro128StarStar_32 generators (new)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].