NewtonMethod C++ implementation of the Newthon Method for calculating the zero of a function on a specific interval