Can the following code:
float f = sinf(0.5f);
be optimized to the following code (actually pseudocode to give an idea):
float f = 0x1.eaee88p-2f;
feraiseexcept(FE_INEXACT);
The same principle for the other C standard library functions. As I understand, since the "whole language is based on the (rather unhelpful) concept of an "abstract machine" (link), then an "implementation is free to do anything in the ways of optimizations as long as side effects and "the observable behavior" are respected" (the same link).