Exploring the computational errors of the tangent function tan(x) and cotangent function cot(x) in MATLAB near numbers around
Example 1. Suppose Calculate and in MATLAB.
Let's just post the figure directly.
From the above figure, it can be seen that the two outputs from MATLAB are
and
However, the correct values with 16 significant digits are 0.2746143419922914e-6 and 0.3641470408082585e7, respectively (as provided by ISRealsoft).
Thus, the outputs of MATLAB contain 9 and 8 incorrect digits, with error rates of 9/16 = 56.25% and 8/16 = 50% respectively for the significant figures.
Top comments (0)