Complex_multiplication_bybuf   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/math.xtm

Implementation

(bind-func Complex_multiplication_bybuf
  (let ((dd:/4,float/* (alloc)))
    (vfill! dd -1.0 1.0 -1.0 1.0)
    (lambda (a:Complexf* b:Complexf* c:Complexf* len:i64)
      (if (evenp len)
          (let ((j 0)
                (aa:/4,float/* (cast a))
                (bb:/4,float/* (cast b))
                (cc:/4,float/* (cast c)))
            (dotimes (j (/ len 2))
              (pset! cc j
                     (+ (* (vshuffle (pref-ptr aa j) null 0 0 2 2)
                           (vshuffle (pref-ptr bb j) null 0 1 2 3))
                        (* (* (vshuffle (pref-ptr aa j) null 1 1 3 3)
                              (vshuffle (pref-ptr bb j) null 1 0 3 2))
                           dd))))
            void)
          (let ((i 0))
            (dotimes (i len)
              (tset! (pref-ptr c i) 0
                     (- (* (tref (pref-ptr a i) 0)
                           (tref (pref-ptr b i) 0))
                        (* (tref (pref-ptr a i) 1)
                           (tref (pref-ptr b i) 1))))
              (tset! (pref-ptr c i) 1
                     (+ (* (tref (pref-ptr a i) 0)
                           (tref (pref-ptr b i) 1))
                        (* (tref (pref-ptr a i) 1)
                           (tref (pref-ptr b i) 0)))))
            void)))))


Back to Index

Similar Entries

  • Complex_addition_bybuf    xtlang
  • Complex_addition_bybuf    xtlang
  • Complex_bufferize    xtlang
  • Complex_bufferize    xtlang
  • Complex_bufferize    xtlang
  • Complex_bufferize    xtlang
  • Complex_conj    xtlang
  • Complex_conj    xtlang
  • Complex_division_bybuf    xtlang
  • Complex_division_bybuf    xtlang
  • Complex_mag    xtlang
  • Complex_mag    xtlang
  • Complex_multiplication_bybuf    xtlang
  • Complex_multiplication_polar    xtlang
  • Complex_phase    xtlang
  • Complex_phase    xtlang
  • Complex_phase2    xtlang
  • Complex_subtraction_bybuf    xtlang
  • Complex_subtraction_bybuf    xtlang
  • Complex_unbufferize    xtlang
  • Complex_unbufferize    xtlang
  • Complex_unbufferize    xtlang
  • Complex_unbufferize    xtlang
  • GSL_SET_COMPLEX    xtlang
  • complex?    scheme
  • impc:ir:complex-type?    scheme
  • impc:ti:complex-type?    scheme
  • impc:ti:complex-unify    scheme
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang
  • xtm_multiplication    xtlang