Skip to content

Commit

Permalink
reduce test time for rounding and floatfuncs (#51305)
Browse files Browse the repository at this point in the history
These test were taking on the order of 5 minutes and 10-100s of GB, but
they really did not need to.

(cherry picked from commit bab20f4)
  • Loading branch information
vtjnash authored and nalimilan committed Nov 5, 2023
1 parent 697a178 commit e476d04
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ end
end

@testset "literal pow matches runtime pow matches optimized pow" begin
two = 2
@test 1.0000000105367122^2 == 1.0000000105367122^two
@test 1.0041504f0^2 == 1.0041504f0^two
let two = 2
@test 1.0000000105367122^2 == 1.0000000105367122^two
@test 1.0041504f0^2 == 1.0041504f0^two
end

function g2(start, two, N)
x = start
Expand Down Expand Up @@ -192,11 +193,13 @@ end
finv(x) = f(x, -1)
f2(x) = f(x, 2)
f3(x) = f(x, 3)
x = 1.0000000105367122
@test x^2 == f(x, 2) == f2(x) == x*x == Float64(big(x)*big(x))
@test x^3 == f(x, 3) == f3(x) == x*x*x == Float64(big(x)*big(x)*big(x))
x = 1.000000007393669
@test x^-1 == f(x, -1) == finv(x) == 1/x == inv(x) == Float64(1/big(x)) == Float64(inv(big(x)))
let x = 1.0000000105367122
@test x^2 == f(x, 2) == f2(x) == x*x == Float64(big(x)*big(x))
@test x^3 == f(x, 3) == f3(x) == x*x*x == Float64(big(x)*big(x)*big(x))
end
let x = 1.000000007393669
@test x^-1 == f(x, -1) == finv(x) == 1/x == inv(x) == Float64(1/big(x)) == Float64(inv(big(x)))
end
end

@testset "curried approximation" begin
Expand Down

0 comments on commit e476d04

Please sign in to comment.