<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/src/math, 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] Use `raise_except_if_required` for log2f. (#144961)</title>
<updated>2025-06-19T21:51:01+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-19T21:51:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d3a2931d8af87c20aaede991acda0b5f313075c3'/>
<id>d3a2931d8af87c20aaede991acda0b5f313075c3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Refactor expf implementation to header-only in src/__support/math folder. (#143790)</title>
<updated>2025-06-12T17:18:30+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-06-12T17:18:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d1ca8d891ff038ec29e67065a446aa2f2043325e'/>
<id>d1ca8d891ff038ec29e67065a446aa2f2043325e</id>
<content type='text'>
This is a 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 a 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] 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][NFC] Remove unused CMake for gpu math</title>
<updated>2025-06-07T14:25:27+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-07T14:25:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0e2103ac5c7c62341b499dc2fb402715ccdf9021'/>
<id>0e2103ac5c7c62341b499dc2fb402715ccdf9021</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] clean up unused exp_utils (#143181)</title>
<updated>2025-06-06T18:02:55+00:00</updated>
<author>
<name>Michael Jones</name>
<email>michaelrj@google.com</email>
</author>
<published>2025-06-06T18:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d8bfb4719df7a043c38962bbbd60fd3387c917b6'/>
<id>d8bfb4719df7a043c38962bbbd60fd3387c917b6</id>
<content type='text'>
This file's just left over from old code, but it doesn't compile
anymore. It's never used so this patch just removes it.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This file's just left over from old code, but it doesn't compile
anymore. It's never used so this patch just removes it.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Cleanup unimplemented math functions (#143173)</title>
<updated>2025-06-06T17:27:13+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-06-06T17:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=525726a52078d1a03e8903458f4e92d41154e879'/>
<id>525726a52078d1a03e8903458f4e92d41154e879</id>
<content type='text'>
Summary:
This patch cleans up the leftoever files that were either implemented or
are still unimplemented stubs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This patch cleans up the leftoever files that were either implemented or
are still unimplemented stubs.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math][c23] Add atanf16() function (#141612)</title>
<updated>2025-06-01T11:36:16+00:00</updated>
<author>
<name>wldfngrs</name>
<email>wldfngrs@gmail.com</email>
</author>
<published>2025-06-01T11:36:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=573545c712357fc4498728d6cde971226c26c20f'/>
<id>573545c712357fc4498728d6cde971226c26c20f</id>
<content type='text'>
- Implementation of atan (tan inverse) function for 16-bit inputs.
- Exhaustive tests across the 16-bit input range</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Implementation of atan (tan inverse) function for 16-bit inputs.
- Exhaustive tests across the 16-bit input range</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Fix some mis-optimization issue with hypotf16. (#141960)</title>
<updated>2025-05-29T15:34:50+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-05-29T15:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=062d24a7d6770b1dd7d5a4968bccb28c85495d67'/>
<id>062d24a7d6770b1dd7d5a4968bccb28c85495d67</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][math] Implement double precision acos correctly rounded for all rounding modes. (#138308)</title>
<updated>2025-05-09T03:23:09+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-05-09T03:23:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=78cc822aa6f5af0eda55089d22ba915b6d8e0216'/>
<id>78cc822aa6f5af0eda55089d22ba915b6d8e0216</id>
<content type='text'>
We reduce computation of `acos` to `asin` as follow:

When `|x| &lt; 0.5`:
```math
acos(x) = \frac{\pi}{2} - asin(x).
```
For `0.5 &lt;= |x| &lt; 1`, let
```math
u = \frac{1 - \left| x \right|}{2},
```
then
```math
acos(x) = \begin{cases}
  2 \cdot asin \left( \sqrt{u} \right) &amp;, 0.5 \leq x &lt; 1 \\
  \pi - 2 \cdot asin \left( \sqrt{u} \right) &amp;, -1 &lt; x \leq 0.5 
\end{cases}
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We reduce computation of `acos` to `asin` as follow:

When `|x| &lt; 0.5`:
```math
acos(x) = \frac{\pi}{2} - asin(x).
```
For `0.5 &lt;= |x| &lt; 1`, let
```math
u = \frac{1 - \left| x \right|}{2},
```
then
```math
acos(x) = \begin{cases}
  2 \cdot asin \left( \sqrt{u} \right) &amp;, 0.5 \leq x &lt; 1 \\
  \pi - 2 \cdot asin \left( \sqrt{u} \right) &amp;, -1 &lt; x \leq 0.5 
\end{cases}
```</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>
</feed>
