From my understanding the energy function needs only be specified such that it is proportional to the log density, and not specifying the normalizing constant should not greatly impact the sampling process. I am trying to generate a sample from a piece-wise normal distribution using the HMC code written by Radford Neal in R. The sampling is perfect when I specified the normalizing constant but bad when I do not. Here's a graphical comparison
Is the discontinuity in the density the main cause here? It worked fine when I tried simple distributions that do not have discontinuities.