Reward-based learning of a redundant task