use of de.lab4inf.math.differentiation.Differentiator in project symja_android_library by axkr.
the class NewtonRootFinder method modnewton.
/**
* Modified Newton method for multiple roots.
*
* @param fct the function to find the root of
* @param dF the first derivative of the function
* @param x0 the initial guess as starting value
* @param eps the accuracy to reach
* @return the root
*/
public static double modnewton(final Function fct, final Function dF, final double x0, final double eps) {
Function d2F;
if (dF instanceof Differentiable) {
d2F = ((Differentiable) dF).getDerivative();
} else {
getLogger().warn(NO_DERIVATIVE_NOT_RECOMMENDED);
d2F = new Differentiator(dF);
}
return modnewton(fct, dF, d2F, x0, eps);
}
Aggregations