How to deal with underflow in scientific computing?

后端 未结 5 1770
梦谈多话
梦谈多话 2021-02-13 18:58

I am working on probabilistic models, and when doing inference on those models, the estimated probabilities can become very small. In order to avoid underflow, I am currently wo

5条回答
  •  萌比男神i
    2021-02-13 19:40

    I don't understand why this works, but this formula seems to work and is simpler:

    c = a + log(1 + exp(b - a))

    Where c = log(exp(a)+exp(b))

提交回复
热议问题