title: Entrywise addition of two double arrays using AVX
body: <p>I need a function to entrywise add the elements of two double arrays and store the result in a third array. Currently I use (simplified)</p>
  
  <pre><code>void add( double* result, const double* a, const double* b, size_t size) {
      memcpy(result, a, size*sizeof(double));
      for(size_t i = 0; i &lt; size; ++i) {
          result[i] += b[i];
      }
  }
  </code></pre>
  
  <p>As far as I know the memcpy function uses AVX. In order to improve the performance I would like to also enforce AVX use for the addition. This should be one of the most basic examples for AVX, however I couldn't find any description how to do this in <code>C</code>/<code>C++</code>. I would like to avoid the use of external libraries if possible.</p>