2010-08-26 03:02 PM
Fast atan2 function.
2011-05-17 05:04 AM
It is difficult to help you without more information. I suggest that you indicate the gcc version you are using and provide a compilable version of the code that includes the definitions of the macros you are using. Performance improvements may be possible with alternative definitions of those macros.
When evaluating speed it may even be important to know precisely which processor is being used, the clock speed, and other relevant settings (such as wait states). Divisions by zero and numeric overflows are also not detected by your atan2 function. This could lead to some undesirable results.2011-05-17 05:04 AM
I am sorry for long replay I need to put optimizations for later. I divide by smallest fraction when there is division by 0 case. Dividing using 32 bits did the trick and now I am happy with speed and accuracy.
Regards
Thomas
2011-05-17 05:04 AM