Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Treating undefined values



Nate Hayes schrieb:
Nate Hayes schrieb:
Nate Hayes wrote in ''The current proposal'':

No. 1/0 is not defined, hence it does not contribute to the range.
It is like sqrt([-1,4]) returning [0,2] and not a complex interval.

This behavior is highly desirable in the applications

I think sqrt([-1,4])=[NaN,NaN] is more desireable. In our application
codes and software, if we are interested only in the natural domain
of the function, then we explicitly intersect the interval argument
with the desired domain, e.g.:

   sqrt([-1,4]&[0,Inf])=[0,2].

But you'll have to do it _always_.

Not always. Sometimes the negative numbers appear legitimately in the
interval argument. In this case, the sqrt(.) operator would produce a
containment violation.

Not with the definition of interval operations as in the Vienna
Proposal.

The Vienna Proposal chooses this definition precisely because the system
can hardly ever distinguish between
- the case where an interval is the result of an overestimation (the
  usual case) and
- the case when it is intended that, within a completely real context -
  otherwise one would not use real interval arithmetic, a sqrt of
  something negative should have been taken - which I would consider
  a programming error.

I agree the system can't hardly ever make the distinction. This is why we
choose to let the user make the choice explicit by intersecting the
interval argument with the natural domain. In the second case, you may
consider it a programming error, but it can be used in constructive ways.
Returning sqrt([-1,4])=[NaN,NaN] allows the user explicit control to
choose the option that suits his or her needs.

at the expense of having to check it always at high level.

The point is that almost always (except when the program is
likely to be semantically faulty) one needs the intersection.

Not as much as I think you imply is the case. Particularly with modal intervals, which can often compute narrowed or optimal range enclosures so there is not any over-estimation in the interval argument. In this case, it is a waste of performance (in software, anways) even to do an implicit check inside the sqrt(.) operator.

Nate Hayes
Sunfish Studio, LLC



Therefore this should be the standard implementation, and the rare case
where someone intends to have the other situation should be the high level
decision that can be programmed by checking explicitly for a
negative part in the argument.


Arnold Neumaier