diff options
| author | Tue Ly <lntue@google.com> | 2022-07-26 21:14:22 -0400 |
|---|---|---|
| committer | Tue Ly <lntue@google.com> | 2022-07-27 12:23:36 -0400 |
| commit | 15b9380dfd4e5e9d5c47f2627394623c64dc61e8 (patch) | |
| tree | 4cdd4bb231d0c1cf6ff73da2ea9324f1227a6d51 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h | |
| parent | 77ccf63ef0c476feb3c19d403de05e0665986589 (diff) | |
| download | llvm-15b9380dfd4e5e9d5c47f2627394623c64dc61e8.zip llvm-15b9380dfd4e5e9d5c47f2627394623c64dc61e8.tar.gz llvm-15b9380dfd4e5e9d5c47f2627394623c64dc61e8.tar.bz2 | |
[libc] Change sinf range reduction to mod pi/16 to be shared with cosf.
Change `sinf` range reduction to mod pi/16 to be shared with `cosf`.
Previously, `sinf` used range reduction `mod pi`, but this cannot be used to implement `cosf` since the minimax algorithm for `cosf` does not converge due to critical points at `pi/2`. In order to be able to share the same range reduction functions for both `sinf` and `cosf`, we change the range reduction to `mod pi/16` for the following reasons:
- The table size is sufficiently small: 32 entries for `sin(k * pi/16)` with `k = 0..31`. It could be reduced to 16 entries if we treat the final sign separately, with an extra multiplication at the end.
- The polynomials' degrees are reduced to 7/8 from 15, with extra computations to combine `sin` and `cos` with trig sum equality.
- The number of exceptional cases reduced to 2 (with FMA) and 3 (without FMA).
- The latency is reduced while maintaining similar throughput as before.
Reviewed By: zimmermann6
Differential Revision: https://reviews.llvm.org/D130629
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h')
0 files changed, 0 insertions, 0 deletions
