(j3.2006) (SC22WG5.4773) [ukfortran] [Letter ballot 3 on Fortran 2008interpretations]
Van Snyder
Van.Snyder
Tue Sep 18 16:57:18 EDT 2012
On Tue, 2012-09-18 at 13:17 +0900, Malcolm Cohen wrote:
>
> >The desire was to be able to get a default-real
> >value, that is, a member of the set of valid values for default real,
> >from a double precision argument. Being able to do this is essential to
> >Kahan summation, and other methods to do arithmetic without avoidable
> >loss of precision.
>
> Just calculate the sum in double precision then, that's even better.
It's not only NOT better, it's frequently not as good, and very far from
"almost as good" in some cases.
In Kahan summation, you decompose double-precision summands into two
numbers, the high-order single-precision part, and the low-order
single-precision part -- or three parts if the double-precision mantissa
has more bits than two single-precision ones. Then those parts are
operated upon, in double precision. The result is better than summing
in double precision.
Kahan isn't an idiot. Double precision has been around forever. If it
wasn't good enough in 1966, it still isn't good enough. Even on systems
that provide quad precision, people use Kahan summation to retain more
precision than naive summation.
More importantly, Kahan summation is not the only reason to want
REAL(X,K) not to be NOP. Is there more than one reason for it to be
NOP? Is there any reason the work-around of using X instead of
REAL(X,K) doesn't work?
More information about the J3
mailing list