Skip to content

Commit aa3eaa6

Browse files
author
Oscar Smith
authored
minor itp speedups (#547)
1 parent 5e83e35 commit aa3eaa6

File tree

1 file changed

+3
-3
lines changed
  • lib/BracketingNonlinearSolve/src

1 file changed

+3
-3
lines changed

lib/BracketingNonlinearSolve/src/itp.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ function CommonSolve.solve(
9595
k2 = alg.k2
9696
k1 = alg.scaled_k1 * abs(right - left)^(1 - k2)
9797
n0 = alg.n0
98-
n_h = ceil(log2(abs(right - left) / (2 * ϵ)))
9998
mid = (left + right) / 2
10099
x_f = left + (right - left) * (fl / (fl - fr))
101100
xt = left
102101
xp = left
103102
r = zero(left) # minmax radius
104103
δ = zero(left) # truncation error
105-
σ = 1.0
106-
ϵ_s = ϵ * 2^(n_h + n0)
104+
σ = one(mid)
105+
n_h = exponent(abs(right - left) / (2 * ϵ))
106+
ϵ_s = ϵ * exp2(n_h + n0)
107107

108108
i = 1
109109
while i maxiters

0 commit comments

Comments
 (0)