MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Division still cost more than multiplication?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24253] Division still cost more than multiplication?
  • From: AES <siegman at stanford.edu>
  • Date: Wed, 5 Jul 2000 23:10:35 -0400 (EDT)
  • Organization: Stanford University
  • Sender: owner-wri-mathgroup at wolfram.com

Old-time FORTRAN programmers (like me) were taught (at least in early 
days) that division cost a lot more machine cycles than multiplication.  
So, if you had an expression like  y = x/c  that was going to be called 
many times inside a loop, where x and y were variables and c a constant, 
you'd code this as:

   (Outside the loop)

      cInverse = 1/c;

   (Begin loop structure)

      y = cInverse * x

Does this still make any sense in Mathematica?  Or is it a primitive 
relic of long-gone days?


  • Prev by Date: Re: unexpected Simplify[] ouput
  • Next by Date: Findminimum Question
  • Previous by thread: Urgent reply
  • Next by thread: Re: Division still cost more than multiplication?