[libc-commits] [libc] [libc][math][c23] implement C23 math function asinpif16 (PR #146226)

Mohamed Emad via libc-commits libc-commits at lists.llvm.org
Fri Jul 4 16:37:40 PDT 2025


hulxv wrote:

It fails due to the expected value for unknown reason

when I set `ONE_OVER_SIX` as 0.166748046875 gives me this

```
Failed to match __llvm_libc_21_0_0_git::asinpif16(-x) against LIBC_NAMESPACE::testing::mpfr::get_mpfr_matcher<mpfr::Operation::Asinpi>( -x, __llvm_libc_21_0_0_git::asinpif16(-x), 0.5, mpfr::RoundingMode::TowardZero).
Match value not within tolerance value of MPFR result:
  Input decimal: 0.50000000000000000000000000000000000000000000000000
     Input bits: 0x3800 = (S: 0, E: 0x000E, M: 0x0000)

  Match decimal: 0.16674804687500000000000000000000000000000000000000
     Match bits: 0x3156 = (S: 0, E: 0x000C, M: 0x0156)

    MPFR result: 0.16662597656250000000000000000000000000000000000000
   MPFR rounded: 0x3155 = (S: 0, E: 0x000C, M: 0x0155)
```

And when I change it to 0.1666259765625 also fails

```
Failed to match __llvm_libc_21_0_0_git::asinpif16(x) against LIBC_NAMESPACE::testing::mpfr::get_mpfr_matcher<mpfr::Operation::Asinpi>( x, __llvm_libc_21_0_0_git::asinpif16(x), 0.5, mpfr::RoundingMode::Upward).
Match value not within tolerance value of MPFR result:
  Input decimal: 0.50000000000000000000000000000000000000000000000000
     Input bits: 0x3800 = (S: 0, E: 0x000E, M: 0x0000)

  Match decimal: 0.16662597656250000000000000000000000000000000000000
     Match bits: 0x3155 = (S: 0, E: 0x000C, M: 0x0155)

    MPFR result: 0.16674804687500000000000000000000000000000000000000
   MPFR rounded: 0x3156 = (S: 0, E: 0x000C, M: 0x0156)

      ULP error: 1.00000000000000000000000000000000000000000000000000
[  FAILED  ] LlvmLibcAsinpif16Test.PositiveRange
```

https://github.com/llvm/llvm-project/pull/146226


More information about the libc-commits mailing list