I suspected the slowness was due to computing double precision. But I tried changing sin() to sinf(), and amazingly sinf() takes MUCH longer. Clearly newlib or libgcc is not optimized very well, or some settings aren't quite right. I need to dig into that......

Hi, I assume that most of us will use fixed point maths, but for those that have a reason to use float and double, is there an alternative implementation that can be included at compile time or some other work around that provide more recent and faster implementations ?

What does the S in sin.S stand for? I googled it but it is to close to sin to find something relevant quickly.

The GCC compiler passes .S files through the C preprocessor, so that you can use #ifdef and #define within assembly files (because of the #ifdef, you can have one .S file that has code for several different targets, and the defines are set based on the -m<xxx> options on the command line). If the file is .s (lowercase), it is passed directly to the assembler and does not go through the preprocessor.