[std-interval] Re: Std-interval Digest, Vol 8, Issue 18

Ned Nedialkov nedialk at mcmaster.ca
Sun Sep 24 16:08:46 PDT 2006


Gillaume,

> Message: 2
> Date: Fri, 22 Sep 2006 07:54:07 +0200
> From: Guillaume Melquiond <guillaume.melquiond at ens-lyon.fr>
> Subject: Re: [std-interval] More on interval computations as proofs
> To: For discussions concerning the C++ standardization of intervals
> 	<std-interval at compgeom.poly.edu>
> Message-ID: <1158904447.5925.24.camel at saline>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Le vendredi 22 septembre 2006 à 00:43 +0100, Dr John Pryce a écrit :
>
>> Input is V, which is an interval known to be
>> valid (not NaI) and nonempty, but perhaps infinite. Do:
>>        m = midpoint(V);
>>        W = V-m; //centre V about its midpoint.
>>
>> Aim:
>> To see if the current standard stops one getting
>> nonsense results without warning.
>
>> Case 2.
>> Input V = [3,Inf)
>>        m = (3 + Inf)/2.0 = Inf
>>        W = [3,Inf) - Inf
>> The Inf is converted to interval<T>(Inf) =
>> [REALMAX, Inf) probably, by 26.6.4#7. So
>>         W = (-Inf, Inf).
>>
>> Case 3.
>> Input V = (-Inf,Inf)
>>        m = (-Inf + Inf)/2.0 = NaN
>>        W = (-Inf,Inf) - NaN
>> The NaN is converted to interval<T>(Inf) = empty, by 26.6.4#7. So
>>         W = empty.
>>
>> I may have made a slip in these calculations. If
>> not, I am not happy about either of cases 2 & 3
>> which to my mind are both "nonsense results without warning".
>
> Both cases 2 and 3 are actually forbidden by the proposal.

Suppose that somewhere in my algorithm I have
	
	/*  some code A that produces intervals U and V */
         m = midpoint(V);
         W = V-m;

	/* Now assume that from the logic of my algorithm, U and W must contain
         	a true result. Therefore their intersection must contain it  
too. */
	   Z  = intersect(U,W) 	

  Assume that in 1 000 000 executions of the above code, U and V are  
finite, but in the 1 000 001 execution A, produces
V = [-Inf, +Inf], which is fine, as V contains a true result (assume  
U is always finite).

The above case 3 is forbidden, so my program breaks down. I check my  
implementation many times with pencil and paper, and the logic is  
just fine. Then I have to debug to see what has happened.
In nontrivial computations, I have encountered several situations of  
this sort, and they have been very difficult to track down.

Hope the above is helpful.

Regards,
Ned Nedialkov





More information about the Std-interval mailing list