Package org.apfloat

Class RootFinder


  • class RootFinder
    extends java.lang.Object
    Helper class for finding roots of functions.
    Since:
    1.13.0
    Version:
    1.13.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RootFinder()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Apfloat findRoot​(java.util.function.Function<Apfloat,​Apfloat> f, java.util.function.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RootFinder

        private RootFinder()
    • Method Detail

      • findRoot

        public static Apfloat findRoot​(java.util.function.Function<Apfloat,​Apfloat> f,
                                       java.util.function.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 guess
        targetPrecision - Target precision of the result
        Returns:
        The root