I'm using the Metorpolis-Hastings algorithm in a setting where the acceptance function is essentially of the form $$\alpha(x,y)=1\wedge\frac{u(x,y)}{v(x,y)},$$ where $$u(x,y)=p+(1-p)\prod_{i=1}^mu_i(x,y)$$ and $$v(x,y)=p+(1-p)\prod_{j=1}^nv_j(x,y).$$
My problem is that, if $m$ or $n$ is large enough (in my application less than $15$ is sufficient), it may happen that the product in the definition of $u(x,y)$ or $v(x,y)$ is computed to $0$ (due to insufficient floating point precision) even when each $u_i(x,y)$ or $v_i(x,y)$ is strictly positive (each $u_i(x,y)$ or $v_i(x,y)$ is essentially the value of a normal distribution density).
What can I do to remedy this issue?
EDIT: The concrete shape of $u$ and $v$ is $u(x,y)=w_{d_1}(\varphi(x),\varphi(y))$ and $v(x,y)=w_{d_2}(\psi(x),\psi(y))$, where $\varphi$ and $\psi$ are transformations onto $[0,1)^{d_1}$ and $[0,1)^{d_2}$, respectively, and $$w_d(x',y'):=p+\frac{1-p}{\sqrt{2\pi\sigma^2}}\prod_{i=1}^d\sum_{k\in\mathbb Z}e^{-\frac{\left(k+y'_i-x'_i\right)^2}{2\sigma^2}}.$$