/** * {@inheritDoc} */ @Override protected double doSolve() throws TooManyEvaluationsException { final double startValue = getStartValue(); final double absoluteAccuracy = getAbsoluteAccuracy(); double x0 = startValue; double x1; while (true) { x1 = x0 - (computeObjectiveValue(x0) / computeDerivativeObjectiveValue(x0)); if (FastMath.abs(x1 - x0) <= absoluteAccuracy) { return x1; } x0 = x1; } } }
NewtonSolver rootPolisher = new NewtonSolver(); newtonRoot = rootPolisher.solve(AlgoRootNewton.MAX_ITERATIONS, fun, min, max, rate); if (Math.abs(fun.value(newtonRoot)) < Math.abs(fun.value(rate))) {
} else { BaseAbstractUnivariateSolver<DifferentiableUnivariateFunction> solver2 = new NewtonSolver(); return solver2.solve(maxIterations, f, min.doubleValue(), max.doubleValue());
rootFinder = new BrentSolver(); rootPolisher = new NewtonSolver(); newtonRoot = rootPolisher.solve(AlgoRootNewton.MAX_ITERATIONS, fun, min, max, root);
/** * {@inheritDoc} */ @Override protected double doSolve() throws TooManyEvaluationsException { final double startValue = getStartValue(); final double absoluteAccuracy = getAbsoluteAccuracy(); double x0 = startValue; double x1; while (true) { x1 = x0 - (computeObjectiveValue(x0) / computeDerivativeObjectiveValue(x0)); if (Math.abs(x1 - x0) <= absoluteAccuracy) { return x1; } x0 = x1; } } }
rootFinderNewton = new NewtonSolver(); double newtonRoot = rootFinderNewton.solve( AlgoRootNewton.MAX_ITERATIONS, polyFunc, left, right,
/** * {@inheritDoc} */ @Override protected double doSolve() throws TooManyEvaluationsException { final double startValue = getStartValue(); final double absoluteAccuracy = getAbsoluteAccuracy(); double x0 = startValue; double x1; while (true) { x1 = x0 - (computeObjectiveValue(x0) / computeDerivativeObjectiveValue(x0)); if (FastMath.abs(x1 - x0) <= absoluteAccuracy) { return x1; } x0 = x1; } } }
rootFinderNewton = new NewtonSolver(); root = rootFinderNewton.solve(MAX_ITERATIONS, derivFun, borders[0], borders[1], start1); if (checkRoot(fun, root)) {