[all-commits] [llvm/llvm-project] 2be722: [libc][math] Implement atan2f correctly rounded to...

lntue via All-commits all-commits at lists.llvm.org
Mon Apr 1 10:31:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2be722587f5987891ed8b2904a03f983e987f226
      https://github.com/llvm/llvm-project/commit/2be722587f5987891ed8b2904a03f983e987f226
  Author: lntue <35648136+lntue at users.noreply.github.com>
  Date:   2024-04-01 (Mon, 01 Apr 2024)

  Changed paths:
    M libc/config/baremetal/arm/entrypoints.txt
    M libc/config/baremetal/riscv/entrypoints.txt
    M libc/config/darwin/arm/entrypoints.txt
    M libc/config/linux/aarch64/entrypoints.txt
    M libc/config/linux/arm/entrypoints.txt
    M libc/config/linux/riscv/entrypoints.txt
    M libc/config/linux/x86_64/entrypoints.txt
    M libc/config/windows/entrypoints.txt
    M libc/docs/math/index.rst
    M libc/spec/stdc.td
    M libc/src/math/generic/CMakeLists.txt
    A libc/src/math/generic/atan2f.cpp
    M libc/src/math/generic/atanf.cpp
    M libc/src/math/generic/inv_trigf_utils.cpp
    M libc/src/math/generic/inv_trigf_utils.h
    M libc/test/src/math/CMakeLists.txt
    A libc/test/src/math/atan2f_test.cpp
    M libc/test/src/math/atanf_test.cpp
    M libc/test/src/math/smoke/CMakeLists.txt
    A libc/test/src/math/smoke/atan2f_test.cpp
    M libc/utils/MPFRWrapper/MPFRUtils.cpp
    M libc/utils/MPFRWrapper/MPFRUtils.h

  Log Message:
  -----------
  [libc][math] Implement atan2f correctly rounded to all rounding modes. (#86716)

We compute atan2f(y, x) in 2 stages:
- Fast step: perform computations in double precision , with relative
errors < 2^-50
- Accurate step: if the result from the Fast step fails Ziv's rounding
test, then we perform computations in double-double precision, with
relative errors < 2^-100.

On Ryzen 5900X, worst-case latency is ~ 200 clocks, compared to average
latency ~ 60 clocks, and average reciprocal throughput ~ 20 clocks.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list