code: public static double root(double eps, int maxIterations, double a, double b, Function1D f)
      {
          double x0 = a;
          double x1 = b;
          /**
           * f(x0)
           */
          double fx0 = f.f(x0);
          
          while(Math.abs(x1-x0) > 2*eps && maxIterations-- > 0)
          {
              double fx1 = f.f(x1);
              
              double nextX = x1 - fx1*(x1-x0)/(fx1-fx0);
              
              x0 = x1;
              fx0 = fx1;
              x1 = nextX;
          }
          
          return x1;
      }
docs: Performs root finding on the function {@code f}.
  
  @param eps the desired accuracy of the result
  @param maxIterations the maximum number of iterations to perform
  @param a the left bound on the root (i.e., f(a) &lt; 0)
  @param b the right bound on the root (i.e., f(b) &gt; 0)
  @param f the function to find the root of
  @return the value of variable {@code pos} that produces a zero value
  output