From 2af62a6d6939701ab17a0d087604068947d8668b Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:18:24 +0100 Subject: [PATCH] fixed files form Math #73 --- .../org/apache/commons/math/analysis/solvers/BrentSolver.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/Math/73/org/apache/commons/math/analysis/solvers/BrentSolver.java b/projects/Math/73/org/apache/commons/math/analysis/solvers/BrentSolver.java index 8142b5e..e0cb427 100644 --- a/projects/Math/73/org/apache/commons/math/analysis/solvers/BrentSolver.java +++ b/projects/Math/73/org/apache/commons/math/analysis/solvers/BrentSolver.java @@ -133,6 +133,10 @@ public double solve(final UnivariateRealFunction f, return solve(f, initial, yInitial, max, yMax, initial, yInitial); } + if (yMin * yMax > 0) { + throw MathRuntimeException.createIllegalArgumentException( + NON_BRACKETING_MESSAGE, min, max, yMin, yMax); + } // full Brent algorithm starting with provided initial guess return solve(f, min, yMin, max, yMax, initial, yInitial);