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

Home » Public Forums » archive » Re: Floating underflow?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Floating underflow? [message #60356] Sun, 18 May 2008 16:02 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Magic.Zhou@gmail.com writes:

> can some one who can tell me how to deal with Floating underflow?

This article might help.

http://www.dfanning.com/math_tips/underflow.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Floating underflow? [message #60358 is a reply to message #60356] Sun, 18 May 2008 05:46 Go to previous messageGo to next message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
The floating underflow is almost certainly coming from points far out
on the distribution... normal distributions drop below machine-
representable numbers (even doubles) remarkably fast. In this case,
it's probably innocuous enough, but if they're bothering you (or
slowing down your code) you could always test to make sure the
argument to the Gaussian isn't too large, and if it is then assign
zero instead of doing the calculation.

Incidentally, you're not looping over i and j are you? :-)=


On May 18, 3:10 am, Magic.Z...@gmail.com wrote:
> can some one who can tell me how to deal with Floating underflow?
>
> my code is
> Pro_00(i,j)=(1.d32/(C*sqrt(MS_01[1,Oimage(i,j)]*1.d)))*EXP(-
> ((Oimage(i,j)-
> MS_01[0,Oimage(i,j)])^2)*1.d32/2.d32*MS_01[1,Oimage(i,j)])
> all of the input value is double
> it is a normal distribution, but the result report it has a Floating
> underflow, can some one give me some ideas?
> ps:
> it is a markov random fields
Re: Floating underflow? [message #60528 is a reply to message #60356] Mon, 26 May 2008 03:42 Go to previous message
Magic.Zhou is currently offline  Magic.Zhou
Messages: 16
Registered: April 2008
Junior Member
On May 19, 9:02 am, David Fanning <n...@dfanning.com> wrote:
> Magic.Z...@gmail.com writes:
>> can some one who can tell me how to deal with Floating underflow?
>
> This article might help.
>
>   http://www.dfanning.com/math_tips/underflow.html
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

thanks a lot!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Vector placement in ENVI
Next Topic: Volume visualization starting from 2d image

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

Current Time: Sun Oct 12 03:04:27 PDT 2025

Total time taken to generate the page: 1.20234 seconds