Draw a normal deviate with mean mu and standard deviation sigma.
Box-Muller. The transform naturally yields two independent deviates
per pair of uniforms, and the usual implementation caches the second
for the next call. This one discards it.
That halves the throughput and is deliberate. A cache makes the
generator state depend on whether the call count is odd or even, so
two runs that draw the same number of normals but interleave them
differently with other draws diverge. Without it, the generator’s
position is a plain function of how many times it has been asked for
anything, which is far easier to reason about – and it keeps this
function pure in spirit: no hidden state between calls.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.