You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An initial fix was made for accuracy but was reverted due to a bug in the pattern generator: #2449
This ticket tracks fixing that work and submitting a more accurate decomposition for acos op.
Current:
// Expand acos for non-complex arguments to MHLO dialect as follows:
// acos(x) = 2 * atan2(sqrt(1 - x^2), (1 + x)) if x != -1
Using 1-x^2 will be inaccurate when abs(x) is close to 1. The corresponding cancellation errors are avoided when using (1-x)*(1+x).
Steps to reproduce your issue
No response
Version information
No response
The text was updated successfully, but these errors were encountered:
…ve real acos accuracy. (#2496)
As in the title.
This PR introduces asin_acos_kernel operation that implements modified
Hull et al algorithm for evaluating complex asin, acos, asinh, and acosh
operations. This task corresponds to the refactor request in
#2411 (comment)
and it resolvespearu/functional_algorithms#15.
In addition, the PR also improves the real acos accuracy as a fix to
#2452 . As a result, the
accuracy of single-precision real acos improved as follows (using 1
million samples):
```
main this PR
ULP difference == 0 count is 971713 -> 999045
ULP difference == 1 count is 28158 -> 962
ULP difference == 2 count is 54 -> 0
ULP difference == 3 count is 20 -> 0
ULP difference >= 4 count is 62 -> 0
```
The cause of the revert by PR
#2449 (`acos(-1) -> 0` while
expecting `pi`) is fixed in functional_algorithms which now also
generates extra samples that correspond to limiting values of real acos.
For instance, `acos(-1)->pi`, `acos(nextafter(-1, -inf))->nan`, and
`acos(nextafter(-1, int)-> approx pi` are now included in the tests.
The required functional_algorithms version is now 0.9 which includes a
fix to `fa.utils.real_samples` to return samples that are distributed
uniformly with respect to ULP differences of neighboring samples. This
fix lead to updates of `stablehlo/tests/math/*.mlir`.
What happened?
An initial fix was made for accuracy but was reverted due to a bug in the pattern generator:
#2449
This ticket tracks fixing that work and submitting a more accurate decomposition for acos op.
Steps to reproduce your issue
No response
Version information
No response
The text was updated successfully, but these errors were encountered: