📄 remez.qbk
字号:
of rational approximations quite considerably. It is often desirableto obtain a rational rather than polynomial approximation none the less:rational approximations will often match more difficult to approximatefunctions, to greater accuracy, and with greater efficiency, than theirpolynomial alternatives. For example, if we takes our previous exampleof an approximation to e[super x], we obtained 5x10[super -4] accuracywith an order 4 polynomial. If we move two of the unknowns into the denominatorto give a pair of order 2 polynomials, and re-minimise, then the peak relative error dropsto 8.7x10[super -5]. That's a 5 fold increase in accuracy, for the same number of terms overall.[h4 Practical Considerations]Most treatises on approximation theory stop at this point. However, froma practical point of view, most of the work involves finding the rightapproximating form, and then persuading the Remez method to convergeon a solution.So far we have used a direct approximation:f(x) = R(x)But this will converge to a useful approximation only if f(x) is smooth. Inaddition round-off errors when evaluating the rational form mean that thiswill never get closer than within a few epsilon of machine precision. Therefore this form of direct approximation is often reserved for situationswhere we want efficiency, rather than accuracy.The first step in improving the situation is generally to split f(x) intoa dominant part that we can compute accurately by another method, and a slowly changing remainder which can be approximated by a rational approximation.We might be tempted to write:f(x) = g(x) + R(x)where g(x) is the dominant part of f(x), but if f(x)\/g(x) is approximatelyconstant over the interval of interest then:f(x) = g(x)(c + R(x))Will yield a much better solution: here /c/ is a constant that is the approximatevalue of f(x)\/g(x) and R(x) is typically tiny compared to /c/. In this situationif R(x) is optimised for absolute error, then as long as its error is small comparedto the constant /c/, that error will effectively get wiped out when R(x) is added to/c/.The difficult part is obviously finding the right g(x) to extract from yourfunction: often the asymptotic behaviour of the function will give a clue, sofor example the function __erfc becomes proportional to e[super -x[super 2]]\/x as x becomes large. Therefore using:erfc(z) = (C + R(x)) e[super -x[super 2]]/xas the approximating form seems like an obvious thing to try, and does indeedyield a useful approximation.However, the difficulty then becomes one of converging the minimax solution.Unfortunately, it is known that for some functions the Remez method can leadto divergent behaviour, even when the initial starting approximation is quite good.Furthermore, it is not uncommon for the solution obtained in the first Remez stepabove to be a bad one: the equations to be solved are generally "stiff", oftenvery close to being singular, and assuming a solution is found at all, round-offerrors and a rapidly changing error function, can lead to a situation where theerror function does not in fact change sign at each control point as required.If this occurs, it is fatal to the Remez method. It is also possible toobtain solutions that are perfectly valid mathematically, but which arequite useless computationally: either because there is an unavoidable amountof roundoff error in the computation of the rational function, or becausethe denominator has one or more roots over the interval of the approximation.In the latter case while the approximation may have the correct limiting value atthe roots, the approximation is nonetheless useless.Assuming that the approximation does not have any fatal errors, and that the onlyissue is converging adequately on the minimax solution, the aim is toget as close as possible to the minimax solution before beginning the Remez method.Using the zeros of a Chebyshev polynomial for the initial interpolation is a good start, but may not be ideal when dealing with relative errors and\/orrational (rather than polynomial) approximations. One approach is to skewthe initial interpolation points to one end: for example if we raise theroots of the Chebyshev polynomial to a positive power greater than 1 then the roots will be skewed towards the middle of the \[-1,1\] interval, while a positive power less than onewill skew them towards either end. More usefully, if we initially rescale thepoints over \[0,1\] and then raise to a positive power, we can skew them to the left or right. Returning to our example of e[super x][space] over \[-1,1\], the initialinterpolated form was some way from the minimax solution:[$../graphs/remez-2.png]However, if we first skew the interpolation points to the left (rescale themto \[0, 1\], raise to the power 1.3, and then rescale back to \[-1,1\]) wereduce the error from 1.3x10[super -3][space]to 6x10[super -4]:[$../graphs/remez-5.png]It's clearly still not ideal, but it is only a few percent away fromour desired minimax solution (5x10[super -4]).[h4 Remez Method Checklist]The following lists some of the things to check if the Remez method goes wrong, it is by no means an exhaustive list, but is provided in the hopes that it willprove useful.* Is the function smooth enough? Can it be better separated intoa rapidly changing part, and an asymptotic part?* Does the function being approximated have any "blips" in it? Checkfor problems as the function changes computation method, orif a root, or an infinity has been divided out. The telltalesign is if there is a narrow region where the Remez method willnot converge.* Check you have enough accuracy in your calculations: remember thatthe Remez method works on the difference between the approximationand the function being approximated: so you must have more digits ofprecision available than the precision of the approximationbeing constructed. So for example at double precision, youshouldn't expect to be able to get better than a float precisionapproximation.* Try skewing the initial interpolated approximation to minimise theerror before you begin the Remez steps.* If the approximation won't converge or is ill-conditioned from one startinglocation, try starting from a different location.* If a rational function won't converge, one can minimise a polynomial(which presents no problems), then rotate one term from the numerator tothe denominator and minimise again. In theory one can continue movingterms one at a time from numerator to denominator, and then re-minimising, retaining the last set of control points at each stage.* Try using a smaller interval. It may also be possible to optimise overone (small) interval, rescale the control points over a larger interval,and then re-minimise.* Keep absissa values small: use a change of variable to keep the abscissaover, say \[0, b\], for some smallish value /b/.[h4 References]The original references for the Remez Method and it's extensionto rational functions are unfortunately in Russian:Remez, E.Ya., ['Fundamentals of numerical methods for Chebyshev approximations], "Naukova Dumka", Kiev, 1969.Remez, E.Ya., Gavrilyuk, V.T., ['Computer development of certain approaches to the approximate construction of solutions of Chebyshev problems nonlinearly depending on parameters], Ukr. Mat. Zh. 12 (1960), 324-338.Gavrilyuk, V.T., ['Generalization of the first polynomial algorithm of E.Ya.Remez for the problem of constructing rational-fractional Chebyshev approximations], Ukr. Mat. Zh. 16 (1961), 575-585.Some English language sources include:Fraser, W., Hart, J.F., ['On the computation of rational approximations to continuous functions], Comm. of the ACM 5 (1962), 401-403, 414.Ralston, A., ['Rational Chebyshev approximation by Remes' algorithms], Numer.Math. 7 (1965), no. 4, 322-330.A. Ralston, ['Rational Chebyshev approximation, Mathematical Methods for Digital Computers v. 2] (Ralston A., Wilf H., eds.), Wiley, New York, 1967, pp. 264-284.Hart, J.F. e.a., ['Computer approximations], Wiley, New York a.o., 1968.Cody, W.J., Fraser, W., Hart, J.F., ['Rational Chebyshev approximation using linear equations], Numer.Math. 12 (1968), 242-251.Cody, W.J., ['A survey of practical rational and polynomial approximation of functions], SIAM Review 12 (1970), no. 3, 400-423.Barrar, R.B., Loeb, H.J., ['On the Remez algorithm for non-linear families], Numer.Math. 15 (1970), 382-391.Dunham, Ch.B., ['Convergence of the Fraser-Hart algorithm for rational Chebyshev approximation], Math. Comp. 29 (1975), no. 132, 1078-1082.G. L. Litvinov, ['Approximate construction of rationalapproximations and the effect of error autocorrection],Russian Journal of Mathematical Physics, vol.1, No. 3, 1994.[endsect][/section:remez The Remez Method][/ Copyright 2006 John Maddock and Paul A. Bristow. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt).]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -