Re: mid(u,u)? Re: How do I bisect unbounded intervals?
On 2012-01-13 07:03:21 -0600, Ralph Baker Kearfott wrote:
> If "u" is a representable endpoint of an interval (e.g. if
> the underlying representation is "infsup" and u is a valid
> floating point datum), it seems to me a reasonable representation
> is mid([u,u]) = u. (Mathematically, that is exactly the
> midpoint.) Of course, this doesn't prevent infinite
> recursion if the programmer hasn't taken account of it. I grant
> you that this case is similar to the case [u,v], where u and v
> are adjacent representable floating point numbers (a case that
> Nate has suggested should return NaN), but in the case [u,v],
> case, it is not possible for the "mid" function to return
> an exact result. (That case is not unique: u and v don't need
> to be adjacent for the midpoint not to be representable.)
IMHO, the main problem was not the fact that the midpoint was
not representable, but the fact that the returned value would
not belong to ]u,v[ when u < v. In floating-point arithmetic,
this would really be acceptable because users need to take care
of rounding errors and should be used to this. I see interval
arithmetic as a level above.
> IMO a minimal requirement for the case [u,v] would seem to be that
> "mid" return an element of [u,v]. (A stronger requirement might be
> it return "NaN" in the case there are no floating point numbers
> between u and v.)
Yes.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)