title: Exponent calculation speed
body: <p>I am currently testing Julia (I've worked with Matlab)</p>
  
  <p>In matlab the calculation speed of N^3 is slower than NxNxN. This doesn't happen with N^2 and NxN. They use a different algorithm to calculate higher-order exponents because they prefer accuracy rather than speed.</p>
  
  <p>I think Julia do the same thing. </p>
  
  <p>I wanted to ask if there is a way to force Julia to calculate the exponent of N using multiplication instead of the default algorithm, at least for cube exponents.</p>
  
  <p>Some time ago a I did a few test on matlab of this.  I made a translation of that code to julia.</p>
  
  <p>Links to code:
  <a href="http://pastebin.com/bbeukhTc" rel="nofollow">http://pastebin.com/bbeukhTc</a>
  (I cant upload all the links here :( )</p>
  
  <p><strong>Results of the scripts on Matlab 2014:</strong></p>
  
  <p>Exponente1</p>
  
  <p>Elapsed time is 68.293793 seconds. (17.7x times of the smallest)</p>
  
  <p>Exponente2</p>
  
  <p>Elapsed time is 24.236218 seconds. (6.3x times of the smallests)</p>
  
  <p>Exponente3</p>
  
  <p>Elapsed time is 3.853348 seconds.</p>
  
  <p><strong>Results of the scripts on Julia 0.46:</strong></p>
  
  <p>Exponente1</p>
  
  <p>18.423204 seconds (8.22 k allocations: 372.563 KB) (51.6x times of the smallest)</p>
  
  <p>Exponente2</p>
  
  <p>13.746904 seconds (9.02 k allocations: 407.332 KB) (38.5 times of the smallest)</p>
  
  <p>Exponente3</p>
  
  <p>0.356875 seconds (10.01 k allocations: 450.441 KB)</p>
  
  <p>In my tests julia is faster than Matlab, but i am using a relative old version. I cant test other versions.</p>