8 Commits

Author SHA1 Message Date
Mohamed Emad
40833eea21
Reland "[libc][math][c23] Implement C23 math function asinpif16" (#152690)
#146226 with fixing asinpi MPFR number function and make it work when
mpfr < `4.2.0`
2025-08-18 00:04:47 +03:00
OverMighty
6a85f7cef3
Revert "[libc][math][c23] Implement C23 math function asinpif16" (#150756)
Reverts llvm/llvm-project#146226

The MPFR test uses `mpfr_asinpi` which requires MPFR 4.2.0 or later, but
the Buildbots are running an older version of MPFR.

See https://lab.llvm.org/buildbot/#/builders/104/builds/27743 for
example.

I said I was going to revert the PR until we have a workaround for older
versions of MPFR, but then I forgot and I just disabled the entrypoints
which doesn't fix the Buildbot builds.
2025-07-26 15:39:43 +03:00
Mohamed Emad
eed9b4e058
[libc][math][c23] Implement C23 math function asinpif16 (#146226)
The function is implemented using the following Taylor series that's
generated using [python-sympy](https://www.sympy.org/en/index.html), and
it is very accurate for |x| $$\in [0, 0.5]$$ and has been verified using
Geogebra. The range reduction is used for the rest range (0.5, 1].

$$
\frac{\arcsin(x)}{\pi} \approx 
\begin{aligned}[t]
    &  0.318309886183791x  \\
    & + 0.0530516476972984x^3 \\
    & + 0.0238732414637843x^5 \\
    & + 0.0142102627760621x^7 \\
    & + 0.00967087327815336x^9 \\
    & + 0.00712127941391293x^{11} \\
    & + 0.00552355646848375x^{13} \\
    & + 0.00444514782463692x^{15} \\
    & + 0.00367705242846804x^{17} \\
    & + 0.00310721681820837x^{19} + O(x^{21})
\end{aligned}
$$

## Geogebra graph

![28-06-2025-1913-eDP-1](https://github.com/user-attachments/assets/f70818e1-1b34-406e-962a-a30fdc909f18)

Closes #132210
2025-07-26 14:02:18 +03:00
Krishna Pandey
bb7cea0637
[libc][math][c++23] Add bfloat16 support in LLVM libc (#144463)
This PR enables support for BFloat16 type in LLVM libc along with
support for testing BFloat16 functions via MPFR.

---------

Signed-off-by: krishna2803 <kpandey81930@gmail.com>
Signed-off-by: Krishna Pandey <kpandey81930@gmail.com>
Co-authored-by: OverMighty <its.overmighty@gmail.com>
2025-07-09 21:26:29 +02:00
Connector Switch
708c0fe3df
[libc] Simplify the version guard for mpfr. (#146354)
Instead of manually calculating the major and minor version numbers, we
can directly use `MPFR_VERSION_NUM` to simplify this.
2025-07-09 00:22:18 +08:00
Anton
851f7c7421
[libc][math][c23] Add acospif16() function (#134664)
Addresses #132211  #132754
Part of #95250
2025-04-24 18:03:24 -04:00
lntue
d0a0de50f7
[libc] Fix implicit conversion warnings in tests. (#131362) 2025-03-14 14:24:11 -04:00
Shourya Goel
7f37b34d31
[libc][complex] Testing infra for MPC (#121261)
This PR aims to add the groundwork to test the precision of libc complex
functions against MPC. I took `cargf` as a test to verify that the infra
works fine.
2025-01-28 11:01:16 +05:30