A Novel SIMD-Optimized Implementation for Fast and Memory-Efficient Trigonometric Computation
Nikhil Dev Goyal, Parth Arora
TL;DR
This work tackles the problem of fast, memory-efficient trig function computation on hardware-constrained platforms. It introduces SIMD-accelerated, piecewise rational approximations for $\sin$, $\cos$, and $\tan$ derived from linear interpolation on uniform subranges of $\frac{\pi}{12}$, with tan built from these components to improve stability near singularities. The approach achieves roughly $5\times$ speedups over inbuilt C++ functions while requiring no precomputation, and demonstrates significantly reduced hardware resources on an Artix-7 FPGA in terms of BRAM and DSP usage, with especially strong stability for the tan function near $\pi/2$. The paper also details a SIMD-enabled C++ implementation using fast inverse square roots and angle-reduction techniques, and compares against optimized Taylor-series alternatives, showing favorable accuracy and performance trade-offs for resource-constrained deployments. Overall, the proposed methods offer practical, hardware-friendly trig computation suitable for FPGA, MCU, and similar platforms, with code and hardware notes provided for reproducibility.
Abstract
This paper proposes a novel set of trigonometric implementations which are 5x faster than the inbuilt C++ functions. The proposed implementation is also highly memory efficient requiring no precomputations of any kind. Benchmark comparisons are done versus inbuilt functions and an optimized taylor implementation. Further, device usage estimates are also obtained, showing significant hardware usage reduction compared to inbuilt functions. This improvement could be particularly useful for low-end FPGAs or other resource-constrained devices.
