def toff

bendtorch-gpu@1.3.0.0 · main.bend:624

import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpu
import Base

624# where row i of head bh starts in P and G, which keep only the lower triangle (j <= i), row after row: main.bend's P
625# and G are t·t with zeros above the diagonal, and a product by one of those zeros adds +0.0 or -0.0 to a sum that
626# started at +0.0, which leaves it as it is; so the sums below skip them and give the same bits (for finite numbers:
627# an infinity or a NaN in a masked key's row would reach main.bend's sums as 0·inf = NaN, and does not reach these)
628def toff(+bh: U32, +i: U32, +tr: U32) -> U32:
629  ((bh * tr : U32) + U32.div((i * (i + 1 : U32) : U32), 2) : U32)

Uses (4)

Used by (6)