# rationalInterpolation -- numerically interpolate rational functions

## Synopsis

• Usage:
(n,d) = rationalInterpolation(pts, vals, numBasis, denBasis)
(n,d) = rationalInterpolation(pts, vals, numDenBasis)
• Inputs:
• pts, a list, of row matrices corresponding to points at which the rational function was evaluated
• vals, a list, of numbers corresponding to evaluations of the rational function
• numBasis, , a row of monomials, the monomial support of the numerator
• denBasis, , a row of monomials, the monomial support of the numerator
• numDenBasis, , a row of monomials, the monomial support of both the numerator and denominator
• Optional inputs:
• Tolerance => , default value .000001, default value 1e-6
• Outputs:
• n, , the numerator of the rational function
• d, , the denominator of the rational function

## Description

Given a set 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 polynomials $g$ and $h$ have monomial support numBasis and denBasis respectively.

 i1 : R = CC[x,y] o1 = R o1 : PolynomialRing i2 : pts = {point{{1,0}}, point{{0,1}}, point{{1,1}}, point{{-1,-1}}, point{{-1,0}}} o2 = {{1, 0}, {0, 1}, {1, 1}, {-1, -1}, {-1, 0}} o2 : List i3 : vals = {1, 0, 1/2, -1/2, -1} 1 1 o3 = {1, 0, -, - -, -1} 2 2 o3 : List i4 : numBasis = matrix{{x,y}} o4 = | x y | 1 2 o4 : Matrix R <--- R i5 : denBasis = matrix{{x^2,y^2}} o5 = | x2 y2 | 1 2 o5 : Matrix R <--- R i6 : rationalInterpolation(pts, vals, numBasis, denBasis) 2 2 o6 = (1x, 1x + y ) o6 : Sequence

The output corresponds to the function $x / (x^2 + y^2)$. If no fitting rational function is found, the method returns an error.

The method rationalInterpolation(List,List,Ring) can be used to choose monomial supports automatically.

## Caveat

The method uses the first point to remove $0/0$ rational functions. Because of this, the first entry of val should be non-zero.