Skip to content

Commit

Permalink
Revert tan to use previous find_quadrants
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders committed Apr 11, 2018
1 parent 564d060 commit 776e419
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/intervals/trigonometric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,19 @@ function cos(a::Interval{T}) where T
end
end

function find_quadrants_tan(x::T) where {T}
temp = atomic(Interval{T}, x) / half_pi(x)

return SVector(floor(temp.lo), floor(temp.hi))
end

function tan(a::Interval{T}) where T
isempty(a) && return a

diam(a) > pi_interval(T).lo && return entireinterval(a)

lo_quadrant = minimum(find_quadrants(a.lo))
hi_quadrant = maximum(find_quadrants(a.hi))
lo_quadrant = minimum(find_quadrants_tan(a.lo))
hi_quadrant = maximum(find_quadrants_tan(a.hi))

lo_quadrant_mod = mod(lo_quadrant, 2)
hi_quadrant_mod = mod(hi_quadrant, 2)
Expand Down

0 comments on commit 776e419

Please sign in to comment.