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

Fix decoration for atan with two arguments #672

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

OlivierHnt
Copy link
Member

@OlivierHnt OlivierHnt commented Jun 21, 2024

This PR changes the decoration returned by atan(y, x) whenever inf(y) >= 0 and y contains 0 and sup(x) <= 0.

N.B.: atan is a discontinuous function at the half-line y = 0, x < 0, which is included in its domain.

Before this PR

julia> atan(interval(0), interval(-2, -1))
[3.14159, 3.1416]_dac

which I believe is wrong since both input intervals and output intervals are bounded.

So, with this PR

julia> atan(interval(0), interval(-2, -1))
[3.14159, 3.1416]_com

Moreover, there is a test in the ITF1788 which actually depends on this choice of decoration:

@test atan(interval(bareinterval(-0.0, 1.0), com), interval(bareinterval(-2.0, -0.1), com)) === interval(bareinterval(0x1.ABA397C7259DDP+0, 0x1.921FB54442D19P+1), dac)

which I think is wrong (for me the decoration should be com and not dac). I changed this test to

@warn "The original test `atan2 [-0.0, 1.0]_com [-2.0, -0.1]_com = [0X1.ABA397C7259DDP+0, 0X1.921FB54442D19P+1]_dac` is wrong and has been modified. The result should have the decoration `com`"
@test atan(interval(bareinterval(-0.0, 1.0), com), interval(bareinterval(-2.0, -0.1), com)) === interval(bareinterval(0x1.ABA397C7259DDP+0, 0x1.921FB54442D19P+1), com)

@OlivierHnt OlivierHnt merged commit 16dcd3b into JuliaIntervals:master Jul 2, 2024
16 checks passed
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 this pull request may close these issues.

1 participant