A splitmix64 state. Deterministic, seedable, and reproducible across runs and platforms; this is a source of arbitrary values for Las Vegas search, not a cryptographic generator, and nothing in the tree may treat it as one.
- state : UInt64
The 64-bit generator state.
Instances For
Equations
- Hex.instReprRand.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "state" ++ Std.Format.text " := " ++ (Std.Format.nest 9 (repr x✝.state)).group) " }"
Instances For
Equations
- Hex.instReprRand = { reprPrec := Hex.instReprRand.repr }
Why a bounded draw failed.
- zeroBound : RandError
The requested bound was
0, so no value below it exists. - exhausted
(attempts : Nat)
(rand : Rand)
: RandError
Rejection sampling ran out of fuel; the attempt count and the advanced state are returned so the caller can resume rather than replay a failed stream.
Instances For
Equations
- Hex.instReprRandError = { reprPrec := Hex.instReprRandError.repr }
Equations
- One or more equations did not get rendered due to their size.
- Hex.instReprRandError.repr Hex.RandError.zeroBound prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Hex.RandError.zeroBound")).group prec✝
Instances For
Draw a natural number below bound by rejection sampling: form a
candidate from enough 64-bit words and reject the incomplete top interval
(rather than folding it in with next % bound, which would add modulo
bias). fuel bounds the rejection retries, including the initial candidate;
bound = 0 returns zeroBound.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct the initial state from a seed.
Equations
- Hex.Rand.ofSeed seed = { state := UInt64.ofNat seed }