Skip to content

Commit 08a15f5

Browse files
authored
Update root_finding.py (#560)
when x0 >= 0, q0 is not initially assigned, but since this function is jitted, I believe q0 = 0.0 when referenced before assignment to notice the error, remove @njit decorator and set x0 >= 0
1 parent 805650a commit 08a15f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quantecon/optimize/root_finding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def newton_secant(func, x0, args=(), tol=1.48e-8, maxiter=50,
247247
p1 = x0 * (1 + 1e-4) + 1e-4
248248
else:
249249
p1 = x0 * (1 + 1e-4) - 1e-4
250-
q0 = func(p0, *args)
250+
q0 = func(p0, *args)
251251
funcalls += 1
252252
q1 = func(p1, *args)
253253
funcalls += 1

0 commit comments

Comments
 (0)