Skip to content

Commit deaae75

Browse files
committed
add tests of accuracy at high orders
1 parent 2f8efe3 commit deaae75

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/methods.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ using FiniteDifferences: Forward, Backward, Central, Nonstandard
3737
@test central_fdm(5, 1)(abs, 0.001) 1.0
3838
end
3939

40+
@testset "Accuracy at high orders, with high adapt" begin
41+
# Regression test against issues with precision during computation of _coeffs
42+
# see https://github.com/JuliaDiff/FiniteDifferences.jl/issues/64
43+
44+
@test fdm(central_fdm(9, 5), exp, 1.0, adapt=4) exp(1) atol=1e-7
45+
46+
poly(x) = 4x^3 + 3x^2 + 2x + 1
47+
@test fdm(central_fdm(9, 3), poly, 1.0, adapt=4) 24 atol=1e-11
48+
end
49+
50+
4051
@testset "Printing FiniteDifferenceMethods" begin
4152
@test sprint(show, central_fdm(2, 1)) == """
4253
FiniteDifferenceMethod:

0 commit comments

Comments
 (0)