comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Locate an underflow
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Locate an underflow [message #25202 is a reply to message #25132] Thu, 24 May 2001 08:42 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Paul van Delst <paul.vandelst@noaa.gov> writes:

> William Thompson wrote:
>>
>> Paul van Delst <paul.vandelst@noaa.gov> writes:
>>
>>> ... If, on running said code, I get a crapload of underflow errors, it's an
>>> indication that that either a) the code hasn't been tested very well or b) the
>>> programmer didn't really think about the problem enough ...
>>
>> I disagree. It's exceedingly easy to get underflow errors, and extremely
>> difficult to program around them. For example, a simple Gaussian
>>
>> Y = A*exp(-((X-X0)/Sig)^2)
>>
>> is almost guaranteed to generate underflow errors. At some point this is going
>> to be indistinguishable from zero. You'd have to jump through hoops to avoid
>> getting the completely useless underfloat messages.

> Not really. what about something like (assuming double precision):

> tolerance = (MACHAR(/DOUBLE)).EPS

> y = DBLARR( N_ELEMENTS( X ) )
> xarg = ((X-X0)/Sig)^2
> index = WHERE( xarg < tolerance, count )
> IF ( count GT 0 ) THEN $
> y = A*exp(-xarg[index])


And that's not jumping through hoops???


> Or, as I mentioned in my reply to Craig:

> y = A * gaussian_function( (X-X0)/Sig )

> (or similar) which contains all the bits and pieces for checking. Craig also provided a
> method of avoiding the underflows.


When IDL first starting printing out tons of underflow errors, and users
started complaining about them, I also wrote out a routine very much like what
you suggest, called SAFE_EXP(), simply to avoid the messages. In the end,
though, it didn't help, because one ends up multiplying arrays with very tiny
numbers in them with other arrays with very tiny numbers in them, and you end
up with an underfloat anyway. They're all over the place. In the end, you
just give up and ignore them.

If somebody has a real need to make sure that underfloat errors are not
occuring in their programs, then there should be a mechanism to check for that,
as there is. But must people don't care, and find the messages useless and
annoying. There should be a way of suppressing them, if you want. RSI has
supplied a way of doing that, but only by suppressing *ALL* error messages.
All I'm asking for is an option for selectively suppressing the underfloat
messages.

Underfloat messages are like the kid who kept crying wolf. Eventually, you
start ignoring them.

William Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: read Nexrad level 3 data
Next Topic: Re: read Nexrad level 3 data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Nov 29 20:06:44 PST 2025

Total time taken to generate the page: 0.36184 seconds