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

Reliable quadrant #652

Merged
merged 1 commit into from
May 27, 2024
Merged

Reliable quadrant #652

merged 1 commit into from
May 27, 2024

Conversation

OlivierHnt
Copy link
Member

This PR implements a reliable code to determine quadrants for trigonometric functions.

@dpsanders do you mind having a look?

Closes #622

@@ -65,8 +68,8 @@ function Base.sin(x::BareInterval{T}) where {T<:AbstractFloat}

lo, hi = bounds(x)

lo_quadrant = _quadrant(lo)
hi_quadrant = _quadrant(hi)
lo_quadrant = _quadrant(min, lo)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the min and max here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_quadrant may return two distinct integers. What min/max aims to do is to "overshoot" the quadrants: for the lowest (resp. largest) value of the interval, we want the smallest (resp. largest) quadrant.

Copy link
Member

@dpsanders dpsanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as far as I can tell, thanks!

@OlivierHnt OlivierHnt merged commit bb79e22 into JuliaIntervals:master May 27, 2024
16 checks passed
@OlivierHnt OlivierHnt deleted the quadrant branch May 27, 2024 20:37
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.

Finding quadrants is flawed
2 participants