move the energy evaluation to function compute_energy()

_neval is incremented in that function now