From: hirsch@pioneer.arc.nasa.gov (Bob Hirsch)
Subject: Is multiplying by one faster ???
Date: 1 Mar 91 19:57:04 GMT [thread overview]
Message-ID: <1991Mar1.195704.12452@riacs.edu> (raw)
We seem to have a local argument about whether multiplying by unity (or
adding zero) is executed faster than multiplying or adding with
arbitrary values.
The relevant environment is VAX VMS 5.x, VAX Fortran. The values appear
in ordinary variables assigned at run time, not as parameters or by DATA
statements.
Theory "A" suggests that the computer can plainly tell that the
multiplier has a value of one and can therefore save time by treating
the command as a no-op.
Theory "B" claims that applying the above test for every multiply
operation ever performed would be far more costly than the saving
obtained on the rare occasions when it applied.
I'm not asking for votes on which theory you prefer, but I am asking if
anyone *knows with certainty* whether there is any difference for
operations with one and zero.
How about e-mail, and I'll summarize?
Thanks,
Bob Hirsch -- Sterling ZeroOne -- NASA Ames Research Center
hirsch@ames.arc.nasa.gov Mail Stop 233-3
415/604-4807 Moffett Field, CA 94035
**The preceding has been an opinion by a concerned citizen.**
next reply other threads:[~1991-03-01 19:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-03-01 19:57 Bob Hirsch [this message]
1991-03-05 17:26 ` summary, Re: Is multiplying by one faster ??? Bob Hirsch
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox