Skip to content

Commit

Permalink
Try always testing for less than or equal to 2 ulps
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Aug 31, 2021
1 parent 9a58e21 commit 27d839e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,15 @@
@test vpowf!(r1, x, x) (r2 .= x .^ x)
@test vpow!(r1, x, Val(0.75)) (r2 .= x .^ 0.75)
@test vpow!(r1, x, Val(2/3)) (r2 .= x .^ (2/3))
vpow!(r1, x, Val(0.5)); r2 .= sqrt.(x)
if Bool(!LoopVectorization.VectorizationBase.has_feature(Val(:x86_64_avx2)))
vpow!(r1, x, Val(0.5)); r2 .= Base.sqrt_llvm.(x)
# if Bool(!LoopVectorization.VectorizationBase.has_feature(Val(:x86_64_avx2)))
for i eachindex(x)
@test abs(r1[i] - r2[i]) eps(r1[i])
# @test abs(r1[i] - r2[i]) ≤ eps(r1[i])
@test abs(r1[i] - r2[i]) 2eps(r1[i])
end
else
@test r1 == r2
end
# else
# @test r1 == r2
# end
@test vpow!(r1, x, Val(1/4)) (r2 .= x .^ (1/4))
@test vpow!(r1, x, Val(4.5)) (r2 .= x .^ 4.5)

Expand Down

0 comments on commit 27d839e

Please sign in to comment.