Evaluating a function output using a table