Examining the compiled code of the sinf() on our GCC implementation, I see that it calls a builtin function ___ieee754_rem_pio2f. I tried searching for a clue on what this function is, but all I found were posts referring to a bug with the rem_pio2f (no __ieee754) function, with no explanation.
Can anyone shed some light on this function?
(sounds like “remainder of PI-over-2-float, or sth like that – but why need a function for a constant?)
EDIT: Thanks to @Thiruvalluvar for providing the source code:
/* __ieee754_rem_pio2f(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2f()
*/
sinf takes a float and returns a float. The support for floating point arithmetic was added in C99. The earlier C standards did’t have sinf but only sin (which is for double). The ieee_754 indicates that the function is added to support floating point support. Here’s a source code link for the that file if are interested.