Argument reduction means mapping the argument of a periodic function to the canonical period (for example, (-π, π] or the like). If you used π / 2 as a divisor, then the least significant bits of the factor would be sufficient to determine the correct sign of /, etc. for trigger functions.
Unfortunately, however, remquo
useless for implementing the standard reduction of trigonometric arguments, since π
is irrational; reducing large arguments modulo approximation π will give you results without significant bits, i.e. all errors.
If you write a function f(x)
defined as sin (πx) or similar, the period is now exactly represented in floating point, and remquo
can do exactly what you need, while calling sin(2*M_PI*x)
will directly produce results without significant bits (i.e. the whole error) when x
is large.
source share