~/bend-docscommunity

src/math/random/pcg.bend checks

raw source on the hub · import bend-collections-laws-math@1.0.0.0/src/math/random/pcg.bend as Pcg

3 imports
import Base
import ../u64.bend as W
import ../w64.bend as X

Types

type PCG source · line 24 · raw

Data

Definitions

def new source · line 27 · raw

@+seed1:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+seed2:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> PCG

def mul_hi source · line 31 · raw

0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

2549297995355413924, 4865540595714422341

def mul_lo source · line 34 · raw

0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

def inc_hi source · line 38 · raw

0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

6364136223846793005, 1442695040888963407

def inc_lo source · line 41 · raw

0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

def cheap_mul source · line 45 · raw

0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

0xda942042e4dd58b5

def xor64 source · line 48 · raw

@+a:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+b:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> 0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

def step_fin source · line 52 · raw

@+ih:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+il:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+l:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+h:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> PCG

the new state from the product's low word l and high word h

def step_mul source · line 55 · raw

@+mh:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+ml:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+ih:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+il:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+hi:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+lo:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @p:Pair(0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64, 0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64) -> PCG

def step_with source · line 61 · raw

@+mh:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+ml:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+ih:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+il:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @p:PCG -> PCG

state * (mh:ml) + (ih:il) mod 2^128 (Go's (*PCG).next with its constants as parameters)

def step source · line 66 · raw

@p:PCG -> PCG

def dxsm2 source · line 69 · raw

@+h:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+lo:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> 0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

def dxsm_with source · line 73 · raw

@+cm:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+hi:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> @+lo:0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64 -> 0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64

the DXSM output of a state hi:lo with the multiplier cm

def out source · line 76 · raw

@+p:PCG -> Pair(0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64, PCG)

def next source · line 81 · raw

@p:PCG -> Pair(0xf86f5f1d9a594d5a5cff999100e01d03/src/math/u64.U64, PCG)