Roger Federer produced a near-flawless performance as he avenged his Wimbledon defeat by Novak Djokovic and qualified for the last four of the ATP Finals with a 6-4, 6-3 victory on Thursday. The Swiss started the tournament with a chastening straight-sets defeat to Dominic Thiem but found his best form when it mattered. Defeat for the second seed spells the end of his bid to overtake Rafael Nadal and finish as year-end number one.