Approximate the root of a function f