Dick Hendrickson <[log in to unmask]> wrote:
> Pierre,
>
> I think the problem is that DPROD is an old holdover from F66 and nobody
> knows what it does. The standard doesn't specify whether DPROD(X,Y) is the
> same as DBLE(X)*DBLE(Y) or DBLE(X*Y)
That is true, and very unfortunate IMHO. In my field of activity
(measurement processing), we have huge sets of (single precision)
data that we spend lots of time correlating in every possible manner
(double precision dot products).
If one multiplies 2 single-precision numbers, one gets twice the number
of significant bits. I thought DPROD was a way to say: don't discard
these bits, I want to use the product as a double precision value.
DBLE(X)*DBLE(Y) should give the same result, but less performance
(specially for array sections in most implementations !), and DBLE(X*Y)
should loose some precision.
Unfortunately, it appears that a standard conforming processor may still
evaluate DBLE(2.0)*DBLE(3.0) as 6.0D0 in 1 CPU cycle and DPROD (2.0, 3.0)
as 4.0D0 in many many cycles.
This confirms the opinion that I have that the standard should impose
some documentation requirements, every time it says ``processor dependent''.
Michel
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|