For over 30 probability distributions, this library provides:
- Random variable generation
- Density, probability, survival and quantile functions
Mathematical functions are tested for high precision and RNG tested to correctly fit the distribution
Builds static library with header file, optionally run tests
$ zig build -Doptimize=ReleaseFast
$ zig build test
$ zig build correctness -Doptimize=ReleaseFast
$ zig fetch --save git+https://github.com/PauloCampana/random_variable
// build.zig
const rv_dep = b.dependency("random_variable", .{
.target = target,
.optimize = optimize,
});
const rv_mod = rv_dep.module("random_variable");
exe.root_module.addImport("random_variable", rv_mod);
// main.zig
const rv = @import("random_variable");