Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninline trig functions. #24117

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -94,7 +94,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 @@ -167,7 +167,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