Assembly code for sin(x) using Taylor expansion
In x86 Linux, how can I implement sin(x) in assembly code using Taylor Expansion ? Would this article help you? http://www.coranac.com/2009/07/sines/ It has a couple of algorithms for computing approximate sin(x) values, with both C and assembly versions. Granted, it's ARM assembly, but the gist of it should translate easily to x86 or similar. You don't state which CPU architecture so I'm assuming x86. The simplist (and possibly most inefficient) way would be to write the formula in RPN, which can be mapped almost directly to FPU instructions. Example, algebraic formula : x - (x^3/3!) + (x^5/5