Re: The total function in IDL (RSI read please) [message #1301 is a reply to message #1102] |
Sun, 08 August 1993 13:20  |
gurman
Messages: 82 Registered: August 1992
|
Member |
|
|
thompson@serts.gsfc.nasa.gov (William Thompson) writes:
> However, on most computers, double precision arithmetic is slower
> (sometimes *much* slower) than doing the same operation in single precision,
> not to mention the extra overhead involved in converting back and forth between
> single and double precision.
Bill -
I don't know what happens on SPARCstations, but interestingly
enough, on Alphas running OpenVMS, running the total loop you suggest in
FORTRAN takes exactly twice as long in double precision as in single. At
first sight, that might seem kind of strange, since the Alpha is
supposedly a "64-bit machine," but it is able to do 32-bit operations, 2
per cycle. Thus, a large number of 32-bit operations take half as long
as the same number of 64-bit operations. On the IBM Power/RISC chip, I
understand that there can be 6 operations per cycle, so things probably
still scale simply.
For what it's worth, the total time to add a million REAL*4 numbers
on a DEC 3000/400 was 0.095 s, vs. 0.190 s for a million REAL*8's. In a
year or two, when that becomes one of the slower machines IDL will be
running on, I don't see any reason to default to FLOAT instead of DOUBLE
for TOTAL operations in IDL, do you?
Joe Gurman
--
J.B. Gurman / Solar Physics Branch / NASA Goddard Space Flight Center /
Greenbelt MD 20771 USA / gurman@uvsp.gsfc.nasa.gov
| Federal employees are prohibited from holding opinions under the Hatch Act.|
| Therefore, any opinions expressed herein are somebody else's. |
|
|
|