title: What algorithm used in interp1d function in scipy.interpolate
body: <p>So i was writing a python program for my numerical course, and I had to code a cubic spline program. So i implement the formula for cubic spline given in books like <a href="https://rads.stackoverflow.com/amzn/click/com/0073401064" rel="nofollow noreferrer" rel="nofollow noreferrer">Numerical methods by Chapra and canale</a> and <a href="https://rads.stackoverflow.com/amzn/click/com/1133103715" rel="nofollow noreferrer" rel="nofollow noreferrer">Numerical mathematics by chenny and kincaid</a>.</p>
  
  <p>so my data is </p>
  
  <pre><code>x=[1.0,3.0,4.0,7.0]
  y=[1.5,4.5,9.0,25.5]
  </code></pre>
  
  <p>Using this data and applying cubic spline I get for <code>x=1.5</code> , <code>y=1.79122340426</code></p>
  
  <p>While using this same data but using the scipy function gives:</p>
  
  <pre><code>  &gt;&gt;&gt; scipy.interpolate.interp1d(x, y, kind='cubic')(1.5)
  array(1.265624999999932)
  </code></pre>
  
  <p>So, why is that difference in result? It is obvious that they are not using the same formula.
  What is the cubic spline formula used in that scipy function? Is it a natural cubic spline formula or something improved?
  Note: The value 1.2656 is more acurate.</p>