How does matlab provide precise Taylor expansions for some truncation order?
Show older comments
In ordinary C language programming, dealing with fraction often causes some errors due to floating-point expression problems. Taylor expansion by nature has factorials in denominators, so how does Matlab deal with them when computing Taylor series up to certain truncation order (e.g. computing taylor series up to t^10, or t^20 for a function cos(t), where 10 or 20 would be truncation order)?
Accepted Answer
More Answers (1)
James Tursa
on 13 Nov 2015
Edited: James Tursa
on 13 Nov 2015
0 votes
Not sure what you are really asking here. There is a taylor function in the Symbolic Toolbox that does such expansions for whatever order you want. Then of course you could use that as the basis for a calculation with doubles, and you would get whatever you get as far as the calculation error was concerned.
But for the actual library functions such as cos and sin that are called for doubles, it isn't necessarily going to be the case at all that a Taylor series expansion is used. It could be some form of input range reduction followed by a rational function approximation is used, for instance. So your question about Taylor series truncation order wouldn't even apply.
Categories
Find more on Calculus in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!