BendtorchGpu.toff: def of bendtorch-gpu@1.3.0.0 Import: import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpu Lines 624-629 of bendtorch-gpu@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-gpu@1.3.0.0/main.bend&start_line=624&end_line=629 import Base # 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 # 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 # started at +0.0, which leaves it as it is; so the sums below skip them and give the same bits (for finite numbers: # 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) def toff(+bh: U32, +i: U32, +tr: U32) -> U32: ((bh * tr : U32) + U32.div((i * (i + 1 : U32) : U32), 2) : U32) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul