octave-maintainers
[Top][All Lists]
Advanced

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

Re: Patch for erfinv.m


From: John W. Eaton
Subject: Re: Patch for erfinv.m
Date: Thu, 24 Jan 2008 04:01:19 -0500

On 24-Jan-2008, Alois Schloegl wrote:

| The test is on x and the assignment in y.

Doh, I was completely missing that detail.

| So the problem is
| x = [NaN, -2, -1, 0, 1, 2];
| y = zeros(size(x));
| y(abs (x) > 1) = NaN
| 
| y =
|      0   NaN     0     0     0   NaN
| 
| The is no NaN in y for the case of isnan(x). 
| 
| The yields the (incorrect) result
| erfinv(x)
| ans =
|      0   NaN  -Inf    -0   Inf   NaN
| 
| 
| The correct result should be 
| 
| ans =
|    NaN   NaN  -Inf    -0   Inf   NaN

OK, then how about

  ## x(i) < -1 or x(i) > 1 or isnan (x(i))  ==>  y(i) = NaN
  y(abs (x) > 1 | isnan (x)) = NaN;
  y(x == -1) = -Inf;
  y(x == +1) = +Inf;

?

Please reply on the list.

Thanks,

jwe


reply via email to

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