how to calculate a function - Search