diff --git a/Project.toml b/Project.toml index 6480015..6592da9 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Roots" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.1.7" +version = "2.1.8" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" diff --git a/src/Bracketing/chandrapatlu.jl b/src/Bracketing/chandrapatlu.jl index 0c0d05f..c506396 100644 --- a/src/Bracketing/chandrapatlu.jl +++ b/src/Bracketing/chandrapatlu.jl @@ -24,6 +24,7 @@ end # a = most recent, b prior function init_state(::Chandrapatla, F, x₀, x₁, fx₀, fx₁) a, b, fa, fb = x₁, x₀, fx₁, fx₀ + assert_bracket(fa, fb) c, fc = a, fa ChandrapatlaState(promote(a, b, c)..., promote(fa, fb, fc)...) end diff --git a/test/test_bracketing.jl b/test/test_bracketing.jl index d9b8af8..c4b7dc2 100644 --- a/test/test_bracketing.jl +++ b/test/test_bracketing.jl @@ -313,9 +313,9 @@ end @test avg(cnts) <= 3000 ## issue 412 check for bracket - f = x -> x - 1 for M in Ms - @test_throws ArgumentError find_zero(f, (-3, 0), M) + @test_throws ArgumentError find_zero(x -> x - 1, (-3, 0), M) + @test_throws ArgumentError find_zero(x -> 1 + x^2, (10, 20), M) end end