|
Re: Floating underflow? [message #60358 is a reply to message #60356] |
Sun, 18 May 2008 05:46   |
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  |
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!
|
|
|