Skip to content

Commit

Permalink
Format .jl files [skip ci] (#456)
Browse files Browse the repository at this point in the history
Co-authored-by: jverzani <[email protected]>
  • Loading branch information
github-actions[bot] and jverzani authored Jan 5, 2025
1 parent 95da1f5 commit 5cce567
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/Bracketing/alefeld_potra_shi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ function update_state(
options,
l=NullTracks(),
) where {T,S}

atol, rtol = options.xabstol, options.xreltol
μ, λ = oftype(rtol, 0.5), oftype(rtol, 0.7)
tols = (; λ=λ, atol=atol, rtol=rtol)
Expand Down Expand Up @@ -145,10 +144,11 @@ function update_state(

ā, b̄, d, fā, fb̄, fd = bracket(a, b, x, fa, fb, fx)


if ((b̄ - ā) <= tolₑ(ā, b̄, fā, fb̄, atol, rtol) ||
if (
(b̄ - ā) <= tolₑ(ā, b̄, fā, fb̄, atol, rtol) ||
iszero(fx) || # exact zero
!isbracket(fā,fb̄)) # catch non bracket?, issue #453
!isbracket(fā, fb̄)
) # catch non bracket?, issue #453
@reset o.xn0 =
@reset o.xn1 =
@reset o.fxn0 = fā
Expand Down
11 changes: 5 additions & 6 deletions test/test_composable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,15 @@ using Measurements
@test h(α) h+ 0.1)
@test h(α) h- 0.1)


# Measurements # issue #453
@testset "Measurements.jl" begin
a = measurement(1.0 , 0.1)
b = measurement(-3.0 , 0.1)
a = measurement(1.0, 0.1)
b = measurement(-3.0, 0.1)
c = measurement(-10.0, 0.1)
f(x) = a*x^2 + b*x + c
f(x) = a * x^2 + b * x + c
x₀ = (measurement(-3.0, 0.1), measurement(0.0, 0.1))
for M (A42(), AlefeldPotraShi(), Bisection())
@test find_zero(f,x₀, M) -2.0
for M in (A42(), AlefeldPotraShi(), Bisection())
@test find_zero(f, x₀, M) -2.0
end
@test find_zero(f, measurement(0.0, 0.1)) -2.0
end
Expand Down

0 comments on commit 5cce567

Please sign in to comment.