title: Syntax of a SIgmoid Function - Javascript
body: <p>I've been trying to make this function work to no avail. Could anyone potentially shed some light?</p>
  
  <p>It is a Sigmoid with some applied boundaries/transormations.
  <a href="https://www.desmos.com/calculator/roqomljbzs" rel="nofollow noreferrer">Here's the link to the function in desmos</a>. That is working perfectly. It looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/SIKpU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SIKpU.png" alt="sigmoid image"></a></p>
  
  <p>And that's the formula:</p>
  
  <p><a href="https://i.stack.imgur.com/9yunl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9yunl.png" alt="the function"></a></p>
  
  <p>But when I tried to 'translate' that into my Javascript code, I can't get it to perform as intended. Here's what I tried: </p>
  
  <pre class="lang-js prettyprint-override"><code>y = m*((0.5/(1/(1+(Math.pow(Math.E,((-1)*d))))-0.5))*((1/((1+(Math.pow(Math.E, (((-1)*d)*(1/h)*x-1))))))-0.5))+0.5;
  </code></pre>
  
  <p>The function is not being bounded as expected and it should be passing through 0,0 like in the Desmos example... but it isn't! I know there are probably too many brackets in there and the solution will be glaringly obvious to someone with better understanding of this so, could you help me please? </p>
  
  <p>Thank you!!</p>