From: Robert Dober Date: 2009-05-01T06:16:09+09:00 Subject: Re: Digits of Pi (#202) On Thu, Apr 30, 2009 at 10:21 PM, Todd Benson wrote: > On Thu, Apr 30, 2009 at 7:21 AM, Robert Dober wrote: >> On Thu, Apr 30, 2009 at 5:02 AM, Jay Anderson 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