Incorrect calculations by the computer: sin(x) and cos(x)

Caleb Zhao - Nov 2 - - Dev Community

From IEEE-754-2019, it is known that the domain of trigonometric functions is the set of real numbers.
Example 1. Calculate sin(20100) \sin(20^{100}) and cos(20100) \cos(20^{100}) in MATLAB.

Let's just post the picture directly.

MATLAB output
However, the correct values are 0.4559851... and -0.8899874..., respectively (as provided by ISRealsoft).
Thus, the outputs of MATLAB are all incorrect results.

. . .
Terabox Video Player