An adventure in trying to optimize math.Atan2 with Go assembly
Although this post is interesting, the best way to optimize trig functions is generally via rational approximations[1] if you can live with the error (and the clamping). I remember finding a rational function to approximate a tanh-like soft clipper via a Padé approximator on (-1, 1) a few years ago[2]. See an equivalent rational approximation for atan2 here[3].[1] http://www.embedded.com/design/other/4216719/Performing-effi...[2] https://stackoverflow.com/questions/6118028/fast-hyperbolic-...[3] https://www.dsprelated.com/showarticle/1052.php