skzeros.AAA

skzeros.AAA(f, r, *, rtol=1e-13, max_iter=100, err_on_max_iter=True, initial_samples=16)

Compute a rational approximation of a function using the continuum AAA algorithm.

Parameters:
  • f (callable) – Function to approximate, should accept a 1D array and return a 1D array.

  • r (Domain) – Domain on which to approximate the function.

  • rtol (float, optional) – Relative tolerance of the approximation, by default 1e-13

  • max_iter (int, optional) – Maximum number of iteration (degree of the rational approximation), by default 100.

  • err_on_max_iter (bool, optional) – Whether to raise an error if max_iter is reached and but a relative accuracy of rtol has not been achieved, by default True.

  • initial_samples (int, optional) – The initial number of samples of the function to take, by default 16. Subsequent initerations will take max(3, initial_samples - m) samples, where m is the number of iterations already performed.

Returns:

  • z – Array of support points of the rational approximation.

  • f – Values of the function at the support points.

  • w – Barycentric weights of the rational approximation.