Why cube is faster than square
<p>I wrote this:</p>

<pre><code>  var max = 0xffffff * 4;
  var step = 1 / max;
  function cube() {
    var result = 0.;
    for (var x = 0.; x &lt; 1; x += step) {
      result += x * x * x;
    }
    return result;
  }
  function mul() {
    var result = 0.;
    for (var x = 0.; x &lt; 1; x += step) {
      result += x * x;
    }
    return result;
  }
  function go() {
    var r = '';
    r += cube() + ' \n';
    r += mul() + ' \n';
    alert(r);
  }
</code></pre>

<p>and see the result in Chrome profiler:</p>

<pre><code>mul: 106ms 
cube: 87ms
</code></pre>

<p>How is that possible?</p>