Skip to content
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
6 changes: 2 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@ repo = "https://github.com/JuliaMath/DoubleFloats.jl.git"
version = "1.5.5"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Quadmath = "be4d8f0f-7fa4-5f49-b795-2f01399ab2dd"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

[compat]
Polynomials = "1, 2, 3, 4, 5, 6"
GenericLinearAlgebra = "0.2.5, 0.3, 0.4, 0.5, 0.6"
Quadmath = "0.5.10, 0.6, 0.7, 0.8"
Requires = "1"
SpecialFunctions = "1.0, 1.1, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5"
GenericLinearAlgebra = "0.2.5, 0.3, 0.4, 0.5, 0.6"
julia = "1.6"

[extras]
Expand Down
4 changes: 1 addition & 3 deletions src/DoubleFloats.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ using Printf
using Random
import Random: rand, randn

using Polynomials

using LinearAlgebra
import LinearAlgebra: norm, mul!

Expand All @@ -51,7 +49,7 @@ import Quadmath

import Base: hash, promote_type, promote_rule, convert,
string, show, parse, tryparse, eltype,
signbit, sign, abs, flipsign, copysign,
signbit, sign, abs, hypot,
significand, exponent, precision, widen,
(+), (-), (*), (/), (\), (^), inv, sqrt, cbrt,
(==), (!=), (<), (<=), (>=), (>), isequal, isless,
Expand Down
40 changes: 0 additions & 40 deletions src/math/arithmetic/complex/division.jl

This file was deleted.

37 changes: 0 additions & 37 deletions src/math/arithmetic/fma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,40 +72,3 @@ end
@inline function fma(x::Tuple{T,T}, y::Tuple{T,T}, z::Tuple{T,T}) where {T<:IEEEFloat}
return fma(x[1], x[2], y[1], y[2], z[1], z[2])
end

#@inline muladd(xhi::T, xlo::T, yhi::T, ylo::T, zhi::T, zlo::T) where {T<:IEEEFloat} = fma(xhi, xlo, yhi, ylo, zhi, zlo)

@inline function muladd(x::DoubleFloat{T}, y::DoubleFloat{T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
return x*y + z
end

@inline function muladd(x::T, y::T, z::DoubleFloat{T}) where {T<:IEEEFloat}
return DoubleFloat{T}(x)*y + z
end

@inline function muladd(x::DoubleFloat{T}, y::DoubleFloat{T}, z::T) where {T<:IEEEFloat}
return x*y + z
end
#=
@inline function muladd(x::DoubleFloat{T}, y::DoubleFloat{T}, z::Tuple{T,T}) where {T<:IEEEFloat}
return muladd(x.hi, x.lo, y.hi, y.lo, z[1], z[2])
end
@inline function muladd(x::DoubleFloat{T}, y::Tuple{T,T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
return muladd(x.hi, x.lo, y[1], y[2], z.hi, z.lo)
end
@inline function muladd(x::Tuple{T,T}, y::DoubleFloat{T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
return muladd(x[1], x[2], y.hi, y.lo, z.hi, z.lo)
end
@inline function muladd(x::DoubleFloat{T}, y::Tuple{T,T}, z::Tuple{T,T}) where {T<:IEEEFloat}
return muladd(x.hi, x.lo, y[1], y[2], z[1], z[2])
end
@inline function muladd(x::Tuple{T,T}, y::Tuple{T,T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
return muladd(x[1], x[2], y[1], y[2], z.hi, z.lo)
end
@inline function muladd(x::Tuple{T,T}, y::DoubleFloat{T}, z::Tuple{T,T}) where {T<:IEEEFloat}
return muladd(x[1], x[2], y.hi, y.lo, z[1], z[2])
end
@inline function muladd(x::Tuple{T,T}, y::Tuple{T,T}, z::Tuple{T,T}) where {T<:IEEEFloat}
return muladd(x[1], x[2], y[1], y[2], z[1], z[2])
end
=#
81 changes: 0 additions & 81 deletions src/math/elementary/arctrig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,84 +9,3 @@ end
atan(y::Double64, x::Double64) = Double64(atan(Quadmath.Float128(y), Quadmath.Float128(x)))
atan(y::Double32, x::Double32) = Double32(atan(Quadmath.Float128(y), Quadmath.Float128(x)))
atan(y::Double16, x::Double16) = Double16(atan(Quadmath.Float128(y), Quadmath.Float128(x)))

#=
const k_pio2 = Double64(1.5707963267948966, 6.123233995736766e-17)


function atan(x::DoubleFloat{T}) where {T<:IEEEFloat}
signbit(x) && return -atan(abs(x))
isinf(x) && return copysign(DoubleFloat{T}(pi)/2, x)
iszero(x) && return x
y = DoubleFloat{T}(atan(x.hi))
s, c = sin(y), cos(y)
c2 = square(c)
t = s/c
z = y - (t - x)*c2 # z - (tan(x)-x)*(cos(x)^2)
s, c = sin(z), cos(z)
t = s/c
z = z - (t - x)*c2 # z - (tan(x)-x)*(cos(x)^2)
return z
end

function atan(y::DoubleFloat{T}, x::DoubleFloat{T}) where {T<:IEEEFloat}
iszero(y) && iszero(x) && return x
iszero(x) && return copysign(pi1o2(DoubleFloat{T}), y)
iszero(y) && return signbit(x) ? pi1o1(DoubleFloat{T}) : zero(DoubleFloat{T})
atanyx = atan(y/x)
if x > 0
atanyx
elseif x < 0
if y >= 0
atanyx + T(pi)
else
atanyx - T(pi)
end
elseif y > 0
T(pi)/2
elseif y < 0
-T(pi)/2
else
zero(T)
end
end

function asin(x::DoubleFloat{T}) where {T<:IEEEFloat}
(abs(x) > 1.0 || isinf(x)) && throw(DomainError("$x"))
signbit(x) && return -asin(abs(x))
y = x
y = y / (1.0 + sqrt(1.0 - square(y)))
z = atan(y)
return DoubleFloat{T}(z.hi+z.hi, z.lo+z.lo)
end

function acos(x::DoubleFloat{T}) where {T<:IEEEFloat}
(abs(x) > 1.0 || isinf(x)) && throw(DomainError("$x"))
signbit(x) && return DoubleFloat{T}(onepi - acos(abs(x)))
y = x
y = sqrt(1.0 - square(y)) / (1.0 + y)
z = atan(y)
return DoubleFloat{T}(z.hi+z.hi, z.lo+z.lo)
end

function acsc(x::DoubleFloat{T}) where {T<:IEEEFloat}
isinf(x) && return copysign(zero(DoubleFloat{T}), x)
return asin(inv(x))
end

function asec(x::DoubleFloat{T}) where {T<:IEEEFloat}
isinf(x) && return DoubleFloat{T}(halfpi)
return acos(inv(x))
end

function acot(x::DoubleFloat{T}) where {T<:IEEEFloat}
isinf(x) && return copysign(zero(DoubleFloat{T}), x)
signbit(x) && return DoubleFloat{T}(onepi - acot(abs(x)))
iszero(x) && return k_pio2
z = k_pio2 - atan(abs(x))
if signbit(x.hi)
z = -z
end
return z
end
=#
4 changes: 0 additions & 4 deletions src/math/elementary/complex.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@inline function reim(x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat}
return x.re, x.im
end

@inline function csgn(r,i)
HI(r) > 0 && return 1
HI(r) < 0 && return -1
Expand Down
15 changes: 0 additions & 15 deletions src/math/elementary/explog.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,6 @@ function mul_by_two(r::DoubleFloat{T}) where {T<:IEEEFloat}
return DoubleFloat{T}(hi, lo)
end

function mul_pow2(r::DoubleFloat{T}, n::Int) where {T<:IEEEFloat}
frhi, xphi = frexp(HI(r))
frlo, xplo = frexp(LO(r))
xphi += n
xplo += n
hi = ldexp(frhi, xphi)
lo = ldexp(frlo, xplo)
return DoubleFloat{T}(hi, lo)
end

function mul_pwr2(r::DoubleFloat{T}, n::Real) where {T<:IEEEFloat}
m = 2.0^n
return DoubleFloat{T}(HI(r)*m, LO(r)*m)
end

function Base.:(^)(r::DoubleFloat{T}, n::Int) where {T<:IEEEFloat}
if (n == 0)
return one(DoubleFloat{T})
Expand Down
11 changes: 0 additions & 11 deletions src/math/elementary/hyptrig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ function tanh(x::DoubleFloat{T}) where {T<:IEEEFloat}
abs(HI(x)) > maxhyp_fp64max && return copysign(one(DoubleFloat{T}), x)
return sinh(x) / cosh(x)
end
#=
function tanh(x::DoubleFloat{T}) where {T<:IEEEFloat}
x < 0 && return -tanh(-x)
iszero(x) && return zero(x)
!isfinite(x) && return nan(typeof(x))
epos = exp(x)
eneg = exp(-x)
z = (epos - eneg) / (epos + eneg)
return z
end
=#

function csch(x::DoubleFloat{T}) where {T<:IEEEFloat}
abs(HI(x)) > maxhyp_fp64max && return copysign(zero(DoubleFloat{T}), x)
Expand Down
Loading
Loading