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

Fix Polynomials deprecation and allow v1 #107

Merged
merged 1 commit into from
May 8, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
[compat]
GenericSVD = "0"
GenericSchur = "0"
Polynomials = "0"
Polynomials = "0.8, 1"
Quadmath = "0"
Requires = "0, 1.0"
SpecialFunctions = "0"
Expand Down
19 changes: 9 additions & 10 deletions src/math/elementary/trig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function tan(x::Double64)
isnan(x) && return x
isinf(x) && throw(DomainError("tan(x) only defined for finite x"))
abs(HI(x)) >= 0.36815538909255385 && return Double64(tan(Float128(x))) # (15/128 * pi)

abs(mod1pi(x-Double64(pi)/2)) <= eps(one(DoubleFloat{Float64})) && return DoubleFloat{Float64}(Inf)
iszero(x) && return zero(typeof(x))
!isfinite(x) && return nan(typeof(x))
Expand Down Expand Up @@ -287,8 +287,8 @@ const tan0qrtrpi_denomcoeffs = [
Double64(1.5859442637424446e-9, 6.30689666197131e-26)
];

const tan0qrtrpi_numerpoly = Poly(tan0qrtrpi_numercoeffs);
const tan0qrtrpi_denompoly = Poly(tan0qrtrpi_denomcoeffs);
const tan0qrtrpi_numerpoly = Polynomial(tan0qrtrpi_numercoeffs);
const tan0qrtrpi_denompoly = Polynomial(tan0qrtrpi_denomcoeffs);

function tan0qrtrpi(x::Double64)
numer = polyval(tan0qrtrpi_numerpoly, x)
Expand All @@ -298,7 +298,7 @@ end


function csc(x::DoubleFloat{T}) where {T<:IEEEFloat}
isnan(x) && return x
isnan(x) && return x
isinf(x) && throw(DomainError("csc(x) only defined for finite x"))
return inv(sin(x))
end
Expand All @@ -320,8 +320,8 @@ function sinpi(x::DoubleFloat{T}) where {T<:IEEEFloat}
isnan(x) && return x
isinf(x) && throw(DomainError("sinpi(x) only defined for finite x"))
return DoubleFloat{T}(sinpi(Quadmath.Float128(x)))
#=
y = Double64(x)
#=
y = Double64(x)
hi,lo = mul322(pi_1o1_t64, HILO(y))
y = Double64(hi, lo)
z = sin(y)
Expand All @@ -333,8 +333,8 @@ function cospi(x::DoubleFloat{T}) where {T<:IEEEFloat}
isnan(x) && return x
isinf(x) && throw(DomainError("cospi(x) only defined for finite x"))
return DoubleFloat{T}(cospi(Quadmath.Float128(x)))
#=
y = Double64(x)
#=
y = Double64(x)
hi,lo = mul322(pi_1o1_t64, HILO(y))
y = Double64(hi, lo)
z = cos(y)
Expand All @@ -347,11 +347,10 @@ function tanpi(x::DoubleFloat{T}) where {T<:IEEEFloat}
isinf(x) && throw(DomainError("tanpi(x) only defined for finite x"))
return sinpi(x)/cospi(x)
#=
y = Double64(x)
y = Double64(x)
hi,lo = mul322(pi_1o1_t64, HILO(y))
y = Double64(hi, lo)
z = tan(y)
return DoubleFloat{T}(z)
=#
end