Re: Correlate function (bug?) [message #11277 is a reply to message #11103] |
Mon, 16 March 1998 00:00  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Theo Brauers <Th.Brauers@fz-juelich.de> writes:
> Hi
> I was facing a problem with the correlate function
> which is demonstrated by the following IDL procedure:
> pro testc
> x=[1.D-5, 1.D-6, 0.0]
> y=[1.D-5, 1.1D-6, 0.0]
> f=[1.D0, 1.D1, 1.D2, 1.D3, 1.D4, 1.D5, 1.D6]
> for i=0,6 do begin
> print, i, correlate(x,y, /double) $
> , correlate(x,y*f[i], /double) $
> , correlate(x*f[i],y, /double) $
> , correlate(x*f[i],y*f[i], /double)
> endfor
> END
> giving the following result:
> 0 1.#QNAN00 1.#QNAN00 1.#QNAN00 1.#QNAN00
> 1 1.#QNAN00 1.#QNAN00 1.#QNAN00 1.#QNAN00
> 2 1.#QNAN00 1.#QNAN00 1.#QNAN00 1.#QNAN00
> 3 1.#QNAN00 1.#QNAN00 1.#QNAN00 0.99995432
> 4 1.#QNAN00 1.#QNAN00 1.#QNAN00 0.99995432
> 5 1.#QNAN00 0.99995432 0.99995432 0.99995432
> 6 1.#QNAN00 0.99995432 0.99995432 0.99995432
> In my opinion there is no reason for an underflow or whatever causes
> correlate to return NAN.
> Best Theo
This behavior seems to have been introduced in IDL version 5. IDL/v4 doesn't
have any problem, and returns the result
0 0.99995432 0.99995432 0.99995432 0.99995432
1 0.99995432 0.99995432 0.99995432 0.99995432
2 0.99995432 0.99995432 0.99995432 0.99995432
3 0.99995432 0.99995432 0.99995432 0.99995432
4 0.99995432 0.99995432 0.99995432 0.99995432
5 0.99995432 0.99995432 0.99995432 0.99995432
6 0.99995432 0.99995432 0.99995432 0.99995432
William Thompson
|
|
|