<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/test/src/math/asin_test.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] Move libc_errno.h to libc/src/__support and make LIBC_ERRNO_MODE_SYSTEM to be header-only. (#143187)</title>
<updated>2025-06-11T20:25:27+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-11T20:25:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d87eea35fac5a34a841c637db8908128409a184e'/>
<id>d87eea35fac5a34a841c637db8908128409a184e</id>
<content type='text'>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first step in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Implement double precision asin correctly rounded for all rounding modes. (#134401)</title>
<updated>2025-04-25T13:55:21+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-04-25T13:55:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ade502a8c46b8393e022b4eabcdd445af91a451c'/>
<id>ade502a8c46b8393e022b4eabcdd445af91a451c</id>
<content type='text'>
Main algorithm:

The Taylor series expansion of `asin(x)` is:
```math
\begin{align*}
  asin(x) &amp;= x + x^3 / 6 + 3x^5 / 40 + ... \\
       &amp;= x \cdot P(x^2) \\
       &amp;= x \cdot P(u) &amp;\text{, where } u = x^2.
\end{align*}
```
For the fast path, we perform range reduction mod 1/64 and use degree-7
(minimax + Taylor) polynomials to approximate `P(x^2)`.

When `|x| &gt;= 0.5`, we use the transformation:
```math
  u = \frac{1 + x}{2}
```
and apply half-angle formula to reduce `asin(x)` to:
```math
\begin{align*}
  asin(x) &amp;= sign(x) \cdot \left( \frac{\pi}{2} - 2 \cdot asin(\sqrt{u}) \right) \\
       &amp;= sign(x) \cdot \left( \frac{\pi}{2} - 2 \cdot \sqrt{u} \cdot P(u) \right).
\end{align*}
```
Since `0.5 &lt;= |x| &lt;= 1`, `|u| &lt;= 0.5`. So we can reuse the polynomial
evaluation of `P(u)` when `|x| &lt; 0.5`.

For the accurate path, we redo the computations in 128-bit precision
with degree-15 (minimax + Taylor) polynomials to approximate `P(u)`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Main algorithm:

The Taylor series expansion of `asin(x)` is:
```math
\begin{align*}
  asin(x) &amp;= x + x^3 / 6 + 3x^5 / 40 + ... \\
       &amp;= x \cdot P(x^2) \\
       &amp;= x \cdot P(u) &amp;\text{, where } u = x^2.
\end{align*}
```
For the fast path, we perform range reduction mod 1/64 and use degree-7
(minimax + Taylor) polynomials to approximate `P(x^2)`.

When `|x| &gt;= 0.5`, we use the transformation:
```math
  u = \frac{1 + x}{2}
```
and apply half-angle formula to reduce `asin(x)` to:
```math
\begin{align*}
  asin(x) &amp;= sign(x) \cdot \left( \frac{\pi}{2} - 2 \cdot asin(\sqrt{u}) \right) \\
       &amp;= sign(x) \cdot \left( \frac{\pi}{2} - 2 \cdot \sqrt{u} \cdot P(u) \right).
\end{align*}
```
Since `0.5 &lt;= |x| &lt;= 1`, `|u| &lt;= 0.5`. So we can reuse the polynomial
evaluation of `P(u)` when `|x| &lt; 0.5`.

For the accurate path, we redo the computations in 128-bit precision
with degree-15 (minimax + Taylor) polynomials to approximate `P(u)`.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Remove placeholder implementations of asin and pow.</title>
<updated>2023-04-20T05:28:16+00:00</updated>
<author>
<name>Tue Ly</name>
<email>lntue@google.com</email>
</author>
<published>2023-04-20T05:03:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f79264b5f66f54d9102d358ac00a3d8de25fada7'/>
<id>f79264b5f66f54d9102d358ac00a3d8de25fada7</id>
<content type='text'>
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D148781
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D148781
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Switch math functions to use libc_errno and fix some errno and floating point exceptions.</title>
<updated>2023-03-07T05:51:16+00:00</updated>
<author>
<name>Tue Ly</name>
<email>lntue@google.com</email>
</author>
<published>2023-03-06T03:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=31c39439a894f6cc46cdcdc6d2f45da004184f6a'/>
<id>31c39439a894f6cc46cdcdc6d2f45da004184f6a</id>
<content type='text'>
Switch math functions to use libc_errno and fix some errno and
floating point exceptions

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145349
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Switch math functions to use libc_errno and fix some errno and
floating point exceptions

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145349
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][NFC] Move UnitTest and IntegrationTest to the 'test' directory.</title>
<updated>2023-02-07T19:45:51+00:00</updated>
<author>
<name>Siva Chandra Reddy</name>
<email>sivachandra@google.com</email>
</author>
<published>2023-02-06T07:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af1315c28f9bab76d3c2e1492a3d41e7c48215f8'/>
<id>af1315c28f9bab76d3c2e1492a3d41e7c48215f8</id>
<content type='text'>
This part of the effort to make all test related pieces into the `test`
directory. This helps is excluding test related pieces in a straight
forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move
the MPFR wrapper and testutils into the 'test' directory.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This part of the effort to make all test related pieces into the `test`
directory. This helps is excluding test related pieces in a straight
forward manner if LLVM_INCLUDE_TESTS is OFF. Future patches will also move
the MPFR wrapper and testutils into the 'test' directory.
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Add place-holder implementation for asin to unblock demo examples.</title>
<updated>2022-10-31T21:22:12+00:00</updated>
<author>
<name>Tue Ly</name>
<email>lntue@google.com</email>
</author>
<published>2022-10-31T19:42:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=97b4cc83e16abec8daa67f5dc82f71791c523f43'/>
<id>97b4cc83e16abec8daa67f5dc82f71791c523f43</id>
<content type='text'>
Add a place-holder implementation for asin to unblock libc demo
examples.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D137105
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a place-holder implementation for asin to unblock libc demo
examples.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D137105
</pre>
</div>
</content>
</entry>
</feed>
