title: A good way to do a fast divide in C++?
body: <p>Sometimes I see and have used the following variation for a fast divide in C++ with floating point numbers.</p>
  
  <pre><code>// orig loop
  double y = 44100.0;
  for(int i=0; i&lt;10000; ++i) {
  double z = x / y;
  }
  
  // alternative
  double y = 44100;
  double y_div = 1.0 / y;
  
  for(int i=0; i&lt;10000; ++i) {
  double z = x * y_div;
  }
  </code></pre>
  
  <p>But someone hinted recently that this might not be the most accurate way.</p>
  
  <p>Any thoughts?</p>