Why does the TI-84 give strange answers for sin of multiples of 2-pi?

  • Calculators
  • Thread starter johnqwertyful
  • Start date
  • Tags
    ti-84
In summary, sin(x) on the z80 calculators (TI-84+, TI-89) will diverge quickly if the raised number is raised to a power, then divided by an integer. This happens because the calculator uses a 9-byte FP number format, rather than the 14 digits of precision that the z80 calculators use.
  • #1
johnqwertyful
397
14
Something I've noticed that no one has ever been able to sufficiently explain to me is taking the sin of multiples of 2-pi.

Sin 6pi, 8pi, 12pi. You get silly answers. For example, sin(6pi) gives you -4*10^-13 instead of 0. I've never been able to get a satisfactory explanation. Most people say "that's weird, must be how it computes it or something". A teacher said something about precision.

Does anyone understand WHY it does this? Anything other than an 84 you get 0. Even my crappy $10 scientific calculators give back 0.
 
Computer science news on Phys.org
  • #2
Something interesting, though. sin(10pi), sin(100pi), sin(1000pi) and so on give back 0.
 
  • #3
If it uses a power series expansion of sin(x) to compute sin(x) then you'll get errors like this.
I have noticed that even Wolfram's Mathematica does this, albeit for slightly more complicated functions.
 
  • #4
genericusrnme said:
If it uses a power series expansion of sin(x) to compute sin(x) then you'll get errors like this.
I have noticed that even Wolfram's Mathematica does this, albeit for slightly more complicated functions.

Why's it only for 84 though? 89 is fine, my cheap $10 scientific doesn't do that.
 
  • #5
It depends on which algorithm is used, as mentioned before. Basically, the TI-84+ (and the other z80 models) use 9-byte Floating point numbers to do math. A number in the form of data will look like this, for example:

00 80 31 41 59 26 53 58 98

the first 00 tells several things, specifically whether the value is negative or positive and whether it is part of a complex number or not. (If it is complex, the following 9 bytes are the imaginary component, with the same format) The next part, the 80h tells where the exponent is located and what power of 10 is being used. If this were 7Fh, instead, it would read on the homescreen as .31415926535898, and if it were 81h, it would be read as 31.415926535898. Regardless, as you can see, there are precisely 14 digits of precision and this is all that the TI-OS uses for the z80 calculators. If you notice, the number I gave is an approximation of pi, and the last digit happens to be rounded up. Now, imagine if you square this number, or cube it, or raise it to the fourth, et cetera. You will realize that the value starts to diverge from the actual values of pi2, pi3, and so on, then it rapidly diverges. Now, pi was just an example. If you wanted great precision using a Taylor series, the calculator can only give as much as 14 digits of accuracy. However, you can see that having to raise a number by a power, then divide by an integer (a factorial, in the case of sine and cosine) can cause noticeable divergence from actual values.

So why does the TI-89 not have this issue? The TI-89 uses a different system of mathematics called a computer algebra system (CAS). Typically, these check for many shortcuts, such as modding anything in the sin() or cos() arguments by 2pi, thus lending much better accuracy to the result. Further, if it sees that you are simply using a multiple of pi or 2pi, it can easily return a precomputed value of 0, 1, or -1, accordingly. Further, the TI-89 does not use the 9-byte FP number format. In fact, it usually uses an arbitrary precision system (to an extent). This means it stores massive numbers digit for digit, instead of as 9.8E376, which has its own benefits and disadvantages that go beyond the scope of this topic.

I am not sure if I have only served to confuse you more, but I hope this is adequate!
 

Related to Why does the TI-84 give strange answers for sin of multiples of 2-pi?

What is the purpose of finding multiples of 2π on a TI-84 calculator?

Finding multiples of 2π on a TI-84 calculator is useful in various mathematical applications, such as graphing trigonometric functions and solving equations involving radians.

How do I find multiples of 2π on a TI-84 calculator?

To find multiples of 2π on a TI-84 calculator, simply enter the number you want to find the multiple of, followed by the multiplication symbol (*), and then 2π. For example, to find the multiples of 2π for the number 3, enter "3*2π" and press enter.

Can I find decimal multiples of 2π on a TI-84 calculator?

Yes, the TI-84 calculator can calculate decimal multiples of 2π. Simply enter the decimal number followed by the multiplication symbol (*), and then 2π. For example, to find the decimal multiples of 2π for the number 1.5, enter "1.5*2π" and press enter.

What is the largest multiple of 2π that the TI-84 calculator can calculate?

The TI-84 calculator can calculate multiples of 2π up to 999,999,999. However, it may display an error message if the number is too large to be displayed on the screen.

Can I use the multiples of 2π feature on a TI-84 calculator for non-trigonometric functions?

Yes, you can use the multiples of 2π feature on a TI-84 calculator for any function that involves radians, such as exponential and logarithmic functions. Simply enter the function, followed by the multiplication symbol (*), and then 2π. For example, to find the multiples of 2π for the function e^x, enter "e^x*2π" and press enter.

Similar threads

  • Computing and Technology
Replies
8
Views
8K
  • Computing and Technology
Replies
5
Views
7K
  • Computing and Technology
Replies
5
Views
37K
  • Computing and Technology
Replies
9
Views
8K
  • Computing and Technology
Replies
1
Views
2K
  • Precalculus Mathematics Homework Help
Replies
3
Views
2K
  • Precalculus Mathematics Homework Help
Replies
17
Views
3K
  • Calculus and Beyond Homework Help
Replies
11
Views
2K
Replies
11
Views
6K
Back
Top