How Matlab computes trigonometric functions?
Ältere Kommentare anzeigen
When I learned the CORDIC algorithm, I had a question to Matlab.
How Matlab computes trigonometric function?
for e.g. in case of cosd(27)
1. Does answer evaluate by Taylor series using floating point computation or by Look Up Table from Taylor?
If both are not, what algorithm is used for computation?
2. If it uses Taylor series, what is the last order of Taylor series? (Just N that satisfies fractional bit of floating point?)
3. What is the accuracy of trigonometric function?
(I want to know whether Matlab gives 52(53) bit fractional accuracy using (some) nearest rounding in double precision value)
1 Kommentar
dpb
am 26 Nov. 2016
In general, TMW doesn't comment on such internals but for library functions such as this, I'd expect Matlab simply relies on the underlying compiler standard libraries rather than reinventing the wheel...
Akzeptierte Antwort
Weitere Antworten (2)
Steven Lord
am 27 Nov. 2016
1 Stimme
Walter Roberson
am 26 Nov. 2016
0 Stimmen
cosd() checks for some special cases, and if it is not one of the special cases then it transforms to radians and invokes cos()
cos() uses the underlying hardware instructions.
You might be interested in the discussion at https://members.loria.fr/PZimmermann/papers/decimalexp.pdf which gives some reasons why it is difficult to round such functions correctly.
Kategorien
Mehr zu Trigonometry finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!