Estimates of mass distributions from their potentials and energies