Replace avg energy with average over relative error.