title: Exponential Computation by Approximation in Linux Kernel's source code
body: <p>I have to modify a little bit of TCP algorithm in Linux Kernel's source code.
  In it, I have to compute Congestion Window as following:</p>
  
  <pre><code>cwnd = cwnd (1-x^alpha)     where alpha and x are float type and satisfy 0&lt;x&lt;1, alpha &gt;0.
  </code></pre>
  
  <p>Normally, one has to use #include Math.h and pow() function, right?</p>
  
  <p>But I don't know if exponential computation can make operations slower.</p>
  
  <p>So, I think of Bernoulli's inequality</p>
  
  <pre><code>(1-a)^x &lt; 1-ax          where 0&lt;a&lt;1
  </code></pre>
  
  <p>So in my case, am I allowed to approximate the computation by using Bernoulli's.</p>
  
  <pre><code>x^alpha = (1-(1-x))^alpha ~ 1 - alpha(1-x)
  </code></pre>
  
  <p>If this is not OK then is there any way out.
  Please help me with that.</p>