Skip to content

Commit

Permalink
Fix sin(x::BigFloat)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders committed Apr 10, 2018
1 parent bb2e363 commit b7b1d03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/intervals/trigonometric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For efficiency, does not check that the constant is positive.
"""
multiply_by_positive_constant(α, x::Interval) = @round*x.lo, α*x.hi)

half_pi(::Type{Float64}) where {T} = multiply_by_positive_constant(0.5, pi_interval(T))
half_pi(::Type{Float64}) = multiply_by_positive_constant(0.5, pi_interval(Float64))
half_pi(::Type{T}) where {T} = 0.5 * pi_interval(T)
half_pi(x::T) where {T<:AbstractFloat} = half_pi(T)

Expand Down Expand Up @@ -50,6 +50,8 @@ function sin(a::Interval{T}) where T

diam(a) > two_pi(T).lo && return whole_range

# The following is equiavlent to doing temp = a / half_pi and
# taking floor(a.lo), floor(a.hi)
lo_quadrant = minimum(find_quadrants(a.lo))
hi_quadrant = maximum(find_quadrants(a.hi))

Expand Down

0 comments on commit b7b1d03

Please sign in to comment.