def rng_gauss2
import bend-ml-tensor-gpu@0.1.5.1/main.bend as BendMlTensorGpuimport Base
682# the Gaussians of cells 2p and 2p + 1 of counter s (Box-Muller). The angle's 24 bits are u_b's (its hash plus one,
683# mod 2^24), so the angle is 2 pi u_b exactly before rounding
684def rng_gauss2(+s: U32, +p: U32) -> F32 & F32:
685 +i = (p + p : U32)
686 rng_pair(F32.sqrt((0.0 - (2.0 * rng_ln(rng_uniform(s, i)) : F32) : F32)), rng_sc(U32.and((rng_hash(s, (i + 1 : U32)) + 1 : U32), 16777215)))