Post Reply 
Pi digits (again) - an unbounded spigot program
05-20-2024, 02:39 PM
Post: #25
RE: Pi digits (again) - an unbounded spigot program
Thanks Thomas, everyone, some interesting contributions there for sure.

I'm especially interested in Albert's spigot from the ABC documentation - is it described anywhere else, is it attached to any name? It seems simple and effective.

As with Thomas, I like spigots because they produce results incrementally. I think I'm right in saying that the older bounded spigots will produce the first digits slowly and then progressively speed up until their final output. They allocate some fixed (knowable) amount of memory before they begin. The unbounded spigots are the opposite: they produce the first digit immediately and then progressively slow down, allocating (or requiring) ever more memory as they proceed.

(The non-spigot algorithms come in a couple of classes, I think: one class produces the whole result right at the end, the other class creates successive approximations to pi but without necessarily guarantees about how many digits are final in each iteration.)

Other than the time taken to produce some number of digits, perhaps another figure of merit is how many digits (or bytes) of storage is needed. From a very quick look, it seems like the unbounded spigots need around 10 digits per digit produced.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Pi digits (again) - an unbounded spigot program - EdS2 - 05-20-2024 02:39 PM



User(s) browsing this thread: 3 Guest(s)