Previous Up Next

5.48.4  Minimax polynomial approximation: minimax

The function minimax is called by entering :


where expr is an univariate expression (e.g.  f(x) ) to approximate, var is a variable (e.g.  x ), [a,b]⊂ℝ and n∈ℕ . Expression expr must be continuous on [a,b] . The function returns minimax polynomial (e.g.  p(x) ) of degree n or lower that approximates expr on [a,b] . The approximation is found by applying Remez algorithm.

If the fourth argument is specified, m is used to limit the number of iterations of the algorithm. It is unlimited by default.

The largest absolute error of the approximation p(x) , i.e.  maxaxb|f(x)−p(x)| , is printed in the message area.

Since the coefficients of p are computed numerically, one should avoid setting n unnecessary high as it may result in a poor approximation due to the roundoff errors.

Input :


Output :


The largest absolute error of this approximation is 5.85234008632× 10−6 .

Previous Up Next