title: Getting a random double value between -1 and 1
body: <p>I'm creating a Neural Network in Java and need to create a method to generate random weights initially.  </p>
  
  <p>I need to create a function that returns a random double value between -1 and 1 but not sure of the logic for doing this so any help would be most appreciated. </p>