[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Help-gsl] Exponential calculation

From: Ashish Negi
Subject: RE: [Help-gsl] Exponential calculation
Date: Mon, 16 Feb 2009 11:51:29 +0530

Hi Kevin,
You are right exp(-100) returns 3.7e-44.
Actually, during mathematical programming. We are encountering such
scenarios while calculating probability density function.
As structure of probability density function is as follows.
Pdf = (expression_1) * (exponential (expression_2).

Now during our calculation we are encountering the situation where
expression_2 is getting evaluated to such values like -800.0.
In this case exponential (-800.0) is zero.

So how do we deal with such situations what will be pdf in this case.


-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf
Of Kevin Channon
Sent: Wednesday, February 11, 2009 6:49 PM
To: Ashish Negi
Cc: address@hidden
Subject: Re: [Help-gsl] Exponential calculation

Hi Ashish,

> Is there any known mathematical method to calculate : exponential( -
> val), when val is too small number like -100

You don't need gsl for this, just use the standard c library math.h (or
cmath in c++)

printf("%g\n", exp(-100));

returns the correct answer of 3.7e-44

There might be some penalty in terms of speed and accuracy, I don't
know, but it does return a value that should be at least in the ballpark

> If there is any such instance during probability density function
> calculation when exp( - x2/ 2) is calculated, How to handle such

You might need to clarify this a bit more, I'm not sure that I
what you're asking

Kevin Channon

School of Chemistry
University of Bristol

reply via email to

[Prev in Thread] Current Thread [Next in Thread]