I am using atan2(y, x) for finding the polar angle from the x-axis and a vector which contains the point (x,y) for converting Cartesian coordinates to polar coordinates. But, in my program which will be used for calculations to move a robot, atan2 is a very computationally expensive procedure. What are ways to approximate atan2's result with a fast calculation with error bounds of 1 degree.
Wikipedia reference for atan2: https://en.wikipedia.org/wiki/Atan2
Here is some sample output:
atan2(1, 0) --> pi/2 atan2(-1, 0) --> -pi/2 atan2(0, 1) --> 0 atan2(0, -1) --> pi
Denote $$ \operatorname{atan2}(y,x) = \arctan z, \quad \mbox{where} \quad z = \dfrac{y}{x}. $$
Note that (in degrees) if $z>1$, then $$ \arctan z = 90^\circ - \arctan \dfrac{1}{z}, $$ and that $$ \arctan(-z) = -\arctan ~ z. $$
So, it is enough to write approximation for $z\in [0,1]$.
This simple approximation $$ \arctan z \approx z\Bigl(45^\circ - 15.66^\circ(z-1)\Bigr)\tag{1} $$ gives us error $\pm0.22^\circ$.
This source gives us not bad approximation. I just translated it to degrees:
$$ \arctan z \approx z\Bigl(45^\circ- \bigl(z - 1\bigr)\bigl(14^\circ + 3.83^\circ z\bigr)\Bigr), \qquad 0\le z \le 1;\tag{2} $$ error is $\pm 0.09^\circ$.
Authors of the paper said that this formula is $3\times$ faster than standard one.