[std-interval] csets

Hervé Brönnimann hbr at poly.edu
Mon Jun 5 23:14:29 PDT 2006


Dear Ray:
In the interval proposal as it stands, we have considered this and  
also proposed to ignore negative values in sqrt. There is an item in  
the rationale about this:

> — What is the behavior on out-of-range argument values? E.g.,  
> should sqrt(x) throw if interval
> x contains negative values?

> We decided to interpret the inclusion property as allowing negative  
> values for sqrt without throwing
> exception, simply saying that sqrt(i) contains sqrt(x) for any  
> positive x in i (and is empty if i is
> entirely negative). Similarly for any function whose domain is a  
> subset of the representable T. This is
> the most inclusive view since it allows for silent error  
> propagation and recovery for sqrt(i) where
> i is (in theory) guaranteed to represent a positive number but its  
> interval enclosure contains negative
> numbers.

Note that this will be the overwhelmingly common case, due to  
roundoff errors. Thus likely sqrt(x) will be invoked with very small  
values for inf(x). And the user should either be guaranteed that x  
represents a non-negative number (hence the inclusion property is not  
violated), or manually test that x>=0, which if this is done using  
intervals, will also correctly detect the cases where x could be  
negative, in which case the user will necessarily have to handle the  
situation.

> Note that, it is always possible for the user to check manually the  
> range of the arguments (e.g.,
> does i contain negative numbers) and to choose the appropriate  
> action. As Bill Walster puts it:
> “Depending on the context, an empty result of an arithmetic  
> operation or function evaluation may
> or may not indicate that an error has been made. An exception-like  
> feature is needed to provide
> a test for expression continuity, which is an assumption for the  
> interval Newton algorithm and the
> Brouwer fixed-point theorem. This will only be needed in special  
> circumstances and therefore needs
> to be invokable only when required.”

In response to your concern about imaginary numbers:  if (sqrt [-4,  
1])^4 is indeed intended to return [0,16], then special handling is  
necessary from the user of the class interval<> since the class won't  
do it by itself.  On the other hand, it's not impossible to extend  
complex< interval<T> > (although the effect is unspecified in the C++  
standard, and therefore non-portable). But that is clearly not what  
we intend to standardize.

Regards,
--
Hervé Brönnimann
CIS, Polytechnic University
hbr at poly.edu


On Jun 5, 2006, at 10:00 PM, Ray Moore wrote:

> John and all,
>
> The one thing that bothers me about the cset approach is
> returning a result like [0, 1] when feeding the argument
> [-4, 1] to the square root function. I mean there is a very useful  
> extension of the square root function to complex values, for which  
> the result would be something else, like
> [0, 1] U [-2, 2] i.
>
> I understand the difficulty of allowing complex values. To make it  
> complete would be another huge project on top of all that is  
> already underway.
>
> However, otherwise it will necessary to explain the restriction to  
> real results. Furthermore, things like
> (sqrt [-4, 1])^4 would produce [0, 1] without including complex  
> numbers, whereas it should produce [0, 16]
> with complex numbers allowed.
>
> What is the proposal for dealing with such concerns ?
>
> Ray Moore
>
> _______________________________________________
> Std-interval mailing list
> Std-interval at compgeom.poly.edu
> http://compgeom.poly.edu/mailman/listinfo/std-interval




More information about the Std-interval mailing list