From b7b1d03e3930c56ff5dd8fae27ef61fd8bfa0aa9 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 10 Apr 2018 11:54:52 -0500 Subject: [PATCH] Fix sin(x::BigFloat) --- src/intervals/trigonometric.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intervals/trigonometric.jl b/src/intervals/trigonometric.jl index c2bc3fa1b..564114c82 100644 --- a/src/intervals/trigonometric.jl +++ b/src/intervals/trigonometric.jl @@ -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) @@ -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))