[Top][All Lists]

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

Re: [Help-gsl] overflow exception

From: A J
Subject: Re: [Help-gsl] overflow exception
Date: Sun, 18 Jun 2006 14:51:59 -0500

Thanks, that helps. However, I am not really sure what we can do for
underflows. I am doing this:


where check = gsl_isinf, gsl_finite, or gsl_isnan.

The numbers a and b are 564.892 and -158.438, and matlab reports exp(b-a) =

Now I get the error:

gsl: exp.c:114: ERROR: underflow
Default GSL error handler invoked.

Can anyone help?


On 6/18/06, Ralph Silva <address@hidden> wrote:


you can test exp(a) and/or exp(b) using gsl_isnan, gsl_isinf or gsl_finite
functions. See the GSL manual for more information.


On 6/18/06, A J <address@hidden> wrote:

> Hey All:

While trying to use gsl_sf_exp_e10_e, I get the following error:

gsl: exp.c:127: ERROR: overflow
Default GSL error handler invoked.

In my application, I have two numbers a and b and I have to compute a
quantity that's exp(a)/(exp(a)+exp(b)). Now if exp(a) overflows and exp(b)
is in range, I can interpret this as 1. Similarly, if exp(b) overflows and
exp(a) is in range, I can interpret this as 0.  Similar interpretations
could be derived for the case in which there's an underflow.

Therefore, it would be nice if I can figure a way in which instead of
throwing an error, the program outputs an alternative integer which could
0 if there's neither underflow or overflow, 1 if there's an overflow and 2
if there's an underflow (however I am not sure what I can do when both
overflow or both underflow). Does anyone know how to do this?

Help-gsl mailing list

Ralph dos Santos Silva
address@hidden <>
Departamento de Métodos Estatísticos - DME
Instituto de Matemática - IM
Universidade Federal do Rio de Janeiro - UFRJ

reply via email to

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