Faster cosine look up table

Is it code for DUE? Why do you need 4 quadrant mapping, if you have plenty of memory to store 360 integers? Other things, this two lines:

id=1*(cosinus(pos)*ia+cosinus(pos-120)*ib+cosinus(pos+120)*ic);
  iq=1*(cosinus(pos)*ia+cosinus(pos-120)*ib+cosinus(pos+120)*ic);

I noticed, it twice, it would make sense to store "pos-120" and "pos+120" as intermediate result in a variable, not to calculate it 4 times. Same with cosine(pos -/+ 120) - don't have to do look-up twice, store it in variable. Even both value located in RAM, storing "resolved" value would save time on indexing array.