On 19/10/2006, at 4:40 PM, Guillaume Melquiond wrote:
Le jeudi 19 octobre 2006 à 01:03 +0800, tirath a écrit :
Hi all,
The query... Before I started using the library, I had this assumption: let A be a float with an exact representation (i.e. width=0). If we cast A to a double, the resulting double will have a non-zero width - specifically the width will be equal to the extra precision afforded to doubles vs floats.
If you have a set of numbers that is exactly representable as a singleton interval<float>, then this set of numbers is also representable as a singleton interval<double>. There is no reason to use a bigger interval than necessary to represent this set of numbers.
Thanks for your response Guillaume. I think my explanation was a bit
vague. Take two (with a more concrete example)...
In general, when you have a 32-bit floating point representation of a
real number, the precision is less than it would be with a 64-bit
floating point representation of the number. Therefore when
"promoting" a float to a double, say:
interval<double> x;
interval<float> y;
...
y=x;
shouldn't we (in the spirit of error propagation) acknowledge that
the data assigned to y was of inferior precision? A range too small
to be expressed in single precision may be large enough to be
expressed in double precision, as single precision ulp ~ 1E-7 wheras
double precision ulp ~ 1E-16. Consider the following...
interval<double> x;
interval<float> y;
interval<double> z;
x=1.00000000001;
//the following loop forces error accumulation
for(int i=0; i