Reward function compression facilitates goal-dependent reinforcement learning