def rot_lo

bend-ml-llama@0.2.1.0 · main.bend:429

import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama
import Base

429# first half: lo*cos + (-hi)*sin; second half: hi*cos + lo*sin (q*cos + rotate_half(q)*sin)
430def rot_lo(h1: List<&2, F32>, h2: List<&2, F32>, cs: List<&2, F32>, sn: List<&2, F32>) -> List<&2, F32>:
431  match h1 h2 cs sn:
432    case Con{+a, ta} Con{+b, tb} Con{+c, tc} Con{+s, ts}:
433      ((a * c : F32) + (F32.neg(b) * s : F32) : F32) <> rot_lo(ta, tb, tc, ts)
434    case _ _ _ _:
435      Nil{}

Uses (5)

Used by (1)