 The Museum of HP Calculators

HP Forum Archive 15

 What is the ans. of sin(32 pi) in rad modeMessage #1 Posted by cre on 8 Dec 2005, 4:06 a.m. My question in my test was "what is the ans. of sin(32 pi) in rad mode. I put -3286476925x10E-12. But the model ans. is 0. Why? I just input directly to my HP38g. Anything wrong?

 Re: What is the ans. of sin(32 pi) in rad modeMessage #2 Posted by Han on 8 Dec 2005, 4:26 a.m.,in response to message #1 by cre Quote: My question in my test was "what is the ans. of sin(32 pi) in rad mode. I put -3286476925x10E-12. But the model ans. is 0. Why? I just input directly to my HP38g. Anything wrong? The sin(x) function is periodic, with period 2*Pi. This means that sin(x) = sin(x + 2*Pi) = sin(x + 4*Pi) = ... = sin(x + 32*Pi). Since sin(0) = 0, then sin(0 + 32*Pi) = 0. If you truly entered sin(32*Pi), you _SHOULD_ have obtained 1.26616369195E-10 as your answer (which is extremely close to 0, the real answer). The reason it's not exactly 0 is because the HP first calculates 32*Pi, which is approximately 100.530964915. Then it takes the sine of this approximate value, which returns 1.26616369195E-10 (approximately 0). I'm not sure how you managed to obtain -3286476925x10E-12. For one, this is not a typical way of displaying numbers on a calculator. Secondly, -3286476925x10E-12 = -0.003286476925, which on your calculator should appear as either -0.003286476925 or -3.286476925E-2. Check that your modes are correct. [SHIFT-KEY] + [HOME] and examine that your modes are Radian and Standard.

 Re: What is the ans. of sin(32 pi) in rad modeMessage #3 Posted by cre on 8 Dec 2005, 10:37 a.m.,in response to message #2 by Han If I have the same question again on my test, should I write "0" or the number with the notation which display on my calculator?

 Re: What is the ans. of sin(32 pi) in rad modeMessage #4 Posted by Han on 8 Dec 2005, 11:16 a.m.,in response to message #3 by cre Quote: If I have the same question again on my test, should I write "0" or the number with the notation which display on my calculator? Well, mathematicians always accept the exact answer -- in this case it is '0'. If your question specifically says to use your calculator for computations, however, then I would write down what shows up on the calculator.

 Re: What is the ans. of sin(32 pi) in rad modeMessage #5 Posted by unspellable on 8 Dec 2005, 4:12 p.m.,in response to message #4 by Han If the test asks for the answer provide by the calculator, which in this case it appears to do, since it specifies the mode, I would put down the residual error dipslayed on the calculator rather than zero. In this case that WOULD be the exact answer, and hopefully the instructor is looking for an understanding of calculator operation. On the other hand, if I were an instructor looking for an understading of the underlying math and not the peculiarities of calculator operation I might expect to see zero regardless of what the calculator displays. I have seen much controversy about calculators in tests and whether muscle calculators are an unfair advantage or whether they should be banned. In my engineering classes the test questions were always made up in such a way that it made no difference what sort of calculator you had from very basic non-programmable scientific with no memory on up. In fact I had one math instructor who would send the exam home with you for the week end. (In which case you could kiss the week end goodby.)

 Re: What is the ans. of sin(32 pi) in rad modeMessage #6 Posted by Ed Look on 10 Dec 2005, 7:17 p.m.,in response to message #5 by unspellable THIS is the best comment (if not explanation) so far! Please, Cre, memorize your basic trigonometric values first and review on a set of x and y axes why this is true drawing the triangle which hypotenuse radiates from the origin using the definitions of sine, cosine, tangent, etc. Remember, sin A = 0 for A = 0, 180, 360, etc., and, = 1 for A = 90; = -1 for 270, etc. and all the other special values for sin 30, 45, 60, etc., and similarly for cos A. These have either exact or easily remembered values. This might save you a lot of time on a test rather than the calculator answer. The calculator is really for us old folks whose brains have worn out since college... or high school for some! ; )

 Re: What is the ans. of sin(32 pi) in rad mode (edited...)Message #7 Posted by Vieira, L. C. (Brazil) on 8 Dec 2005, 1:17 p.m.,in response to message #3 by cre Hi, Cre; I agree with Han. Sin (2n*PI), being "n" an integer, is always zero. The simplification he shows might also be used to demonstrate your answer in the test. If you write Sin (2n*(3.1415...)), you'd need to compute it with as many digits as the system accepts and handles. I am not sure about the HP38G, but you can find at least two possible answers in some advanced calculators. If the calculator is set to compute exact answers, then SIN(2n*PI)=0 (n=integer). Otherwise, in approximation mode, SIN(2n*PI) returns the best approximation, given internal accuracy. As a teacher, I'd ask the student to explain the answer. Hope this helps a bit. Best regars. Luiz (Brazil) Edited: 8 Dec 2005, 7:21 p.m.

 Re: What is the ans. of sin(32 pi) in rad modeMessage #8 Posted by Garth Wilson on 8 Dec 2005, 1:37 p.m.,in response to message #2 by Han About the "-3286476925x10E-12"-- I've seen this mistake with students before. I don't have that calculator model to know exactly what you got, but I suspect it might have been "-3.286476925 -12", with the decimal point after the first digit if it was in scientific notation, or possibly after the second or third digit if you have the calculator set for engineering notation. The "-12" at the end however means E-12, or "times ten to the minus twelfth power," which is not the same thing as "x10E-12". The "E" already means "x10^__" If you put "x10" in there yet again, you'll be off by a power of ten. "x10E-12" is the same as "E-11". To visualize more easily, consider "10E0", which means "ten, times ten to the zero power," = 10x1 = 10, not 1 or 100. "x10E0" means "times ten"; but if the calculator says "E0" or just "00" in the exponent area at the right end, it means "times one". It seems to be common for students to misinterpret this and be off by a factor of ten.

 Re: What is the ans. of sin(32 pi) in rad modeMessage #9 Posted by Crawl on 8 Dec 2005, 5:52 p.m.,in response to message #1 by cre A few extra comments: Usually, with really good calculators, sin("pi") <> 0 has nothing to do with calculator error. The error is in pi, which is an irrational number being represented as a rational. It turns out that you can use sin(pi) as a quick way of getting a more accurate pi. If x is very small, then sin(pi + x) ~ -x However, pi on the calculator has an error, because it is only stored to so many digits. That error is the negative of the sine of the stored pi, so adding them subtracts the error from the stored pi. On of my calculators, "pi" = 3.14159265359 sin("pi") = -2.067615374e-13 Of course, you can't combine the two, because all the extra digits will be pushed off. You can split pi in half, though. The first half, say, could be 3.141592653 and the second would be 0.00000000059. Add *that* to the sin of "pi" and you get 0.00000000058979323846... Put both halves of pi together to get 3.14159265358979323846 which is correct to pi for 21 digits. Another note: It's not a good idea in almost any test to give all 10 (or more) digits from a calculator as an answer.

 Simple: Pi to 24 digits on later HP calc's Message #10 Posted by Karl Schneider on 9 Dec 2005, 2:19 a.m.,in response to message #9 by Crawl Utilizing the identity ```sin(A - B) = sin(A)*cos(B) - cos(A)*sin(B), ``` the result ```sin(pi - x) = sin(pi)*cos(x) - cos(pi)*sin(x) = sin(x) ``` is easily obtained. Let "x" represent the entire string of missing digits when the value of pi is truncated (not rounded) to a certain number of decimal places. sin(x) ~= x for small x, and the approximation improves toward perfection as x approaches zero. Therefore, entering the first "n" digits of pi and taking its sine in radians mode should accurately yield a string of immediately-subsequent digits. Best results for this simple procedure are obtained using an HP calculator with a Saturn microprocessor. These offer 12 significant digits and a faster processing speed that enables the functions to be computed more accurately. In radians mode on a HP-20S, ```sin (3.14159265358) = 0.00000000000979323846264 and pi = 3.14159265358979323846264, correct to 24 digits. ``` The difference between x and sin(x) for this very small value of x is guranteed to be less than (1/3)*x3 (the next term of the Taylor series for sine), which is much smaller than x. (I assume that one could probably use "EXACT" mode on an HP-49 to obtain more digits of pi.) On a 10-digit pre-Saturn HP calc, the 11th through 20th digits of pi cannot be obtained by this procedure. The algorithms apparently don't carry out the series for sine to as many terms, probably owing to lack of processor speed. Alas, tradeoffs had to be made... In radians mode on a HP-15C or 41C, ```sin (3.141592653) = 0.00000000059 and pi = 3.14159265359, rounded to 12 digits. ``` -- KS Edited: 9 Dec 2005, 2:37 a.m.

 Re: Simple: Pi to 24 digits on later HP calc's Message #11 Posted by Marcus von Cube, Germany on 9 Dec 2005, 3:02 a.m.,in response to message #10 by Karl Schneider Karl, I tried this on 2 of my TIs (an old TI-36 solar with 12 digit accuracy and a more modern Voyage 200.) None of them produced any more digits as had already been stored in the numerical constant PI. Does this mean, that these calcs dont't use Taylor series approximation but CORDIC instead? As I understand, the latter algorithm produces consecutive digits of a transcendental function based on a series of precomputed constants in ROM. Marcus

 Accuracy and methods for sine (and cosine)Message #12 Posted by Karl Schneider on 9 Dec 2005, 3:48 a.m.,in response to message #11 by Marcus von Cube, Germany Marcus -- I'm not sure exactly what methods the respective calculators use for sine and cosine, but it is quite likely that something other than Taylor series are used. I have heard of CORDIC. Note that I didn't explicitly state that the Saturn-based HP's used Taylor series: Quote: sin (3.14159265358) = 0.00000000000979323846264 and pi = 3.14159265358979323846264, correct to 24 digits. The difference between x and sin(x) for this very small value of x is guranteed to be less than (1/3)*x3 (the next term of the Taylor series for sine), which is much smaller than x. This implies only that, if this 12-significant-digit result for sin(x) returned by the HP-20S (and other Saturn-based models), is correct and accurate, it must differ from x by less than (1/3)*x3, as guaranteed by the convergent alternating Taylor series of monotonically-decreasing terms. I got the following results: 11th and 12th digits "59" on the HP-6S; 11th through 20th digits on the HP-30S; no additional digits on the Le World scientific; (My TI-36X Solar is at the workplace.) -- KS

 Re: Accuracy and methods for sine (and cosine)Message #13 Posted by Ron on 9 Dec 2005, 3:30 p.m.,in response to message #12 by Karl Schneider FWIW: My HP49g+ yields 0 for sin(32*pi) in exact mode (approximate not checked) and the same deviation as yours when approximate is checked or if in algebraic mode. It appears to respond with zero only if the calculator is in EXACT AND RPN. All methods to display pi: (1*pi, pi..) otherwise result in pi rounded to 12 digits ...............59, regardless of exact or algebraic modes.

 Re: What is the ans. of sin(32 pi) in rad modeMessage #14 Posted by John Smitherman on 10 Dec 2005, 6:38 p.m.,in response to message #1 by cre Quote: My question in my test was "what is the ans. of sin(32 pi) in rad mode. I put -3286476925x10E-12. But the model ans. is 0. Why? I just input directly to my HP38g. Anything wrong? Hi cre. My 30s returns 0. Too bad the 30s is algebra only as it is nice to keep around to check answers. Regards, John Go back to the main exhibit hall