ARM-software / CMSIS-DSP

CMSIS-DSP embedded compute library for Cortex-M and Cortex-A
https://arm-software.github.io/CMSIS-DSP
Apache License 2.0
562 stars 146 forks source link

A faster and more accurate sine and cosine function #97

Open chenzt2020 opened 1 year ago

chenzt2020 commented 1 year ago

Can we calculate trigonometric functions using the Remez algorithm? This is faster and more accurate than the table lookup method, and the range of arguments can be [-inf,inf]

Here is an example of fast sine and fast cosine: https://github.com/chenzt2020/foc_learning/blob/main/3.fast_sin/fast_sin.h

benchmark STM32F446 180MHz -Ofast image

jobs-git commented 4 months ago

those branches does not inspire fastness. I did a test on non DSP, its among the slowest actually.