Finding specific values of a function