compute f(x)