For a Bayesian estimation problem that I am working on, where I update the log-posterior (many times based on data) instead of the posterior itself using Bayes rule. I find the following (rather convoluted) form of the log-posterior distribution
$$\text{lpos}(x) := -49949 \log(2) + \log(\exp\{-(1/8) (x-2)^2\}/(2 \sqrt{2 \pi})) + 114148 \log(\cos(x/2))\\ + 86056 \log(\sin(x/2)) + 99898 \log(\sin(x))$$
With the maximum numerically determined (using Mathematica) as -103515. and the minimum -130038.
I am trying to recover the posterior using the The Log-Sum-Exp Trick but due to the large gap between the maximum and minimum I still get the error that "Exp[-26485.] is too small to represent as a normalized machine number; precision may be lost".
Can anyone advise on how to work around this such that I can recover the normalized posterior distribution (as I am interested in the variance thereof) from such a convoluted log-posterior distribution? Many thanks for any assistance.