finding zeros of a function