cancel
Showing results for 
Search instead for 
Did you mean: 

Fast atan2 function.

lipin
Associate II
Posted on August 27, 2010 at 00:02

Fast atan2 function.

3 REPLIES 3
fastmapper2
Associate II
Posted on May 17, 2011 at 14:04

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.

lipin
Associate II
Posted on May 17, 2011 at 14:04

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

lipin
Associate II
Posted on May 17, 2011 at 14:04