Skip to content

Commit

Permalink
Format .jl files [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
jverzani authored and github-actions[bot] committed Jan 12, 2025
1 parent 65b481f commit 8f9ea37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ function assess_convergence(M::Any, state::AbstractUnivariateZeroState, options)
return (:not_converged, false)
end

function assess_convergence(M::AbstractBisection, state::AbstractUnivariateZeroState, options::O) where {O <: Union{ExactOptions, XExactOptions}}
function assess_convergence(
M::AbstractBisection,
state::AbstractUnivariateZeroState,
options::O,
) where {O<:Union{ExactOptions,XExactOptions}}
# return convergence_flag, boolean
# no check if f == ∞
is_exact_zero_f(M, state, options) && return (:exact_zero, true)
Expand All @@ -288,7 +292,6 @@ function assess_convergence(M::AbstractBisection, state::AbstractUnivariateZeroS
return (:not_converged, false)
end


# speeds up exact f values by just a bit (2% or so) over the above, so guess this is worth it.
function assess_convergence(
M::AbstractBracketingMethod,
Expand Down
10 changes: 5 additions & 5 deletions test/test_find_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,9 @@ end
@testset "bracketing_atol" begin
## issue $457
f(x) = x^2 - 4
@test find_zero(f, (0,Inf)) 2 # 2.0 correct
@test find_zero(f, (0,Inf), atol=1) 1.9997558593749998
@test find_zero(f, (0,Inf),atol=1e-5) 1.9999998807907102
@test find_zero(f, (0,8), atol=1) 1.99609375
@test find_zero(f, (0,8), atol=1e-3) 2.0000152587890625
@test find_zero(f, (0, Inf)) 2 # 2.0 correct
@test find_zero(f, (0, Inf), atol=1) 1.9997558593749998
@test find_zero(f, (0, Inf), atol=1e-5) 1.9999998807907102
@test find_zero(f, (0, 8), atol=1) 1.99609375
@test find_zero(f, (0, 8), atol=1e-3) 2.0000152587890625
end

0 comments on commit 8f9ea37

Please sign in to comment.