Post Reply 
sine of an angle in degree mode
01-24-2018, 03:38 PM (This post was last modified: 01-24-2018 04:34 PM by emece67.)
Post: #17
RE: sine of an angle in degree mode
(01-24-2018 12:37 PM)rflesch Wrote:  "What, you don't know why the sine of zero is zero?
Sorry Thomas I did not want to bother you. I assume we all know what the sine of zero is.
Question is, how does the algorithm used in a calculator 'know' that it's exactly zero.

The sine function is an odd function. In case you use a polynomial of some degree to approximate it, such polynomial p(x) may be an odd function too, so it can have the form x*q(x), being q(x) another polynomial. Thus, if x is 0, the evaluation of the p(x) polynomial will be exactly 0, and the algorithm does not need to compute q(x) to know that.

The same may occur if the algorithm used is the CORDIC one.

In any case, the algorithm used inside the calculator to compute sines is not the barebones CORDIC or polynomial approximation, but a more complex algorithm that: reduces the argument to a smaller range; converts it to radians (perhaps checking for some special cases here); checks some special cases; and, eventually, executes the barebones CORDIC/polynomial or Padé or whatever approximation. So I think that the answer to the question "how does the algorithm used in a calculator 'know' that it's exactly zero" is "because the algorithm used explicitly checks if the argument is 0 and, if so, returns a 0".

Another example, how is that an integration algorithm knows that \(\int_a^af(x)dx=0\)?. Because, with a high probability, it explicitly checks if both limits are equal, being such the case it returns a 0.

Regards.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
sine of an angle in degree mode - rflesch - 01-24-2018, 09:38 AM
RE: sine of an angle in degree mode - emece67 - 01-24-2018 03:38 PM



User(s) browsing this thread: 1 Guest(s)