added getFunctionValue(double x) method