title: C++ exp LUT (lookup table)
body: <p>In a C++ CPU-bound simulation that I'm writing, I've traced a bottleneck via valgrind in my program to <code>cmath::exp</code>. It currently eats over 40% of my simulation time. I can bound the input to a relatively small domain, but I'd like to control the accuracy. I was considering moving to a LUT (lookup table) to replace <code>exp</code> but I'm not quite sure how to do this the "right way"(tm). Concerns I have:</p>
  
  <ol>
  <li>Large lookup tables will not fit in the cache thus slowing access</li>
  <li>Best way to convert a double input to an integer for access into the lookup table</li>
  <li>Does the answer to (2) depend on the slope of the input function?</li>
  <li>Am I reinventing the wheel - has this already been done before?</li>
  </ol>
  
  <p>What is the best way to implement/(include from a library) a LUT for <code>exp</code>?</p>