Skip to content

Commit

Permalink
Uninline trig functions. (#24117)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod authored and KristofferC committed Oct 24, 2017
1 parent e5581a5 commit 9f5ec71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/special/trig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end
# Trigonometric functions
# sin methods
@noinline sin_domain_error(x) = throw(DomainError(x, "sin(x) is only defined for finite x."))
@inline function sin(x::T) where T<:Union{Float32, Float64}
function sin(x::T) where T<:Union{Float32, Float64}
absx = abs(x)
if absx < T(pi)/4 #|x| ~<= pi/4, no need for reduction
if absx < sqrt(eps(T))
Expand Down Expand Up @@ -95,7 +95,7 @@ end

# cos methods
@noinline cos_domain_error(x) = throw(DomainError(x, "cos(x) is only defined for finite x."))
@inline function cos(x::T) where T<:Union{Float32, Float64}
function cos(x::T) where T<:Union{Float32, Float64}
absx = abs(x)
if absx < T(pi)/4
if absx < sqrt(eps(T)/T(2.0))
Expand Down Expand Up @@ -169,7 +169,7 @@ end
Simultaneously compute the sine and cosine of `x`, where the `x` is in radians.
"""
@inline function sincos(x::T) where T<:Union{Float32, Float64}
function sincos(x::T) where T<:Union{Float32, Float64}
if abs(x) < T(pi)/4
if x == zero(T)
return x, one(T)
Expand Down

0 comments on commit 9f5ec71

Please sign in to comment.