6.53.4 Minimax polynomial approximation: minimax
The minimax command finds the minimax polynomial approximation of a
continuous function on a bounded interval using the Remez algorithm.
-
minimax takes three mandatory argument and one
optional argument:
-
expr, a univariate expression representing a
continuous function.
- var=a..b, a variable and the interval.
- n, a positive integer, the degree of the resulting polynomial.
- Optionally limit=m, where m is a positive
integer specifying the number of iterations of the Remez
algorithm. (By default, the number of iterations is unlimited.)
- minimax(expr,var=a..b,n ⟨limit=m⟩)
returns the minimax polynomial approximation of degree n or lower
that approximates expr on [a,b]. The largest absolute
error of the resulting polynomial will be printed in the message area.
Since the coefficients of p are computed numerically, you should
avoid setting n unnecessary high as it may result in a poor
approximation due to the roundoff errors.
Example.
Input:
minimax(sin(x),x=0..2*pi,10)
Output:
| | max. absolute error: 5.85231264871e-01 | | | | | | | | | |
| 5.85141928628×10−6+0.999777263417 x+0.001400152516 x2 | | | | | | | | | |
| −0.170089663468 x3+0.0042684302281 x4+0.00525794778108 x5 | | | | | | | | | |
| +0.00135760211866 x6−0.000570502070425 x7 | | | | | | | | | |
| + | ⎛
⎝ | 6.0729711779×10−5 | ⎞
⎠ | x8
− | ⎛
⎝ | 2.14787415748×10−6 | ⎞
⎠ | x9 |
| | | | | | | | | |
| − | ⎛
⎝ | 1.49765719172×10−15 | ⎞
⎠ | x10
|
| | | | | | | | | |
|