Evaluate a function at a given input (#341)