We discuss an efficient approach to the calculation of the internal energy
in numerical simulations of spin systems with long-range interactions. Alth
ough, since the introduction of the Luijten-Blote algorithm, Monte Carlo si
mulations of these systems no longer pose a fundamental problem, the energy
calculation is still an O(N-2) problem for systems of size N. We show how
this can be reduced to an O(N logN) problem, with a break-even point that i
s already reached for very small systems. This allows the study of a variet
y of, until now hardly accessible, physical aspects of these systems. In pa
rticular, we combine the optimized energy calculation with histogram interp
olation methods to investigate the specific heat of the Ising model and the
first-order regime of the three-state Ports model with long-range interact
ions.