So, I have problems with precision in Python.
I would like to compute such functions:
P(x,y) = exp(-x)/(exp(-x) + exp(-y))
Where x and y can be> 1000. Python math.exp (-1000) (at least 2.6!) Does not have enough floating point precision to handle this.
- this form looks like logistic / logit / log -odds, but it isnβt, right? Is there any algebraic simplification that I'm missing here?
- I know about the decimal value, but I'm not sure if it is applicable here.
- Looks like homework, but itβs not, I promise!
(Also, I'm open to titles! I could not come up with a good question for this question!)
source share