def rot_lo

bend-ml-llama@0.2.0.0 · main.bend:428

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

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

Uses (5)

Used by (1)