title: Why is the pow function slower than simple operations?
body: <p>From a friend of mine, I heard that the pow function is slower than its equivalent in simply multiplying the base by itself, the amount of times as its exponent. For example, according to him,</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main () {
      double e = 2.71828
      e2 = pow (e, 2.0)
      printf("%le", e2)
  }
  </code></pre>
  
  <p>is slower than</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      double e = 2.71828
      e2 = e * e
      printf("%le", e2)
  }
  </code></pre>
  
  <p>As a novice, I would think they both compile at the same speed, and by the same logic, I would prefer the former for its typical pithiness.  So, why is the former block of code slower than the latter one?</p>