[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

181.0. "More Multiprecision" by HARE::STAN () Sun Nov 18 1984 05:13

Newsgroups: net.math
Path: decwrl!decvax!linus!faron!bs
Subject: multiple-precision arithmetic
Posted: Fri Nov 16 07:46:31 1984



	I have implemented both in C and in VAX assembler a set of
multiple precision arithmetic routines which are quite fast. Using
them I have also implemented numerous state-of the art factorization
and prime testing routines including the Continued Fraction Algorithm,
Pollard P-1 and P+1, Pollard Rho, and primality testing based upon
Lucasian criteria. They are all quite fast and I believe that they
run about as fast as possible on the VAX. The continued fraction
program, for example, factors typical 40 digit numbers in about an
hour, and 50 digits numbers in about 35 hours. 
	The key problems involved in implementing multi-precision
routines on the VAX is the high cost of subroutine calls and the
relatively slow speed of the EMUL and EDIV instructions. A typical
CALLS instruction on the VAX with 3 arguments takes about 15 usec
to execute. Thus, calling a routine to (say) add 2 multi-precise numbers
is quite expensive. The EMUL instruction takes slightly less than 7 usec
to multiply 2 32 bit numbers giving a 64 bit product and EDIV takes
about 12 usec to divide a 64 bit number by a 32 bit number. One
cannot generate code to utilise EDIV and EMUL from C so the low level
arithmetic primitives must either be done in assembler, or you restrict
yourself to working in radix 2^15 so you can multiply 2 integers without
overflow.
	I would be happy to privately respond to any queries.

P.S.	I am also currently engaged in implementing the new Cohen-Lenstra
	prime testing algorithm and would like to hear from anyone who is
	interested in it.
T.RTitleUserPersonal
Name
DateLines