def Vec4.min_upto
import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensorsimport Base
349# the smallest of the first k elements
350def Vec4.min_upto(k: Nat, v: Vec4) -> F32:
351 match k v:
352 case 1n Vec4{x0, x1, x2, x3}:
353 x0
354 case 2n Vec4{x0, x1, x2, x3}:
355 F32.min(x0, x1)
356 case 3n Vec4{x0, x1, x2, x3}:
357 F32.min(F32.min(x0, x1), x2)
358 case _ v2:
359 Vec4.min(v2)