16th IEEE Symposium on Computer Arithmetic (ARITH-16 '03)
Accelerating Sine and Cosine Evaluation with Compiler Assistance
Santiago de Compostela, Spain
June 15-June 18
ISBN: 0-7695-1894-X
Some software libraries add special entry points to enable both the sine and cosine to be evaluated with one call for performance purposes. This paper proposes another method which does not involve new function names. By having the compiler front end recognize trigonometric function invocations, and replace them with a call to a common function which executes the code common to all the functions, followed by a short routine to produce the desired computation, it is possible to compute both the sine and cosine, when needed in about the same time as to compute only one of them.