minimax - Maple Help

# Online Help

###### All Products    Maple    MapleSim

numapprox

 minimax
 minimax rational approximation

 Calling Sequence minimax(f, x=a..b, [m, n], w, 'maxerror') minimax(f, a..b, [m, n], w, 'maxerror')

Parameters

 f - procedure or expression representing the function x - variable name appearing in f, if f is an expression a, b - numerical values specifying the interval of approximation m - integer specifying the desired degree of the numerator n - integer specifying the desired degree of the denominator w - (optional) procedure or expression specifying the weight function, default 1 maxerror - (optional) a name which will be assigned the minimax norm

Description

 • This procedure computes the best minimax rational approximation of degree (m, n) for a given real function f(x) on the interval [a, b] with respect to the positive weight function w(x), via the Remez algorithm.
 • Specifically, it computes the rational expression $\frac{p\left(x\right)}{q\left(x\right)}$ such that

 $\mathrm{max}\left(w\left(x\right)\left|f\left(x\right)-\frac{p\left(x\right)}{q\left(x\right)}\right|,x\in \left[a,b\right]\right)$ (1)

 is minimized over all rational expressions $\frac{p\left(x\right)}{q\left(x\right)}$ with numerator of degree <= m and denominator of degree <= n.
 • Note that if f(x) is nonzero on the interval of approximation then the relative error will be minimized by specifying the weight function $w\left(x\right)=\frac{1}{\left|f\left(x\right)\right|}$.
 • If the second argument is a range a..b then the first argument is understood to be a Maple operator, and the result will be returned as an operator. If the second argument is an equation $x=a..b$ then the first argument is understood to be an expression in the variable x, and the result will be returned as an expression. In all cases, the numerator and denominator of the result are each expressed in Horner (nested multiplication) form.
 • Note that for the purpose of evaluating a rational function efficiently (minimizing the number of arithmetic operations), the rational function should be converted to a continued-fraction form. See numapprox[confracform].
 • If $n=0$ or if the third argument is simply an integer m then the best minimax polynomial approximation of degree m is computed.
 • If the fourth argument w is specified then it is assumed to be an operator if f is an operator, and it is assumed to be an expression if f is an expression. If the fourth argument is omitted then the weight function is understood to be $w\left(x\right)=1$ for all x.
 • If the fifth argument 'maxerror' is present then it must be a name. Upon return, its value will be an estimate of the minimax norm specified by equation (1) above.
 • Various levels of user information will be displayed during the computation if infolevel[minimax] is assigned values between 1 and 3.
 • The command with(numapprox,minimax) allows the use of the abbreviated form of this command.

Examples

 > $\mathrm{with}\left(\mathrm{numapprox}\right):$
 > $\mathrm{minimax}\left(\mathrm{exp}\left(x\right),x=0..1,5\right)$
 ${0.9999988704}{+}\left({1.000079454}{+}\left({0.4990960955}{+}\left({0.1704020473}{+}\left({0.03480043573}{+}{0.01390379644}{}{x}\right){}{x}\right){}{x}\right){}{x}\right){}{x}$ (1)
 > $\mathrm{minimax}\left(\frac{\mathrm{sin}\left(x\right)}{x},x=0..2,\left[2,2\right]\right)$
 $\frac{{0.9502547388}{+}\left({-}{0.0529094903}{-}{0.08416376516}{}{x}\right){}{x}}{{0.9501754291}{+}\left({-}{0.05104192031}{+}{0.06724432750}{}{x}\right){}{x}}$ (2)
 > $\mathrm{minimax}\left(\mathrm{sin}+\mathrm{cos},-1..1,\left[1,2\right]\right)$
 ${x}{↦}\frac{{0.8647502931}{+}{1.115735845}{\cdot }{x}}{{0.8498225985}{+}\left({0.2651029400}{+}{0.3003548030}{\cdot }{x}\right){\cdot }{x}}$ (3)
 > $\mathrm{Digits}≔14$
 ${\mathrm{Digits}}{≔}{14}$ (4)
 > $\mathrm{minimax}\left(x↦\mathrm{exp}\left(x\right),0..1,\left[3,3\right],x↦\frac{1}{\mathrm{exp}\left(x\right)},'\mathrm{maxerror}'\right)$
 ${x}{↦}\frac{{1.2602800366369}{+}\left({0.66158211600441}{+}\left({0.14246094729905}{+}{0.013527436108012}{\cdot }{x}\right){\cdot }{x}\right){\cdot }{x}}{{1.2602800381631}{+}\left({-}{0.59869807134142}{+}\left({0.11102132866190}{-}{0.0082048023700096}{\cdot }{x}\right){\cdot }{x}\right){\cdot }{x}}$ (5)
 > $\mathrm{maxerror}$
 ${1.2110972781516}{×}{{10}}^{{-9}}$ (6)

 See Also