public void MultiRandInt32() { var mr = Rng.SplitMix(); var data = mr.Span <int>(Pow2.T23); int pos = 0, neg = 0, zed = 0; foreach (var x in data) { if (x > 0) { pos++; } else if (x < 0) { neg++; } else { zed++; } } var r = math.abs(pos - neg) / ((double)pos + (double)neg); var tolerance = .01; Claim.lt(r, tolerance); }
public void bench_splitmix_bernoulli_u64() { var gen = Rng.SplitMix(); var sampler = gen.Bernoulli <byte>(.35); Benchmark(sampler); }
public void bench_splitmix_uniform_f64() { Benchmark(Rng.SplitMix().PointSource <double>()); }
void bench_splitmix_bitsource() { Benchmark(Rng.SplitMix().PointSource <ulong>().ToBitStream()); }
public void bench_splitmix_bitstring() { Benchmark((Rng.SplitMix().BitStringSource((Pow2.T03, Pow2.T08)))); }
public void bench_splitmix_uniform_u64() { Benchmark(Rng.SplitMix().PointSource <ulong>()); }