Skip to content

Commit

Permalink
Bump VectorizationBase requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed May 9, 2021
1 parent f289ad1 commit eb49d4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"

[compat]
IfElse = "0.1"
VectorizationBase = "0.19.22"
VectorizationBase = "0.19.37"
julia = "1.5"

[extras]
Expand Down
34 changes: 2 additions & 32 deletions src/misc.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

"""
pow(x, y)
Expand All @@ -9,12 +8,12 @@ Exponentiation operator, returns `x` raised to the power `y`.
yi = unsafe_trunc(fpinttype(T), y)
yisint = yi == y
yisodd = isodd(yi) & yisint

absx = abs(x)
logkx = logk(absx)

logkxy = dmul(logkx, y)
result = expk(logkxy)

result = ifelse(isnan(result), V(Inf), result)
result = ifelse(x > 0, result, ifelse(~yisint, V(NaN), ifelse(yisodd, -result, result)))

Expand All @@ -29,33 +28,6 @@ Exponentiation operator, returns `x` raised to the power `y`.

end
@inline pow_fast(x, y) = exp2(y*log2(x))
# @inline function pow_fast(x::V, y::V) where {V <: FloatType}
# T = eltype(x)
# yi = unsafe_trunc(fpinttype(T), y)
# yisint = yi == y
# yisodd = isodd(yi) & yisint

# absx = abs(x)
# logkx = logk(absx)
# logkxy = dmul(logkx, y)
# result = expk(logkxy)

# # result = ifelse(isnan(result), V(Inf), result)
# # result = ifelse(x > 0, result, ifelse(~yisint, V(NaN), ifelse(yisodd, -result, result)))

# # efx = flipsign(abs(x) - 1, y)
# # result = ifelse(isinf(y), ifelse(efx < 0, V(0.0), ifelse(efx == 0, V(1.0), V(Inf))), result)
# # result = ifelse(isinf(x) | (x == 0), ifelse(yisodd, _sign(x), V(1.0)) * ifelse(ifelse(x == 0, -y, y) < 0, V(0.0), V(Inf)), result)
# # result = ifelse(isnan(x) | isnan(y), V(NaN), result)
# # result = ifelse((y == 0) | (x == 1), V(1.0), result)

# return result

# end






@inline function cbrt_kernel(x::FloatType64)
Expand Down Expand Up @@ -181,5 +153,3 @@ Compute the hypotenuse `\\sqrt{x^2+y^2}` avoiding overflow and underflow.
r = ifelse(x == 0, y, y / x)
x * sqrt(T(1.0) + r * r)
end


4 changes: 2 additions & 2 deletions src/priv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ end
(float2integer(d) & I(exponent_raw_max(T))) - I(exponent_bias(T))
end

@inline function atan2k_fast_kernel(x::FloatType64)
@inline function atan2k_fast_kernel(x::FloatType64)
c20d = 1.06298484191448746607415e-05
c19d = -0.000125620649967286867384336
c18d = 0.00070557664296393412389774
Expand Down Expand Up @@ -412,6 +412,7 @@ end
@inline function logk(d::V) where (V <: FloatType)
T = eltype(d)
m, e = splitfloat(d)

x = ddiv(dsub2(m, T(1.0)), dadd2(T(1.0), m))

x2 = dsqu(x)
Expand All @@ -423,4 +424,3 @@ end
s = dadd(s, dmul(dmul(x2, x), t))
return s
end

2 comments on commit eb49d4f

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/36363

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.17 -m "<description of version>" eb49d4febf1994554e17ffb58cb176f55fb5fb78
git push origin v0.6.17

Please sign in to comment.