Package org.apfloat
Class RootFinder
java.lang.Object
org.apfloat.RootFinder
Helper class for finding roots of functions.
- Since:
- 1.13.0
- Version:
- 1.13.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RootFinder
private RootFinder()
-
-
Method Details
-
findRoot
public static Apfloat findRoot(Function<Apfloat, Apfloat> f, BiFunction<Apfloat, Apfloat, Apfloat> fp, Apfloat y, Apfloat initialGuess, long targetPrecision) Find the root of the given function with Newton's method, starting from the given initial guess.- Parameters:
f
- The function.fp
- The derivative of the function, first argument is x, second argument is f(x)y
- The function value to match (e.g. zero to find zeros, some other value to find inverses of functions)initialGuess
- The initial guesstargetPrecision
- Target precision of the result- Returns:
- The root
-