Comment by don-bright

4 days ago

The other thing it can give you is computationally exact results since rationals are closed over division. Sine is interesting because where the input is rational the output is almost always irrational and where the output is rational the input is almost always irrational. In computation the first time you use sine in a program you have injected approximation. If you want to build things like reproducible code and geometric caching it can be interesting to compare using a purely rational computation system to an approximative system.

The trigonometric functions need not inject worse approximations than division.

If you compute trigonometric functions where the arguments are binary floating-point numbers and you measure the angles in cycles, not in radians (using radians is always a huge mistake in my opinion), the results can be expressed exactly using rational operations and the sqrt function.

You could compute them symbolically and use such symbolic expressions for exact computation, like you use rational numbers.

If you compute them numerically, computing a sqrt does not need more time than a division and correct rounding or computing an arbitrary number of digits are also not more difficult than for division.

Of course, you typically do not care about this, so you can just compute the trigonometric functions approximately, like you also do with division and sqrt, and in a similar time.