def mix32_inv
import mlbend-generative@0.1.1.0/main.bend as MlbendGenerativeimport Base
48# the inverse of mix32, in closed form: the 16-shift is an involution on
49# 32 bits; the 13-shift inverts by the triple xor; the multiplies invert
50# by their modular inverses mod 2^32
51def mix32_inv(+z: U32) -> U32:
52 +d = U32.xor(z, U32.shrn(z, 16n))
53 +c = (d * 2828982549 : U32)
54 +b = unxor13(c)
55 +a = (b * 3066638151 : U32)
56 U32.xor(a, U32.shrn(a, 16n))
Uses (5)
Used by (0)
No other definition uses this definition.