Energy dependence of 4f and 5d cross sections for rare-earth metals