187188189190191192193194195196197
if (y[1] * y[2] < 0) { // use all computed point as a start sampling array for solving nbPoints = 3; signChangeIndex = 2; } else { throw new NoBracketingException(x[0], x[2], y[0], y[2]); } } // prepare a work array for inverse polynomial interpolation
160161162163164165166167168169170
remainingEval--; } } throw new NoBracketingException(LocalizedFormats.FAILED_BRACKETING, xLo, xHi, fLo, fHi, maxEval - remainingEval, maxEval, baseRoot, min, max); }
348349350351352353354355
} } // no bracketing found throw new NoBracketingException(a, b, fa, fb); }
455456457458459460461462463464
if (function == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } verifyInterval(lower, upper); if (!isBracketing(function, lower, upper)) { throw new NoBracketingException(lower, upper, function.value(lower), function.value(upper)); } }
117118119120121122123
// Reduce interval if initial and max bracket the root. if (yInitial * yMax < 0) { return brent(initial, max, yInitial, yMax); } throw new NoBracketingException(min, max, yMin, yMax); }
107108109110111112113114115116117
if (FastMath.abs(y1) < functionValueAccuracy) { return x1; } if(y0 * y1 > 0) { throw new NoBracketingException(x0, x1, y0, y1); } double x2 = 0.5 * (x0 + x1); double y2 = computeObjectiveValue(x2);
119120121122123124125
// Reduce interval if initial and max bracket the root. if (yInitial * yMax < 0) { return laguerre(initial, max, yInitial, yMax); } throw new NoBracketingException(min, max, yMin, yMax); }
184185186187188189190191192193194
153154155156157158159160161162163
266267268269270271272273274275276
++numIterations; } while ((fa * fb > 0.0) && (numIterations < maximumIterations) && ((a > lowerBound) || (b < upperBound))); if (fa * fb > 0.0) { throw new NoBracketingException(LocalizedFormats.FAILED_BRACKETING, a, b, fa, fb, numIterations, maximumIterations, initial, lowerBound, upperBound); }