BendMlTensorGpu.rng_sc_w: def of bend-ml-tensor-gpu@0.1.5.1 Import: import bend-ml-tensor-gpu@0.1.5.1/main.bend as BendMlTensorGpu Lines 669-673 of bend-ml-tensor-gpu@0.1.5.1/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-tensor-gpu@0.1.5.1/main.bend&start_line=669&end_line=673 import Base # sin and cos of 2 pi v / 2^24 (v < 2^24): the quarter q is v's top 2 bits, w the rest; past the eighth (2^21) the angle # is taken from the quarter's end (2^22 - w, exact), so the polynomial only sees [0, pi/4] def rng_sc_w(+q: U32, +w: U32) -> SC: +hi = U32.is_lt(2097152, w) rng_sc_x(q, hi, (U32.to_f32(Bool.pick(U32, hi, (4194304 - w : U32), w)) * 0.00000037450702 : F32)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_f32 https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-gpu@0.1.5.1/main.bend&name=SC https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-gpu@0.1.5.1/main.bend&name=rng_sc_x