Skip to content

Commit 65a1391

Browse files
Merge pull request #238 from araujoms/deadcode
remove dead code in src/math
2 parents 483568c + bae2843 commit 65a1391

File tree

25 files changed

+5
-1015
lines changed

25 files changed

+5
-1015
lines changed

Project.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@ repo = "https://github.com/JuliaMath/DoubleFloats.jl.git"
77
version = "1.5.6"
88

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

1918
[compat]
20-
Polynomials = "1, 2, 3, 4, 5, 6"
19+
GenericLinearAlgebra = "0.2.5, 0.3, 0.4, 0.5, 0.6"
2120
Quadmath = "0.5.10, 0.6, 0.7, 0.8"
2221
Requires = "1"
2322
SpecialFunctions = "1.0, 1.1, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5"
24-
GenericLinearAlgebra = "0.2.5, 0.3, 0.4, 0.5, 0.6"
2523
julia = "1.6"
2624

2725
[extras]

src/DoubleFloats.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ using Printf
4040
using Random
4141
import Random: rand, randn
4242

43-
using Polynomials
44-
4543
using LinearAlgebra
4644
import LinearAlgebra: norm, mul!
4745

@@ -51,7 +49,7 @@ import Quadmath
5149

5250
import Base: hash, promote_type, promote_rule, convert,
5351
string, show, parse, tryparse, eltype,
54-
signbit, sign, abs, flipsign, copysign,
52+
signbit, sign, abs, hypot,
5553
significand, exponent, precision, widen,
5654
(+), (-), (*), (/), (\), (^), inv, sqrt, cbrt,
5755
(==), (!=), (<), (<=), (>=), (>), isequal, isless,

src/math/arithmetic/complex/division.jl

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/math/arithmetic/fma.jl

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -72,40 +72,3 @@ end
7272
@inline function fma(x::Tuple{T,T}, y::Tuple{T,T}, z::Tuple{T,T}) where {T<:IEEEFloat}
7373
return fma(x[1], x[2], y[1], y[2], z[1], z[2])
7474
end
75-
76-
#@inline muladd(xhi::T, xlo::T, yhi::T, ylo::T, zhi::T, zlo::T) where {T<:IEEEFloat} = fma(xhi, xlo, yhi, ylo, zhi, zlo)
77-
78-
@inline function muladd(x::DoubleFloat{T}, y::DoubleFloat{T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
79-
return x*y + z
80-
end
81-
82-
@inline function muladd(x::T, y::T, z::DoubleFloat{T}) where {T<:IEEEFloat}
83-
return DoubleFloat{T}(x)*y + z
84-
end
85-
86-
@inline function muladd(x::DoubleFloat{T}, y::DoubleFloat{T}, z::T) where {T<:IEEEFloat}
87-
return x*y + z
88-
end
89-
#=
90-
@inline function muladd(x::DoubleFloat{T}, y::DoubleFloat{T}, z::Tuple{T,T}) where {T<:IEEEFloat}
91-
return muladd(x.hi, x.lo, y.hi, y.lo, z[1], z[2])
92-
end
93-
@inline function muladd(x::DoubleFloat{T}, y::Tuple{T,T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
94-
return muladd(x.hi, x.lo, y[1], y[2], z.hi, z.lo)
95-
end
96-
@inline function muladd(x::Tuple{T,T}, y::DoubleFloat{T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
97-
return muladd(x[1], x[2], y.hi, y.lo, z.hi, z.lo)
98-
end
99-
@inline function muladd(x::DoubleFloat{T}, y::Tuple{T,T}, z::Tuple{T,T}) where {T<:IEEEFloat}
100-
return muladd(x.hi, x.lo, y[1], y[2], z[1], z[2])
101-
end
102-
@inline function muladd(x::Tuple{T,T}, y::Tuple{T,T}, z::DoubleFloat{T}) where {T<:IEEEFloat}
103-
return muladd(x[1], x[2], y[1], y[2], z.hi, z.lo)
104-
end
105-
@inline function muladd(x::Tuple{T,T}, y::DoubleFloat{T}, z::Tuple{T,T}) where {T<:IEEEFloat}
106-
return muladd(x[1], x[2], y.hi, y.lo, z[1], z[2])
107-
end
108-
@inline function muladd(x::Tuple{T,T}, y::Tuple{T,T}, z::Tuple{T,T}) where {T<:IEEEFloat}
109-
return muladd(x[1], x[2], y[1], y[2], z[1], z[2])
110-
end
111-
=#

src/math/elementary/arctrig.jl

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -9,84 +9,3 @@ end
99
atan(y::Double64, x::Double64) = Double64(atan(Quadmath.Float128(y), Quadmath.Float128(x)))
1010
atan(y::Double32, x::Double32) = Double32(atan(Quadmath.Float128(y), Quadmath.Float128(x)))
1111
atan(y::Double16, x::Double16) = Double16(atan(Quadmath.Float128(y), Quadmath.Float128(x)))
12-
13-
#=
14-
const k_pio2 = Double64(1.5707963267948966, 6.123233995736766e-17)
15-
16-
17-
function atan(x::DoubleFloat{T}) where {T<:IEEEFloat}
18-
signbit(x) && return -atan(abs(x))
19-
isinf(x) && return copysign(DoubleFloat{T}(pi)/2, x)
20-
iszero(x) && return x
21-
y = DoubleFloat{T}(atan(x.hi))
22-
s, c = sin(y), cos(y)
23-
c2 = square(c)
24-
t = s/c
25-
z = y - (t - x)*c2 # z - (tan(x)-x)*(cos(x)^2)
26-
s, c = sin(z), cos(z)
27-
t = s/c
28-
z = z - (t - x)*c2 # z - (tan(x)-x)*(cos(x)^2)
29-
return z
30-
end
31-
32-
function atan(y::DoubleFloat{T}, x::DoubleFloat{T}) where {T<:IEEEFloat}
33-
iszero(y) && iszero(x) && return x
34-
iszero(x) && return copysign(pi1o2(DoubleFloat{T}), y)
35-
iszero(y) && return signbit(x) ? pi1o1(DoubleFloat{T}) : zero(DoubleFloat{T})
36-
atanyx = atan(y/x)
37-
if x > 0
38-
atanyx
39-
elseif x < 0
40-
if y >= 0
41-
atanyx + T(pi)
42-
else
43-
atanyx - T(pi)
44-
end
45-
elseif y > 0
46-
T(pi)/2
47-
elseif y < 0
48-
-T(pi)/2
49-
else
50-
zero(T)
51-
end
52-
end
53-
54-
function asin(x::DoubleFloat{T}) where {T<:IEEEFloat}
55-
(abs(x) > 1.0 || isinf(x)) && throw(DomainError("$x"))
56-
signbit(x) && return -asin(abs(x))
57-
y = x
58-
y = y / (1.0 + sqrt(1.0 - square(y)))
59-
z = atan(y)
60-
return DoubleFloat{T}(z.hi+z.hi, z.lo+z.lo)
61-
end
62-
63-
function acos(x::DoubleFloat{T}) where {T<:IEEEFloat}
64-
(abs(x) > 1.0 || isinf(x)) && throw(DomainError("$x"))
65-
signbit(x) && return DoubleFloat{T}(onepi - acos(abs(x)))
66-
y = x
67-
y = sqrt(1.0 - square(y)) / (1.0 + y)
68-
z = atan(y)
69-
return DoubleFloat{T}(z.hi+z.hi, z.lo+z.lo)
70-
end
71-
72-
function acsc(x::DoubleFloat{T}) where {T<:IEEEFloat}
73-
isinf(x) && return copysign(zero(DoubleFloat{T}), x)
74-
return asin(inv(x))
75-
end
76-
77-
function asec(x::DoubleFloat{T}) where {T<:IEEEFloat}
78-
isinf(x) && return DoubleFloat{T}(halfpi)
79-
return acos(inv(x))
80-
end
81-
82-
function acot(x::DoubleFloat{T}) where {T<:IEEEFloat}
83-
isinf(x) && return copysign(zero(DoubleFloat{T}), x)
84-
signbit(x) && return DoubleFloat{T}(onepi - acot(abs(x)))
85-
iszero(x) && return k_pio2
86-
z = k_pio2 - atan(abs(x))
87-
if signbit(x.hi)
88-
z = -z
89-
end
90-
return z
91-
end
92-
=#

src/math/elementary/complex.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
@inline function reim(x::Complex{DoubleFloat{T}}) where {T<:IEEEFloat}
2-
return x.re, x.im
3-
end
4-
51
@inline function csgn(r,i)
62
HI(r) > 0 && return 1
73
HI(r) < 0 && return -1

src/math/elementary/explog.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,6 @@ function mul_by_two(r::DoubleFloat{T}) where {T<:IEEEFloat}
7676
return DoubleFloat{T}(hi, lo)
7777
end
7878

79-
function mul_pow2(r::DoubleFloat{T}, n::Int) where {T<:IEEEFloat}
80-
frhi, xphi = frexp(HI(r))
81-
frlo, xplo = frexp(LO(r))
82-
xphi += n
83-
xplo += n
84-
hi = ldexp(frhi, xphi)
85-
lo = ldexp(frlo, xplo)
86-
return DoubleFloat{T}(hi, lo)
87-
end
88-
89-
function mul_pwr2(r::DoubleFloat{T}, n::Real) where {T<:IEEEFloat}
90-
m = 2.0^n
91-
return DoubleFloat{T}(HI(r)*m, LO(r)*m)
92-
end
93-
9479
function Base.:(^)(r::DoubleFloat{T}, n::Int) where {T<:IEEEFloat}
9580
if (n == 0)
9681
return one(DoubleFloat{T})

src/math/elementary/hyptrig.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ function tanh(x::DoubleFloat{T}) where {T<:IEEEFloat}
2828
abs(HI(x)) > maxhyp_fp64max && return copysign(one(DoubleFloat{T}), x)
2929
return sinh(x) / cosh(x)
3030
end
31-
#=
32-
function tanh(x::DoubleFloat{T}) where {T<:IEEEFloat}
33-
x < 0 && return -tanh(-x)
34-
iszero(x) && return zero(x)
35-
!isfinite(x) && return nan(typeof(x))
36-
epos = exp(x)
37-
eneg = exp(-x)
38-
z = (epos - eneg) / (epos + eneg)
39-
return z
40-
end
41-
=#
4231

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

0 commit comments

Comments
 (0)