home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!howland.reston.ans.net!sol.ctr.columbia.edu!ira.uka.de!Sirius.dfn.de!urmel.informatik.rwth-aachen.de!martin
- From: martin@math.rwth-aachen.de ( Martin Schoenert)
- Newsgroups: comp.programming
- Subject: Re: Arbitrary precision with large bases
- Date: 7 Jan 93 14:25:38 GMT
- Organization: Rechnerbetrieb Informatik - RWTH Aachen
- Lines: 30
- Message-ID: <martin.726416738@bert>
- References: <martin.726311424@bert> <1icne6INNpjb@uwm.edu> <21495.1993Jan6.094519@bcars148>
- NNTP-Posting-Host: bert.math.rwth-aachen.de
-
- emcoop@bnr.ca (hume smith) writes:
-
- In <martin.726311424@bert>, martin@math.rwth-aachen.de ( Martin Schoenert) said:
- > a) the larger the base the fewer digits any given integer has in this
- > base. Since (for example) the performance of the multiplication
- > is proportional to the product of the number of digits of the
- > operands it is always a win to use larger bases (though the win
- > with base 2^32 over base 10^9 is only about 12.5%).
-
- not quite true - see aho/hopcroft/ullman. f1*f2 can be done
- in O(n log(n)) where n=max(log(f1), log(f2)). there's a rather large
- constant involved though... it may be better to implement the two
- and find out empirically when to switch methods.
-
- Well yes, but it is not so simple. Those fancier algorithms also have to
- multiply digits (just not so many). That means that base 2^32 is still
- going to win over base 10^10 (just not so much). Also you need quite
- large integer before the fancier methods are faster than the elementary
- algorithm. For example the one with the smallest overhead is Karatsuba's
- trick. With my large integer arithmetic running on an R3000, integers
- must have about 200 decimal digits before one Karatsuba splitting pays,
- and they must have about 2000 decimal digits before multiplication with
- Karatsuba's trick is twice as fast as the elementary algorithm. For
- fourier transform the break-even point is even higher.
-
- Martin.
-
- -- .- .-. - .. -. .-.. --- ...- . ... .- -. -. .. -.- .-
- Martin Sch"onert, Martin.Schoenert@Math.RWTH-Aachen.DE, +49 241 804551
- Lehrstuhl D f"ur Mathematik, Templergraben 64, RWTH, D 51 Aachen, Germany
-