code: def cubic_interpolate(x, y, precision=250, **kwargs):
      """
      Interpolate x, y using a cubic algorithm
      https://en.wikipedia.org/wiki/Spline_interpolation
      """
      n = len(x) - 1
      # Spline equation is a + bx + cx² + dx³
      # ie: Spline part i equation is a[i] + b[i]x + c[i]x² + d[i]x³
      a = y
      b = [0] * (n + 1)
      c = [0] * (n + 1)
      d = [0] * (n + 1)
      m = [0] * (n + 1)
      z = [0] * (n + 1)
  
      h = [x2 - x1 for x1, x2 in zip(x, x[1:])]
      k = [a2 - a1 for a1, a2 in zip(a, a[1:])]
      g = [k[i] / h[i] if h[i] else 1 for i in range(n)]
  
      for i in range(1, n):
          j = i - 1
          l = (
              1 / (2 * (x[i + 1] - x[j]) - h[j] * m[j])
              if x[i + 1] - x[j]
              else 0
          )
          m[i] = h[i] * l
          z[i] = (3 * (g[i] - g[j]) - h[j] * z[j]) * l
  
      for j in reversed(range(n)):
          if h[j] == 0:
              continue
          c[j] = z[j] - (m[j] * c[j + 1])
          b[j] = g[j] - (h[j] * (c[j + 1] + 2 * c[j])) / 3
          d[j] = (c[j + 1] - c[j]) / (3 * h[j])
  
      for i in range(n + 1):
          yield x[i], a[i]
          if i == n or h[i] == 0:
              continue
          for s in range(1, precision):
              X = s * h[i] / precision
              X2 = X * X
              X3 = X2 * X
              yield x[i] + X, a[i] + b[i] * X + c[i] * X2 + d[i] * X3
  
imports: from __future__ import division
  from math import sin
label_desc: Use image node_id 2 for calling a global function with example usage: cubic_interpolate(x, y, precision) without return types