Hello,
I have very big numbers that overflow as an integer value. Therefore, I keep the logarithms of those values. The problem is that: I need log(a+b) but I only know loga and logb. How can I approximate to find log(a+b)?
Thanks.
Hello,
I have very big numbers that overflow as an integer value. Therefore, I keep the logarithms of those values. The problem is that: I need log(a+b) but I only know loga and logb. How can I approximate to find log(a+b)?
Thanks.
More specifically problem is exactly like this: I need to calculate this: dk=alpha*gamma(nk)+dleftk*drightk
alpha is a small double value here.
gamma(nk)=(n-1)! (overflows for big integers - where nk is an integer value)
dleftk and drightk are calculated recursively according to the same equation. Therefore, I have log(gamma(nk)) and log(dleftk*drightk) and I need to calculate dk.
dk is calculated for a tree, and here dleftk and drightk represent the children of the node dk.
I thought keeping the logarithms will be easier, but any other solution will be appreciated as well.
More specifically problem is exactly like this: I need to calculate this: dk=alpha*gamma(nk)+dleftk*drightk
alpha is a small double value here.
gamma(nk)=(n-1)! (overflows for big integers - where nk is an integer value)
dleftk and drightk are calculated recursively according to the same equation. Therefore, I have log(alpha*gamma(nk)) and log(dleftk*drightk) and I need to calculate dk.
dk is calculated for a tree, and here dleftk and drightk represent the children of the node dk.
I thought keeping the logarithms will be easier, but any other solution will be appreciated as well.