code: public static double getGradDotDirApprox(Function fn, IntDoubleVector x, IntDoubleVector d) {
          return getGradDotDirApprox(fn, x, d, getEpsilon(x, d));
      }
docs: Compute f'(x)^T d = ( L(x + c * d) - L(x - c * d) ) / (2c)
  
  @param fn Function, f.
  @param x Point at which to evaluate the gradient, x.
  @param d Random direction, d.
  @param c Epsilon constant.
  @return