# Rational interpolation: thiele

### 5.27.32 Rational interpolation: thiele

The thiele command finds the rational interpolation.

- thiele takes two arguments:
  - data, a matrix with two columns. The first column contains the x coordinates and the second column contains the corresponding y coordinates.
    Instead of a single matrix, the data can be given as a vector of x coordinates and a vector of y coordinates (in which casethe call to thiele has three arguments).
  - v, an identifier, number or symbolic expression (default: x).
- thiele(data,v) returns R(v) where R is the rational interpolant.

Instead of a single matrix data, two vectors x=(x1,x2,…,xn) and y=(y1,y2,…,yn) This method computes Thiele interpolated continued function based on the concept of reciprocal differences.

It is not guaranteed that R is continuous, i.e. it may have singularities in the shortest segment which contains all components of the x coordinates.

#### Examples.

- Input:
  thiele([[1,3],[2,4],[4,5],[5,8]],x)
  Output:

  19 x2−45 x−154
  18 x−78

- Input:
  thiele([1,2,a],[3,4,5],3)
  Output:

  13 a−29
  3 a−7

- In the following example, data is obtained by sampling the function f(x)=(1−x4) e1−x3.
  Input:

  data_x:=[-1,-0.75,-0.5,-0.25,0,
  0.25,0.5,0.75,1,1.25,1.5,1.75,2];
  data_y:=[0.0,2.83341735599,2.88770329586,
  2.75030303645,2.71828182846,2.66568510781,
  2.24894558809,1.21863761951,0.0,-0.555711613283,
  -0.377871362418,-0.107135851128,-0.0136782294833];
  thiele(data_x,data_y,x)

  Output:

  | ⎛ ⎝ | −

  1.55286115659 x6+5.87298387514 x5−5.4439152812 x4+1.68655817708 x3

  −

  2.40784868317 x2−7.55954205222 x+9.40462512097 | ⎞ ⎠ | /

  | ⎛ ⎝

  x6−1.24295718965 x5−1.33526268624 x4+4.03629272425 x3

  −

  0.885419321 x2−2.77913222418 x+3.45976823393 | ⎞ ⎠