Skip to content

Commit

Permalink
Add tests for _quadrant involving worst Float64 cases
Browse files Browse the repository at this point in the history
  • Loading branch information
lbenet committed Mar 10, 2024
1 parent f2742ed commit 3b212a9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/interval_tests/trigonometric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,16 @@ end
@test isequal_interval(sin(x), interval(-1, 1))
@test isequal_interval(cos(x), interval(-1, 1))
@test isequal_interval(tan(x), interval(-Inf, Inf))

setprecision(100) do
y = 6381956970095103 * 2.0^797 # worst case for C = pi/2 for Float64
yb = 6381956970095103 * big(2.0)^797
@test_throws AssertionError IntervalArithmetic._quadrant(y) == IntervalArithmetic._quadrant(yb)
end
setprecision(1000) do
y = 6381956970095103 * 2.0^797 # worst case for C = pi/2 for Float64
yb = 6381956970095103 * big(2.0)^797
@test IntervalArithmetic._quadrant(y) == IntervalArithmetic._quadrant(yb)
end

end

0 comments on commit 3b212a9

Please sign in to comment.