Compute $\log(A_1 B_1 + \cdots+ A_n B_n)$, given $\log(A_1),\dots,\log(A_n)$. The catch is one can't simply do $\log(\exp(\log(A_1))B_1 + \cdots+ \exp(\log(A_n))B_n)$. Why? Because $A_1$, ... $A_n$ are very small. Small enough that $\exp(\log(A_i))$ gets rounded to zero in most computers (and thus results in $R=\log(0)=-\infty$).
Is there any way to compute $\log(A_1 B_1 + \cdots + A_n B_n)$ given those constraints? Numerical approximations are fine, but would need to be fast (and stable) enough.
EDIT: The $B_k$ are given and not as small as the $A_k$. Consider the following (very rough) orders of magnitude: $log A_k \approx -100$ and $log B_k \approx -15$.