The energy dependence of positronium formation in gases