Commit 51028d9
authored
Add StableHLO complex exponential to stablehlo-complex-math-expander pass (#2682)
As in the title. This PR is created on top of the branch of
#2681.
This PR improves the accuracy of JAX complex exp function as follows:
```
Before
------
test_unary[exp-jax-cpu-complex64-default] maximal ULP difference: 4294967296
ULP difference == 0: 1964868
ULP difference == 1: 133291
ULP difference == 2: 1035
ULP difference == 4294967296: 1606
test_unary[exp-jax-cuda-complex64-default] maximal ULP difference: 4294967296
ULP difference == 0: 1787925
ULP difference == 1: 300591
ULP difference == 2: 10657
ULP difference == 3: 79
ULP difference == 4294967296: 1548
After
-----
test_unary[exp-jax-cpu-complex64-default] maximal ULP difference: 2
ULP difference == 0: 1966101
ULP difference == 1: 133662
ULP difference == 2: 1037
test_unary[exp-jax-cuda-complex64-default] maximal ULP difference: 3
ULP difference == 0: 1788889
ULP difference == 1: 301112
ULP difference == 2: 10720
ULP difference == 3: 79
```
The corresponding accuracy patterns are available in
pearu/functional_algorithms#44 (comment)1 parent f67c73d commit 51028d9
File tree
8 files changed
+146
-2
lines changed- build_tools/math
- stablehlo
- tests/math
- transforms
8 files changed
+146
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
71 | 75 | | |
72 | 76 | | |
73 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments