Advanced maths

Sampled data rational approximation calculator with poles and residues

A rational approximation represents a function as a ratio of polynomials.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A rational approximation represents a function as a ratio of polynomials. Compared with a polynomial alone, that form can efficiently describe behavior influenced by nearby poles. This calculator starts with a finite collection of real sample locations and values and builds a small barycentric rational approximant.

THE FORMULAr(x)=sum_j w_j f_j/(x−z_j) divided by sum_j w_j/(x−z_j).

A worked example

The default samples of1/(1+x²) are reconstructed to near machine precision using3 support points. The fitted poles are approximately+i and−i.

Good to know

Real distinct6–60 sample pairs,1–8 terms leaving≥2 unused samples,tolerance1e−12–0.1;AAA-style least singular-vector selection and bounded polynomial pole extraction. Sample fit is not a global error guarantee.

Approximate sampled values with a rational function

A rational approximation represents a function as a ratio of polynomials. Compared with a polynomial alone, that form can efficiently describe behavior influenced by nearby poles. This calculator starts with a finite collection of real sample locations and values and builds a small barycentric rational approximant.

The method is an AAA-style greedy construction restricted to real samples. It returns selected support points, barycentric weights, polynomial coefficients, sample errors and candidate poles with residues when numerically resolved. It does not promise an optimal rational function over an entire interval or support arbitrary complex-valued sample data.

Sampled rational approximation with barycentric weightsSamples:1/(1+x²)Poles ≈ ±iThree support nodes
Scroll across to see the full diagram.
The default samples of1/(1+x²) are reconstructed to near machine precision using3 support points. The fitted poles are approximately+i and−i.

Compare this with the Pade rational approximant calculator from a Taylor coefficient list. Construct a barycentric rational fit from sampled function values; Taylor-coefficient matching cannot consume arbitrary sample pairs.

Enter distinct locations and their values

Each row supplies one real location and one real function value, with six to sixty distinct locations supported. Duplicate locations are rejected because the divided differences used by the fit would be undefined. If repeated measurements have noise, choosing how to combine them is a separate preprocessing decision.

The maximum support count is one to eight and must leave at least two unused samples. The relative tolerance controls the target residual at the supplied points. These controls balance approximation flexibility and numerical complexity; they do not express confidence intervals or a statistical noise model for the observed values.

Let support points adapt to residuals

The procedure begins from a constant approximation and repeatedly selects the remaining sample with the largest current absolute residual. At each stage it forms a Loewner-style divided-difference matrix and computes a weight vector from its smallest singular direction, represented here through a symmetric Gram eigenproblem.

Barycentric evaluation uses weighted sums of sample values divided by distance to each support location, normalized by the corresponding weighted denominator. At a support point, the stored function value is used directly. This representation avoids prematurely expanding every step into monomial coefficients, although the final diagnostic still exposes polynomial numerator and denominator coefficients.

Use the known rational example

The nine prefilled pairs sample one divided by one plus x squared on locations from minus two to two. This function has two nonreal simple poles, at plus i and minus i. Its real-valued samples are smooth and finite on the entered real interval even though the analytic function has complex singularities.

The default construction needs three support points and matches the frozen sample values to rounding precision. The extracted residues are approximately minus i divided by two at plus i and plus i divided by two at minus i. These exact facts provide independent checks for the approximation, pole extraction and residue convention.

Separate sample accuracy from interval accuracy

The maximum sample error compares the approximant with only the supplied values. A small residual at those locations does not rule out oscillation or a pole between them, especially when the sample set is sparse or noisy. No continuous interval error bound is inferred from a finite list.

A converged flag means the requested relative sample tolerance was reached before the support budget ended. If it is false, the page still reports the achieved bounded approximant and its residual rather than pretending the target was attained. Increase the support budget only after considering conditioning and whether additional sample information is needed.

Interpret poles and residues cautiously

After converting the barycentric representation to polynomial coefficients, the calculation finds denominator roots numerically and checks their polynomial residuals. A simple pole residue is numerator evaluated at the pole divided by the derivative of the denominator there. A nearly repeated pole can make that residue unstable or unresolved.

Near pole-zero cancellations can also create tiny-residue artifacts, often called Froissart behavior in rational approximation. This bounded implementation does not perform a full cleanup or guarantee physically meaningful poles. A fitted pole is a property of the approximant and should not automatically be labeled a singularity of an unknown sampled process.

Keep numerical conditioning visible

Monomial polynomial coefficients can be sensitive when locations span a large range or support points are nearly coincident. The page rejects unresolved pole extraction and evaluations too close to a fitted pole instead of returning nonfinite values. Rescaling the location variable can improve conditioning but transforms pole locations and residues in a predictable way.

The result is not a Padé series fit, a minimax interval approximation or a complex-domain AAA implementation. Retain the original real sample set, support budget and tolerance when comparing software. Checking new locations against independently known values is valuable evidence beyond the residuals at the points used to build the approximation.

A few questions, answered

Are samples Taylor coefficients?

No. These are function values at supplied nodes,so this is different from coefficient-based Padé approximation.

Does convergence guarantee no pole between samples?

No. The sample residual says nothing by itself about every point between nodes.

Are poles always simple?

No. Near-multiple pole extraction may be unresolved;residues are withheld when the derivative denominator is too small.

What if the term budget ends first?

The result explicitly reports whether the requested sample tolerance was reached;an unconverged bounded fit is not called converged.

Find your calculator

Start typing to explore the library.