Re: Any progress yet? (was Re: Fast pi program?)
- From: "Alf P. Steinbach" <alfps@xxxxxxxx>
- Date: Fri, 31 Aug 2007 08:43:49 +0200
* mike3:
On Aug 30, 11:49 pm, "Alf P. Steinbach" <al...@xxxxxxxx> wrote:
I'd had to really delve into this to give specific advice (and Things Take Time).
For now, looking only at the [pib26.c] main program source, it seems the
program is actually /calculating/ in base 26^4. Perhaps that's a choice
found after measuring the cost of calculating in a binary base and then
converting to base 26, or perhaps it's not? If number system conversion
requires quadratic time (does it?) perhaps this is best, but if not,
perhaps a change to internal binary system computation, with final
conversion to base 26, would really speed things up? Just a wild guess.
It does calculate in base 26^4. You are right. To compute in base 10
you need to compute 2x the digits then convert to 26 (since the
algorithms work best with powers of 2 numeric sizes),
Uh, no, I suggested a binary base. In particular, e.g. base 2^32, or, since it seems the program is doing 64-bit calculations, base 2^64.
Base 2^32 would /reduce/ the number of digits by a factor of about 1.7 compared to base 26^4; base 2^64 would reduce the number of digits by twice that; and both would perhaps (I don't know) also avoid costly per-digit remainder operations in all arbitrary precision operations.
But as I wrote quoted above, I don't know the cost of the final radix conversion (I suspect it would take seconds to google but that's your work! :-)).
which
effectively cancels much of the speed gain.
Nope, see above.
Plus that final
radix conversion is _not_ cheap, you know.
Well I don't know. Could be worth checking. Yes?
Cheers, & hth.,
- Alf
PS: Please don't quote signatures.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
.
- Follow-Ups:
- Re: Any progress yet? (was Re: Fast pi program?)
- From: mike3
- Re: Any progress yet? (was Re: Fast pi program?)
- References:
- Fast pi program?
- From: mike3
- Any progress yet? (was Re: Fast pi program?)
- From: mike3
- Re: Any progress yet? (was Re: Fast pi program?)
- From: Alf P. Steinbach
- Re: Any progress yet? (was Re: Fast pi program?)
- From: mike3
- Re: Any progress yet? (was Re: Fast pi program?)
- From: Alf P. Steinbach
- Re: Any progress yet? (was Re: Fast pi program?)
- From: mike3
- Fast pi program?
- Prev by Date: Re: Any progress yet? (was Re: Fast pi program?)
- Next by Date: Efficient interval representation
- Previous by thread: Re: Any progress yet? (was Re: Fast pi program?)
- Next by thread: Re: Any progress yet? (was Re: Fast pi program?)
- Index(es):
Relevant Pages
|