Cover.tree.same.as: def of gralha-coverage@0.1.0.1 Import: import gralha-coverage@0.1.0.1/cover.bend as Cover Lines 90-94 of gralha-coverage@0.1.0.1/cover.bend: https://jend.leeeet.dev/read.txt?path=gralha-coverage@0.1.0.1/cover.bend&start_line=90&end_line=94 import Base import gralha-text-scan@0.1.0.1/scan.bend as U # Coverage over the cell rectangle [x0, x1) by [y0, y1) of a node's square at # (nx, ny) of side size, when every cell in it holds the same value; -1 otherwise. # acc is 2 before any cell is seen, -1 once cells disagree, else the value so far. def tree.same.as(+v: F32, +u: F32) -> F32: U.choose(F32, F32.is_gt(v, 1.5), u, U.choose(F32, F32.is_lt(v, 0.0) || F32.is_lt(u, 0.0) || Bool.not(F32.is_eq(v, u)), F32.neg(1.0), v)) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.neg https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose