Precompute some values of a function

Or a functor, see one example here: