What is sin 1040 ?


By Sam Khan on Thursday, December 12, 2002 - 05:23 pm:

Question: What is sin 1040 ?


By Yatir Halevi on Thursday, December 12, 2002 - 06:00 pm:

Try using the fact that sin is periodic


By Dan Goodman on Thursday, December 12, 2002 - 06:42 pm:
It is feasible to calculate 1040 mod 2p by repeated subtraction, but I wouldn't like to do it myself. First of all, calculate 2p to about 50 decimal places say, a computer will do that in milliseconds. Now, write down 2p×1038. Repeatedly subtract this from 1040 (keeping a record of the 50 decimal digits, 40 to the left of the decimal place and 10 to the right) until you're left with a number of order 1039. Now think about 2p×1037. Repeatedly subtract this from your order 1039 number until it is order 1038. Repeat (it will take about 40 steps and no step should involve more than 2 subtractions, each subtraction consisting of an operation on 50 digits). In other words it shouldn't take more than about 40×2×50=4000 digit operations to do. Now calculate sin of what remains (which you will have accurate to 9 decimal places because you were keeping track of 10 decimal places after the dot).

I can't immediately think of a clever way of doing it though. Anyone got any ideas?


By Dan Goodman on Thursday, December 12, 2002 - 06:49 pm:

By the way, Mathematica will calculate it in under a 10th of a second accurately if you enter N[Sin[10^40],50] and it is not actually a little above 0 at all. I won't spoil your fun by giving away the actual value...


By Ben Tormey on Thursday, December 12, 2002 - 06:54 pm:

Maybe you could try using a fairly low order power series expansion (Taylor series, or Pade approximant or something) of sin(x)?


By Yatir Halevi on Thursday, December 12, 2002 - 06:57 pm:

Don't think taylor series will be of much help, because you'll need a very large order to get good accuracy...


By Dan Goodman on Thursday, December 12, 2002 - 08:03 pm:
I think the challenge is to find a way of doing it with only a piece of paper and an ordinary calculator. Except for the calculating p to 50 decimal places my method does that. I haven't come up with anything better yet though. I think Taylor series won't work, what were you thinking of doing with them Marcos?
By Ben Tormey on Thursday, December 12, 2002 - 08:29 pm:

Actually (and I feel a little bit silly if I'm right, and even more so if I'm wrong), isn't the answer just sin(10) i.e. -0.544...


By Dan Goodman on Thursday, December 12, 2002 - 09:25 pm:

Well, I've worked out a method but it doesn't seem to work. First of all, expand cos(10x) in terms of cos(x). I did this in Mathematica and got that Cos[10y]=f[Cos[y]] where f[x]=(2x^2-1)(1-48x^2+304x^4-512x^6+256x^8). Now compute f(f(f(...f(cos(1))...))). Unfortunately, it doesn't seem to work (presumably because of numerical errors).


By Yatir Halevi on Friday, December 13, 2002 - 07:05 am:

Actually Ben, it is close to 'sin(10)' it is a bit smaller.
Suprisingly Window's Calculator can handle this task in a milisecond.... :)

Yatir


By Sam Khan on Friday, December 13, 2002 - 10:11 pm:
Can anyone tell me what they think of this method, tell me where I go wrong if it's wrong.
p = 3.14159265358979323846264338327950288419716939937510

×2 gives 2p

1040/ 2p

= something (not needed - number of turns).5964574045 approx (10 d.p)

This is the this 2p/ 10000000000 will give 100000000th of a = 0.0000000006283185307 (approx)

multiply this by 5964574045 for angle in radians

=3.7476524 (approx)

sin of this is answer : -0.56963


By Dan Goodman on Saturday, December 14, 2002 - 11:50 pm:

Sam, yes you can do exactly that. I assumed you wanted to be able to do it without using a calculator that can compute arbitrary precision (in your case you'd need about 50 sig figs). Your answer looks familiar to me, although I can't remember what I worked it out to be now.