code: public static double root(Function func, double x1, double x2, double tol) {
          return root(func, x1, x2, tol, 100);
      }
docs: Returns the root of a function known to lie between x1 and x2 by
  Brent's method. The root will be refined until its accuracy is tol.
  The method is guaranteed to converge as long as the function can be
  evaluated within the initial interval known to contain a root.
  @param func the function to be evaluated.
  @param x1 the left end of search interval.
  @param x2 the right end of search interval.
  @param tol the accuracy tolerance.
  @return the root.