def rng_sc_w

bend-ml-tensor-gpu@0.1.5.1 · main.bend:669

import bend-ml-tensor-gpu@0.1.5.1/main.bend as BendMlTensorGpu
import Base

669# 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
670# is taken from the quarter's end (2^22 - w, exact), so the polynomial only sees [0, pi/4]
671def rng_sc_w(+q: U32, +w: U32) -> SC:
672  +hi = U32.is_lt(2097152, w)
673  rng_sc_x(q, hi, (U32.to_f32(Bool.pick(U32, hi, (4194304 - w : U32), w)) * 0.00000037450702 : F32))

Uses (9)

Used by (1)