Evaluation of function and finding a value