Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add complex arctan #24

Closed
pearu opened this issue Aug 21, 2024 · 2 comments · Fixed by #25
Closed

Add complex arctan #24

pearu opened this issue Aug 21, 2024 · 2 comments · Fixed by #25

Comments

@pearu
Copy link
Owner

pearu commented Aug 21, 2024

Per https://github.com/pearu/complex_function_validation/tree/main/mpmath_jax_results_dev, JAX arctan accuracy is validated as BAD.

@pearu
Copy link
Owner Author

pearu commented Aug 28, 2024

ULP difference statistics of previous implementations in StableHLO:

../stablehlo/tests/math/atan_complex128.mlir
ULP difference == 0 count is 1222
ULP difference == 1 count is 1476
ULP difference == 2 count is 12
ULP difference == 3 count is 6
ULP difference >= 4 count is 999285
../stablehlo/tests/math/atan_complex64.mlir
ULP difference == 0 count is 3326
ULP difference == 1 count is 6970
ULP difference == 2 count is 3384
ULP difference == 3 count is 3418
ULP difference >= 4 count is 984903
../stablehlo/tests/math/atan_float32.mlir
../stablehlo/tests/math/atan_float64.mlir
../stablehlo/tests/math/atanh_complex128.mlir
ULP difference == 0 count is 239712
ULP difference == 1 count is 2853
ULP difference == 2 count is 616
ULP difference == 3 count is 8
ULP difference >= 4 count is 758816
../stablehlo/tests/math/atanh_complex64.mlir
ULP difference == 0 count is 257275
ULP difference == 1 count is 24034
ULP difference == 2 count is 1280
ULP difference == 3 count is 2903
ULP difference >= 4 count is 716513
../stablehlo/tests/math/atanh_float32.mlir
ULP difference == 0 count is 987391
ULP difference == 1 count is 12610
ULP difference == 2 count is 0
ULP difference == 3 count is 0
ULP difference >= 4 count is 0
../stablehlo/tests/math/atanh_float64.mlir
ULP difference == 0 count is 996685
ULP difference == 1 count is 3316
ULP difference == 2 count is 0
ULP difference == 3 count is 0
ULP difference >= 4 count is 0

@pearu
Copy link
Owner Author

pearu commented Aug 28, 2024

After using algorithms defined in FA:

../stablehlo/tests/math/atan_complex128.mlir
ULP difference == 0 count is 941281
ULP difference == 1 count is 60320
ULP difference == 2 count is 400
ULP difference == 3 count is 0
ULP difference >= 4 count is 0
../stablehlo/tests/math/atan_complex64.mlir
ULP difference == 0 count is 868953
ULP difference == 1 count is 130204
ULP difference == 2 count is 2832
ULP difference == 3 count is 12
ULP difference >= 4 count is 0
../stablehlo/tests/math/atan_float32.mlir
../stablehlo/tests/math/atan_float64.mlir
../stablehlo/tests/math/atanh_complex128.mlir
ULP difference == 0 count is 941283
ULP difference == 1 count is 60322
ULP difference == 2 count is 400
ULP difference == 3 count is 0
ULP difference >= 4 count is 0
../stablehlo/tests/math/atanh_complex64.mlir
ULP difference == 0 count is 868955
ULP difference == 1 count is 130206
ULP difference == 2 count is 2832
ULP difference == 3 count is 12
ULP difference >= 4 count is 0
../stablehlo/tests/math/atanh_float32.mlir
ULP difference == 0 count is 987391
ULP difference == 1 count is 12610
ULP difference == 2 count is 0
ULP difference == 3 count is 0
ULP difference >= 4 count is 0
../stablehlo/tests/math/atanh_float64.mlir
ULP difference == 0 count is 996685
ULP difference == 1 count is 3316
ULP difference == 2 count is 0
ULP difference == 3 count is 0
ULP difference >= 4 count is 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant