def VecT.depth.go

bend-tensors@0.0.0.2 · bend_tensors.bend:1191

import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensors
import Base

1191# the smallest n with 4 * 2^n >= m; the fuel is m itself, log2(m) steps
1192def VecT.depth.go(fuel: Nat, +n: Nat, +cap: Nat, +m: Nat, lt: Bool) -> Nat:
1193  match fuel lt:
1194    case _ False{}:
1195      n
1196    case 0n _:
1197      n
1198    case 1n+f True{}:
1199      +cap2 = Nat.add(cap, cap)
1200      VecT.depth.go(f, 1n+n, cap2, m, Nat.is_lt(cap2, m))

Uses (4)

Used by (1)