This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

sin function precision

Genius 5785 points

Hello,

I'd like to benchmark sin function of Cortex-A8 with VFP by TI ARM compiler v5.1.1. I'm a little confused below. sin() -> double precision, sinf() -> single precision. Is it correct?

http://processors.wiki.ti.com/index.php/ARM_compiler_optimizations#Tips_for_floating_point_performance

Regards,
Kazu

  • The functions defined in math.h such as sin(), cos(), sqrt(), etc. are defined as double precision routines. This means that calling these functions will result in significant overhead. The C99 standard specifies single precision versions of these routines, which are implemented in the TI ARM compiler. These routines are defined as the double precision version with an 'f' suffix. So the routines are of the form sinf(), cosf(), sqrtf(), etc. It is important to note that these routines are not TI specific and are part of the C99 standard.