[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Digits of Pi (#202)
From:       Robert Dober <robert.dober () gmail ! com>
Date:       2009-04-30 21:16:09
Message-ID: 335e48a90904301416h54665dc6g8483d34b780f6203 () mail ! gmail ! com
[Download RAW message or body]

On Thu, Apr 30, 2009 at 10:21 PM, Todd Benson <caduceass@gmail.com> wrote:
> On Thu, Apr 30, 2009 at 7:21 AM, Robert Dober <robert.dober@gmail.com> wrote:
>> On Thu, Apr 30, 2009 at 5:02 AM, Jay Anderson <horndude77@gmail.com> wrote:
>> The good new is that I chose the correct algorithm from the beginning.
>> The bad news is that I was waaaay to stupid to implement it, well
>> done.
>> BTW I tested your result, it seems to be correct  :).
>> Cheers
>
> Jay's version seemed to work fine.  It took about 5 minutes on my
> machine for 100_000.
>
> I haven't verified the digits yet, though.
I have ;)

Now that I learnt from Jay *not* to use BigDecimal :) I have
implemented Chen-Lih's machin formula,
last on this page: http://en.wikipedia.org/wiki/Machin-like_formula

But the speed gain is minimal 20~30% so that is definitely not worth
posting a *stolen* solution with this monster expression ;)
It run 70s instead of 97s (yes I have top notch hardware ;) for 100_000 digits.

Cheers
Robert

>
> Todd
>
>



-- 
Si tu veux construire un bateau ...
Ne rassemble pas des hommes pour aller chercher du bois, préparer des
outils, répartir les tâches, alléger le travail… mais enseigne aux
gens la nostalgie de l’infini de la mer.

If you want to build a ship, don’t herd people together to collect
wood and don’t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.

--
Antoine de Saint-Exupéry


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic