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 picture directly.
However, the correct values with 16 significant digits are -0.7837941516239115e10 and -0.1275845192169577e-9, respectively (as provided by ISRealsoft).
Thus, the output of MATLAB contains only 4 and 5 correct digits, with error rates of (16-4)/16 = 75% and (16-5)/16 = 68.75% respectively for the significant figures.