Fast Sin/Cos using a pre computed translation array

前端 未结 7 1441
渐次进展
渐次进展 2020-12-09 10:43

I have the following code doing Sin/Cos function using a pre-calculated memory table. in the following example the table has 1024*128 items covering all the Sin/Cos values f

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 11:04

    If you have to compute it so many times,

    1. Use a processor-specific math library like the IKML or ACML and
      1. Compute the values in groups (vectors).
      2. When you need both, always compute the sin and cos of a value at the same time.
    2. Check your algorithm complexity and implementation design.
    3. Make sure you're using all the processor has to offer - x64 architecture, plus any vector instructions that would help.

提交回复
热议问题