home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!pipex!harlqn.co.uk!harlqn!markt
- From: markt@harlqn.co.uk (Mark Tillotson)
- Subject: Re: Arbitrary precision with large bases
- In-Reply-To: emcoop@bnr.ca's message of Wed, 6 Jan 1993 14:45:19 GMT
- Message-ID: <MARKT.93Jan7124834@wundt.harlqn.co.uk>
- Lines: 31
- Sender: news@harlqn.co.uk (Usenet News Account)
- Organization: Harlequin Limited, Cambridge, England
- References: <martin.726311424@bert> <1icne6INNpjb@uwm.edu> <21495.1993Jan6.094519@bcars148>
- Date: Thu, 7 Jan 1993 12:48:34 GMT
-
- emcoop@bnr.ca (hume smith) writes:
- > 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.
- >
- Not _quite_ right, the complexity of Schoenhase-Strassen(?) multiply
- algorithm is O(N.log(N).log(log(N))). It must count as one of the 10
- neatest algorithms I know! You do need to implement both methods,
- because for really large N, it has to recurse to do the
- sub-multiplications (this recursion is responsible for the log(log(N))
- term). When the numbers are small enough (each level of recursion
- deals with numbers which have a number of digits roughly the
- square-root of the number of digits in the higher level), you switch
- to long-multiplication.
-
- I believe a tight implementation can start to win over straight long
- division when the numbers get to be a few hundred digits long. When
- the numbers get to be hundreds of millions of digits, it is the only
- practical way!!
-
- I believe there is a proof that no multiplication method can be better
- than O(N.log(log(N))) or some such.
-
-
- ------------------------------------------------------
- |\ /| | , M. Tillotson Harlequin Ltd. \
- | \/ | /\| |/\ |< markt@uk.co.harlqn Barrington Hall,\
- | | \_| | | \ +44 223 872522 Barrington, \
- I came, I saw, I core-dumped... Cambridge CB2 5RG \
-
-