Given a list of points $pts = \{p_1,\dots,p_k\}$ and values $vals = \{v_1,\dots,v_k\}$, attempts to find a rational function $f = g/h$, such that $f(p_i) = v_i$. The method first tries to find polynomials $g,h$ of degree 0; if this fails, it tries to find $g,h$ of degree 1 and so on. This procedure stops when there are not enough points to compute the next degree, in which case an error will be thrown.
i1 : R = CC[x] o1 = R o1 : PolynomialRing |
i2 : pts = {point{{0}},point{{1}},point{{2}}, point{{3}}, point{{4}}} o2 = {{0}, {1}, {2}, {3}, {4}} o2 : List |
i3 : vals = {-1, 1/2, 1, 5/4, 7/5} 1 5 7 o3 = {-1, -, 1, -, -} 2 4 5 o3 : List |
i4 : rationalInterpolation(pts, vals, R) -- warning: experimental computation over inexact field begun -- results not reliable (one warning given per session) o4 = (2x - 1, 1x + 1) o4 : Sequence |