title: Speeding up Math calculations in Java
body: <p>I have a neural network written in Java which uses a sigmoid transfer function defined as follows:</p>
  
  <pre><code>private static double sigmoid(double x)
  {
      return 1 / (1 + Math.exp(-x));
  }
  </code></pre>
  
  <p>and this is called <em>many</em> times during training and computation using the network.  Is there any way of speeding this up?  It's not that it's slow, it's just that it is used a lot, so a small optimisation here would be a big overall gain.</p>