Is this just a very smart optimizer that can reduce<p><pre><code> tot=x+x+x+x+x+x+x+x+x+x+x+x+x+x+x
</code></pre>
to<p><pre><code> x2=x+x
x4=x2+x2
x8=x4+x4
tot=x+x2+x4+x8
</code></pre>
or I am missing something?<p>Note that the first code is O(N=15) and the second one is O(log(N)=4).