aboutsummaryrefslogtreecommitdiff
path: root/docs/implementation/primitive/random.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/implementation/primitive/random.html')
-rw-r--r--docs/implementation/primitive/random.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/implementation/primitive/random.html b/docs/implementation/primitive/random.html
index c907ee1c..86c75219 100644
--- a/docs/implementation/primitive/random.html
+++ b/docs/implementation/primitive/random.html
@@ -5,7 +5,7 @@
</head>
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../../index.html">BQN</a> / <a href="../index.html">implementation</a> / <a href="index.html">primitive</a></div>
<h1 id="implementation-of-random-stuff"><a class="header" href="#implementation-of-random-stuff">Implementation of random stuff</a></h1>
-<p>Not a primitive, but CBQN's <code><span class='Function'>•MakeRand</span></code> initializes a random number generator that has some built-in utilities. For clarity we'll call a result of this initialization <code><span class='Value'>rand</span></code> in the text below.</p>
+<p>BQN's random number utilities are provided by <a href="../../spec/system.html#random-generation">system functions</a> and include some with non-obvious implementations. In the text below, <code><span class='Value'>rand</span></code> represents any random number generator: <code><span class='Value'>•rand</span></code>, or a result of <code><span class='Function'>•MakeRand</span></code>.</p>
<h2 id="random-number-generation"><a class="header" href="#random-number-generation">Random number generation</a></h2>
<p>CBQN is currently using wyrand, part of the <a href="https://github.com/wangyi-fudan/wyhash">wyhash</a> library. It's extremely fast, passes the expected test suites, and no one's raised any concerns about it yet (but it's very new). It uses only 64 bits of state and doesn't have extra features like jump ahead.</p>
<p>Other choices are <a href="https://prng.di.unimi.it/">xoshiro++</a> and <a href="https://www.pcg-random.org/">PCG</a>. The authors of these algorithms (co-author for xoshiro) hate each other very much and have spent quite some time slinging mud at each other. As far as I can tell they both have the normal small bias in favor of their own algorithms but are wildly unfair towards the other side, choosing misleading examples and inflating minor issues. I think both generators are good but find the case for xoshiro a little more convincing, and I think it's done better in third-party benchmarks.</p>