From 145d5f221c5b4c43c24436b79390fe1b1c881620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gonz=C3=A1lez?= Date: Fri, 9 Aug 2024 18:09:38 +0200 Subject: [PATCH] Fix ITP for generic output numbers --- lib/SimpleNonlinearSolve/src/bracketing/itp.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/SimpleNonlinearSolve/src/bracketing/itp.jl b/lib/SimpleNonlinearSolve/src/bracketing/itp.jl index 4cc9e9b0c..4c92645ba 100644 --- a/lib/SimpleNonlinearSolve/src/bracketing/itp.jl +++ b/lib/SimpleNonlinearSolve/src/bracketing/itp.jl @@ -124,10 +124,11 @@ function SciMLBase.solve(prob::IntervalNonlinearProblem, alg::ITP, args...; xp <= tmin && (xp = nextfloat(tmin)) yp = f(xp) yps = yp * sign(fr) - if yps > 0 + T0 = zero(yps) + if yps > T0 right = xp fr = yp - elseif yps < 0 + elseif yps < T0 left = xp fl = yp else