Skip to content

Commit 869fe79

Browse files
authored
beter convenience methods
1 parent 7600833 commit 869fe79

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/SpecialFunctionAccuracyTests.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ end
6767
countulp(x::T, y::T) where {T <: AbstractFloat} = countulp(T, x, y)
6868
strip_module_name(f::Function) = last(split(string(f), '.')) # strip module name from function f
6969

70-
function test_acc(fun_table, xx, tol; debug = true, tol_debug = 5)
70+
function test_acc(fun_table::Dict, xx; tol=1.5, debug = true, tol_debug = 5)
7171
@testset "accuracy $(strip_module_name(xfun))" for (xfun, fun) in fun_table
7272
rmax = 0.0
7373
rmean = 0.0
@@ -95,5 +95,6 @@ function test_acc(fun_table, xx, tol; debug = true, tol_debug = 5)
9595
t = @test rmax <= tol
9696
end
9797
end
98-
test_acc(fun_table, xx, tol; debug = true, tol_debug = 5) = test_acc(eltype(xx), fun_table, xx, 1.5; debug = true, tol_debug = 5)
99-
test_acc(fun_table, xx; debug = true, tol_debug = 5) = test_acc(fun_table, xx, 1.5; debug = true, tol_debug = 5)
98+
test_acc(fun_table::Dict, xx; tol = 1.5, debug = true, tol_debug = 5) = test_acc(eltype(xx), fun_table, xx; tol = 1.5 debug = true, tol_debug = 5)
99+
test_acc(f::Function, xx; tol = 1.5 debug = true, tol_debug = 5) = test_acc(Dict(f=>f), xx; tol = 1.5 debug = true, tol_debug = 5)
100+
test_acc(f::Function, min, max; tol = 1.5 debug = true, tol_debug = 5) = test_acc(Dict(f=>f), FloatIterator(min,max); tol = 1.5 debug = true, tol_debug = 5)

0 commit comments

Comments
 (0)