From 992f41df957806a81e1b2c5ce1a7a2077ebe41ae Mon Sep 17 00:00:00 2001 From: alanlujan91 Date: Tue, 15 Dec 2020 20:47:55 -0600 Subject: [PATCH] Update root_finding.py 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 --- quantecon/optimize/root_finding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantecon/optimize/root_finding.py b/quantecon/optimize/root_finding.py index 3b2eff7e9..c2645f281 100644 --- a/quantecon/optimize/root_finding.py +++ b/quantecon/optimize/root_finding.py @@ -247,7 +247,7 @@ def newton_secant(func, x0, args=(), tol=1.48e-8, maxiter=50, p1 = x0 * (1 + 1e-4) + 1e-4 else: p1 = x0 * (1 + 1e-4) - 1e-4 - q0 = func(p0, *args) + q0 = func(p0, *args) funcalls += 1 q1 = func(p1, *args) funcalls += 1