Re: desperately seeking better minimax approximation package
- To: mathgroup at smc.vnet.net
- Subject: [mg4194] Re: desperately seeking better minimax approximation package
- From: Paul Abbott <paul at earwax.pd.uwa.edu.au>
- Date: Thu, 13 Jun 1996 23:09:36 -0400
- Organization: University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
John Bunda wrote: > Specifically, what we'd like to be able to do is approximate > a continuous function with a even or odd polynomial, such that > the maximum error is minimized. What do you need this for? Aren't other types of approximations better in general (e.g. Pade, Rational functions, Chebyshev polynomial expansion, ...)? >For example, sin(x) could be > approximated as: > p(x) = c1x + c3*x^3 + c5*x^5 + ... > where c1, c3, and c5 are chosen to minimize the maximum error > between p(x) and sin(x). The trouble with the minimax package > that comes with Mathematica is it requires me to have terms > with strictly sequential powers - I can't skip the x^2 and x^4 > terms like in the above series. Perhaps you can use <<NumericalMath`Approximations` to do what you want in general? Noting that Sin[Sqrt[x]]/Sqrt[x] + O[x]^3 2 x x 3 1 - - + --- + O[x] 6 120 you see that you can compute a MiniMaxApproximation for Sin[Sqrt[x]]/Sqrt[x] over some interval (0 excluded here): MiniMaxApproximation[Sin[Sqrt[x]]/Sqrt[x], {x, {0.000001, Pi/2}, 3, 0}]; Then pull out the approximation: sin[x_] = %[[2,1]]; and turn this into the expansion you want: x sin[x^2] // Expand 3 0.9999998550999375 x - 0.16666387574085572 x + 5 7 0.00832472373825108 x - 0.00018978623422653169 x The maximum error occurs for x = Pi/2. Cheers, Paul _________________________________________________________________ Paul Abbott Department of Physics Phone: +61-9-380-2734 The University of Western Australia Fax: +61-9-380-1014 Nedlands WA 6907 paul at physics.uwa.edu.au AUSTRALIA http://www.pd.uwa.edu.au/Paul _________________________________________________________________ ==== [MESSAGE SEPARATOR] ====