Avoiding underflow, by using logarithms of message values