I have been reading C99 Rationale, where I found this mysterious excerpt (emphasis is mine):
7.12.4 Trigonometric functions
Implementation note: trignometric argument reduction should be performed by a method that causes no catastrophic discontinuities in the error of the computed result. In particular, methods based solely on naive application of a calculation like
x - (2*pi) * (int)(x/(2*pi))
are ill-advised.
What exactly is wrong with this formula of reduction? It seems, that it looks fine, according to property of periodity, with the interval of 2*pi
.