Speeding up atan2f
`atan2f` is an important but slow trigonometric function. In this article we'll explain how to approximate it, and implement a version 50x faster than `glibc` on batches of inputs.
Visit mazzo.li → RSS feedOn Hacker News May 2021 – Oct 2025
Systems & Performance 6Software Engineering 4Math & Algorithms 3Society, Policy & Culture 1Security & Privacy 1Networking & Internet 1
`atan2f` is an important but slow trigonometric function. In this article we'll explain how to approximate it, and implement a version 50x faster than `glibc` on batches of inputs.
Let’s say we want to store some data on multiple drives, so that we can recover from drive failures.
When you resize, rotate, or in any way transform an image; or more generally when you resample some discrete signal, the software you are using must _interpolate_ between the discrete points to produce a result. Linear and cubic interpolation are easy to explain, but Lánczos interpolation, one of the most popular…