Tail recursive optimization of average fix