[libc-commits] [PATCH] D123154: [libc] Implement sinf function that is correctly rounded to all rounding modes.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 21 13:08:25 PDT 2022

lntue added a comment.

In D123154#3669380 <https://reviews.llvm.org/D123154#3669380>, @santoshn wrote:

> Tue,
> Thanks for the information. Here is the correctly rounded sinf from our RLIBM project: https://github.com/rutgers-apl/The-RLIBM-Project/tree/main/experimental/sin
> We know it works for round-to-nearest and produces correct results for all inputs. From our testing, it is close to 2X faster than the current LLVM version and about 25% faster than the CORE-MATH version with respect to latency.
> Let me know if you have any questions.

Thanks for the link!  It's nice to see that we can bring down the overall latency and it has no exceptional values!

In the earlier iteration of this patch, I've implemented some thing similar with the same degree using `k*pi/256` range reduction instead of `k*pi/512`, with around 5-6 exceptional values: https://reviews.llvm.org/D123154?vs=on&id=420614#toc.
You might want to try with better polynomial generator to see if it can reduce the number of exceptional values, or maybe even bring down the number of sub-intervals to 128?

In this patch I went with the other extreme for range reduction.  When I have more time, I'd definitely playing around with various ranges of second range reduction to find the balance between look-up table size, polynomials' degrees, and number of exceptional values.


  rG LLVM Github Monorepo



More information about the libc-commits mailing list