How does matlab provide precise Taylor expansions for some truncation order?
Mostrar comentarios más antiguos
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)?
Respuesta aceptada
Más respuestas (1)
James Tursa
el 13 de Nov. de 2015
Editada: James Tursa
el 13 de Nov. de 2015
0 votos
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.
Categorías
Más información sobre Calculus en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!