🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #3217

Is multiplying by one faster ???

#3217
From: Bob Hirsch
Date: Fri, 01 Mar 1991 19:57
28 lines
1527 bytes
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.**
Technical Details
Message-ID: <1991Mar1.195704.12452@riacs.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!shelby!riacs!pioneer.arc.nasa.gov!hirsch

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!shelby!riacs!pioneer.arc.nasa.gov!hirsch
From: hirsch@pioneer.arc.nasa.gov (Bob Hirsch)
Newsgroups: comp.sys.dec
Subject: Is multiplying by one faster ???
Message-ID: <1991Mar1.195704.12452@riacs.edu>
Date: 1 Mar 91 19:57:04 GMT
Sender: news@riacs.edu
Organization: RIACS, NASA Ames Research Center
Lines: 28