;performs complex multiplication of Complex buffers X*Y=Z
(bind-func Complex_multiplication_polar
(lambda (X:Complexf* Y:Complexf* Z:Complexf* size:i64)
(let ((n:i64 0))
(dotimes (n size)
(tset! (pref-ptr Z n) 0 (* (tref (pref-ptr X n) 0) (tref (pref-ptr Y n) 0))) ;multiply magnitude
(tset! (pref-ptr Z n) 1 (+ (tref (pref-ptr X n) 1) (tref (pref-ptr Y n) 1))) ;sum angles
void))))