NUTS Drawing samples from slice sampler; how to keep bounds on log scale? I'm currently working to adapt the No U-Turn Sampler from this paper for a model I'm working on.
The No-U Turn sampler augments the typical hamiltonian system by incorporating a slice variable $u$ such that $p(\theta,r,u) \propto I(u \in [0,\exp\{ \mathcal{L}(\theta) - \frac{1}{2}r^{T}r\}]]$, where $\mathcal{L}(\theta)$ is the unnormalized log posterior and $r$ are the momentum variables (p.1599 of paper). However, In most trivial model setups I create, any (including the max) exponentiated log likelihood of double (or even long double) types evaluate to zero. Resulting in a degenerate distribution and consequently, non-meaningful draws. 
Goal: Draw meaningful random variates from this distribution.
This suggests I should keep things on the log-scale. However, even transforming $u$ to, say $z=\log(u)$ will result in a distribution that still requires the computation of $exp\{\mathcal{L}(\theta)\} $ (see below - only included for justification). I'm looking for any suggestions that will help me accomplish my goal above. Thanks.
$$
a :=\exp(\mathcal{L}(\theta) - \frac{1}{2}r^{T}r)\\
f_U(u) = \frac{I(0 \leq u \leq a )}{a}\\
z := \log (u) \iff e^z = u ; \quad \mid\frac{\partial u}{\partial z}\mid = e^{z}\\
$$
$$
\Rightarrow f_Z(z) = \frac{I(-\infty < z < \log(a))}{a}e^z \tag{*}
$$
Since $a$ is still in the denominator in $f_Z(z)$ I'll still have problems computing this (as it will persist to the CDF as well).
Much obliged for any insight.
 A: The slice sampler does not require the use of the normalised density $\mathcal{L}(\theta)$, One can use instead $\mathcal{L}(\theta)/\max_\theta\mathcal{L}(\theta)$ if this helps in avoiding overflows or underflows. 
Furthermore, simulation does not require the computation of the normalised densities either. For instance, generating the truncated exponential mentioned in the question can be done without computing $a$.
A: Received the following suggestion from a Computer Science Professor that is able to get $\log(u)$ without using the CDF method.


*

*Draw $z \sim $ Unif($0,1)$  

*Compute $\log(u) = \log(z) + \mathcal{L}(\theta)$
Where step 2 works because of log rules, $\log(z)+\mathcal{L}(\theta) = \log(z*\mathcal{L}) = \log(u)$
Then use $\log(u)$ for any comparisons with other values on the log scale.
A: You can avoid taking logarithms by drawing samples from an exponential distribution:
$$
\begin{align}
u &\sim \text{Unif}[0, a] \\
\text{let} \ x &:= u/a \Rightarrow x \sim \text{Unif}[0, 1], \  -\log(x) \sim \text{Exp}(1) \\
\log(u) &= \log(a x) = \log a - (-\log(x)) \\
\log(u) &\sim \log a - \text{Exp}(1)
\end{align}
$$
