Todd Benson
4/27/2009 6:13:00 AM
2009/4/27 Robert Dober <robert.dober@gmail.com>:
> 2009/4/27 Harry Kakueki <list.push@gmail.com>:
>>>
>>> This week's quiz is to write a Ruby program that can compute the first
>>> 100,000 digits of =F0.
>>>
>>>
>>
>> # Is this cheating ? :)
> I would say no, but...
> I honestly could not come up with a solution, always getting confused
> how many significant digits I need in the involved constants. Thus I
> am really looking forward to the solutions and the summary. (Distant
> memories tell me I should do some range arithmetics, we will see)
> Sorry to say Harry, but your solution has not enlightened me on the topic=
;).
> Cheers
> Robert
For what it's worth, I tried a Gauss-Legendre and it halted my PC at a
delta of 1e-10 and smaller (only 10 good digits), and then started to
diverge pretty rapidly, so much so that the program would halt (yes, I
simply sat there and hit the gets over and over). I then tried
Srinavasa's method, and it converged so quickly to 10 places, and
never gave up after that, but it took about 3 hours to run k up to
1024 (without my intervention), which amounts to around 12_000 correct
places.
There's Daniel Shanks, which I might try my hand at eventually, but
the winner for this programming language might end up being
brute-force by-digit deterministic approach mentioned by one of the
first posters.
I think, Robert, cheating would be writing a program that grabs the
digits from the website :)
Todd