Dealing with numerical calculations having exponential terms often becomes painful, thanks to overflow errors. For example, suppose you have a probability density, P(x)=C*exp(f(x)/k)
, where k is very small number, say of the order of 10^(-5)
.
To find the value of C
one has to integrate P(x)
. Here comes the overflow error. I know it also depends on the form of f(x)
. But for this moment let us assume, f(x)=sin(x)
.
How to deal with such problems?
What are the tricks we may use to avoid them?
Is the severity of such problems language dependent? If yes, in which language should one write his code?