This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 6/6] Remove slow paths from sin/cos


Siddhesh Poyarekar wrote:
> On Monday 12 March 2018 11:01 PM, Wilco Dijkstra wrote:
>> I had lots of issues due to parts of functions being included in sincos.c, so I had to
>> disable sincos during development. The new version is much easier to maintain.
>
> That's subjective; someone half a decade down the line might differ when
> they see bits of code duplicated across files :)

This code won't last half a decade - it should be further simplified and made much faster.

This pattern is repeated 6 times with slight variations. It may be feasible to
merge it all into do_sin:

          if (k < 0x3fd00000)
            {
              xx = x * x;
              t = POLYNOMIAL (xx) * (xx * x);
              *sinx = x + t;
            }
          else
            *sinx = __copysign (do_sin (x, 0), x);

The other is:

      /* |x| < 2.426265.  */
      y = hp0 - fabs (x);
      a = y + hp1;
      da = (y - a) + hp1;

That's tiny enough that I don't see an issue.

Wilco

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]