• S
    math: tan cleanups · 1d5ba3bb
    Szabolcs Nagy 提交于
    * use unsigned arithmetics on the representation
    * store arg reduction quotient in unsigned (so n%2 would work like n&1)
    * use different convention to pass the arg reduction bit to __tan
      (this argument used to be 1 for even and -1 for odd reduction
      which meant obscure bithacks, the new n&1 is cleaner)
    * raise inexact and underflow flags correctly for small x
      (tanl(x) may still raise spurious underflow for small but normal x)
      (this exception raising code increases codesize a bit, similar fixes
      are needed in many other places, it may worth investigating at some
      point if the inexact and underflow flags are worth raising correctly
      as this is not strictly required by the standard)
    * tanf manual reduction optimization is kept for now
    * tanl code path is cleaned up to follow similar logic to tan and tanf
    1d5ba3bb
__tan.c 3.9 KB