Karim BELABAS on Tue, 14 Jan 2003 15:33:00 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Pi |
On Tue, 14 Jan 2003, Bill Allombert wrote: > On Sun, Jan 12, 2003 at 06:07:00PM +0100, Ralf Stephan wrote: > > The manual says (p.69) a copy of Pi is created on the heap for quicker > > computations next time the function is called. This does not seem > > to be true in 2.2.4 as with both \p 12000 and 12200, Pi needs about > > one second here (I know it's fast enough but the manual says it). > > If it is your question, there is no incremental algorithm to compute Pi > implemented. Computing Pi at 12200 d.p does not use the knowledge of the first > 12000 d.p. > > I do not know if it would make sense to do that. It definitely would, using the log((1+i) / 2) expansion. I don't think it would have a major effect on running times, but if somebody wants to try it... Since the GMP kernel offers assymptotically fast multiplication for the basic PARI types (t_INT natively, and t_REAL via your recent hack), it will even be possible to compute a huge number of digits with gp [ losing constant factors compared to special purpose implementations, due to the various overheads, but still in decent time ]. Decimal output would probably take infinite time though... [ still uses a quadratic method, see convi/confrac ] Also, a different Pi formula needs to be implemented [ the current one was chosen so that almost all multiplication/divisions involve a single precision operand, which is not at all what we want now ! ]. Cheers, Karim. P.S: I'll try to add GMP support to Configure "real soon now" [have a series of lectures to prepare first...] -- Karim Belabas Tel: (+33) (0)1 69 15 57 48 Dép. de Mathématiques, Bât. 425 Fax: (+33) (0)1 69 15 60 19 Université Paris-Sud Email: Karim.Belabas@math.u-psud.fr F-91405 Orsay (France) http://www.math.u-psud.fr/~belabas/ -- PARI/GP Home Page: http://www.parigp-home.de/