1This is ../../gmp/doc/gmp.info, produced by makeinfo version 4.13 from
2../../gmp/doc/gmp.texi.
3
4This manual describes how to install and use the GNU multiple precision
5arithmetic library, version 5.0.5.
6
7   Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
82001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
9Free Software Foundation, Inc.
10
11   Permission is granted to copy, distribute and/or modify this
12document under the terms of the GNU Free Documentation License, Version
131.3 or any later version published by the Free Software Foundation;
14with no Invariant Sections, with the Front-Cover Texts being "A GNU
15Manual", and with the Back-Cover Texts being "You have freedom to copy
16and modify this GNU Manual, like GNU software".  A copy of the license
17is included in *note GNU Free Documentation License::.
18
19INFO-DIR-SECTION GNU libraries
20START-INFO-DIR-ENTRY
21* gmp: (gmp).                   GNU Multiple Precision Arithmetic Library.
22END-INFO-DIR-ENTRY
23
24
25File: gmp.info,  Node: Subquadratic GCD,  Next: Extended GCD,  Prev: Lehmer's Algorithm,  Up: Greatest Common Divisor Algorithms
26
2716.3.3 Subquadratic GCD
28-----------------------
29
30For inputs larger than `GCD_DC_THRESHOLD', GCD is computed via the HGCD
31(Half GCD) function, as a generalization to Lehmer's algorithm.
32
33   Let the inputs a,b be of size N limbs each. Put S = floor(N/2) + 1.
34Then HGCD(a,b) returns a transformation matrix T with non-negative
35elements, and reduced numbers (c;d) = T^-1 (a;b). The reduced numbers
36c,d must be larger than S limbs, while their difference abs(c-d) must
37fit in S limbs. The matrix elements will also be of size roughly N/2.
38
39   The HGCD base case uses Lehmer's algorithm, but with the above stop
40condition that returns reduced numbers and the corresponding
41transformation matrix half-way through. For inputs larger than
42`HGCD_THRESHOLD', HGCD is computed recursively, using the divide and
43conquer algorithm in "On Sch�nhage's algorithm and subquadratic integer
44GCD computation" by M�ller (*note References::). The recursive
45algorithm consists of these main steps.
46
47   * Call HGCD recursively, on the most significant N/2 limbs. Apply the
48     resulting matrix T_1 to the full numbers, reducing them to a size
49     just above 3N/2.
50
51   * Perform a small number of division or subtraction steps to reduce
52     the numbers to size below 3N/2. This is essential mainly for the
53     unlikely case of large quotients.
54
55   * Call HGCD recursively, on the most significant N/2 limbs of the
56     reduced numbers. Apply the resulting matrix T_2 to the full
57     numbers, reducing them to a size just above N/2.
58
59   * Compute T = T_1 T_2.
60
61   * Perform a small number of division and subtraction steps to
62     satisfy the requirements, and return.
63
64   GCD is then implemented as a loop around HGCD, similarly to Lehmer's
65algorithm. Where Lehmer repeatedly chops off the top two limbs, calls
66`mpn_hgcd2', and applies the resulting matrix to the full numbers, the
67subquadratic GCD chops off the most significant third of the limbs (the
68proportion is a tuning parameter, and 1/3 seems to be more efficient
69than, e.g, 1/2), calls `mpn_hgcd', and applies the resulting matrix.
70Once the input numbers are reduced to size below `GCD_DC_THRESHOLD',
71Lehmer's algorithm is used for the rest of the work.
72
73   The asymptotic running time of both HGCD and GCD is O(M(N)*log(N)),
74where M(N) is the time for multiplying two N-limb numbers.
75
76
77File: gmp.info,  Node: Extended GCD,  Next: Jacobi Symbol,  Prev: Subquadratic GCD,  Up: Greatest Common Divisor Algorithms
78
7916.3.4 Extended GCD
80-------------------
81
82The extended GCD function, or GCDEXT, calculates gcd(a,b) and also
83cofactors x and y satisfying a*x+b*y=gcd(a,b). All the algorithms used
84for plain GCD are extended to handle this case. The binary algorithm is
85used only for single-limb GCDEXT.  Lehmer's algorithm is used for sizes
86up to `GCDEXT_DC_THRESHOLD'. Above this threshold, GCDEXT is
87implemented as a loop around HGCD, but with more book-keeping to keep
88track of the cofactors. This gives the same asymptotic running time as
89for GCD and HGCD, O(M(N)*log(N))
90
91   One difference to plain GCD is that while the inputs a and b are
92reduced as the algorithm proceeds, the cofactors x and y grow in size.
93This makes the tuning of the chopping-point more difficult. The current
94code chops off the most significant half of the inputs for the call to
95HGCD in the first iteration, and the most significant two thirds for
96the remaining calls. This strategy could surely be improved. Also the
97stop condition for the loop, where Lehmer's algorithm is invoked once
98the inputs are reduced below `GCDEXT_DC_THRESHOLD', could maybe be
99improved by taking into account the current size of the cofactors.
100
101
102File: gmp.info,  Node: Jacobi Symbol,  Prev: Extended GCD,  Up: Greatest Common Divisor Algorithms
103
10416.3.5 Jacobi Symbol
105--------------------
106
107`mpz_jacobi' and `mpz_kronecker' are currently implemented with a
108simple binary algorithm similar to that described for the GCDs (*note
109Binary GCD::).  They're not very fast when both inputs are large.
110Lehmer's multi-step improvement or a binary based multi-step algorithm
111is likely to be better.
112
113   When one operand fits a single limb, and that includes
114`mpz_kronecker_ui' and friends, an initial reduction is done with
115either `mpn_mod_1' or `mpn_modexact_1_odd', followed by the binary
116algorithm on a single limb.  The binary algorithm is well suited to a
117single limb, and the whole calculation in this case is quite efficient.
118
119   In all the routines sign changes for the result are accumulated
120using some bit twiddling, avoiding table lookups or conditional jumps.
121
122
123File: gmp.info,  Node: Powering Algorithms,  Next: Root Extraction Algorithms,  Prev: Greatest Common Divisor Algorithms,  Up: Algorithms
124
12516.4 Powering Algorithms
126========================
127
128* Menu:
129
130* Normal Powering Algorithm::
131* Modular Powering Algorithm::
132
133
134File: gmp.info,  Node: Normal Powering Algorithm,  Next: Modular Powering Algorithm,  Prev: Powering Algorithms,  Up: Powering Algorithms
135
13616.4.1 Normal Powering
137----------------------
138
139Normal `mpz' or `mpf' powering uses a simple binary algorithm,
140successively squaring and then multiplying by the base when a 1 bit is
141seen in the exponent, as per Knuth section 4.6.3.  The "left to right"
142variant described there is used rather than algorithm A, since it's
143just as easy and can be done with somewhat less temporary memory.
144
145
146File: gmp.info,  Node: Modular Powering Algorithm,  Prev: Normal Powering Algorithm,  Up: Powering Algorithms
147
14816.4.2 Modular Powering
149-----------------------
150
151Modular powering is implemented using a 2^k-ary sliding window
152algorithm, as per "Handbook of Applied Cryptography" algorithm 14.85
153(*note References::).  k is chosen according to the size of the
154exponent.  Larger exponents use larger values of k, the choice being
155made to minimize the average number of multiplications that must
156supplement the squaring.
157
158   The modular multiplies and squares use either a simple division or
159the REDC method by Montgomery (*note References::).  REDC is a little
160faster, essentially saving N single limb divisions in a fashion similar
161to an exact remainder (*note Exact Remainder::).
162
163
164File: gmp.info,  Node: Root Extraction Algorithms,  Next: Radix Conversion Algorithms,  Prev: Powering Algorithms,  Up: Algorithms
165
16616.5 Root Extraction Algorithms
167===============================
168
169* Menu:
170
171* Square Root Algorithm::
172* Nth Root Algorithm::
173* Perfect Square Algorithm::
174* Perfect Power Algorithm::
175
176
177File: gmp.info,  Node: Square Root Algorithm,  Next: Nth Root Algorithm,  Prev: Root Extraction Algorithms,  Up: Root Extraction Algorithms
178
17916.5.1 Square Root
180------------------
181
182Square roots are taken using the "Karatsuba Square Root" algorithm by
183Paul Zimmermann (*note References::).
184
185   An input n is split into four parts of k bits each, so with b=2^k we
186have n = a3*b^3 + a2*b^2 + a1*b + a0.  Part a3 must be "normalized" so
187that either the high or second highest bit is set.  In GMP, k is kept
188on a limb boundary and the input is left shifted (by an even number of
189bits) to normalize.
190
191   The square root of the high two parts is taken, by recursive
192application of the algorithm (bottoming out in a one-limb Newton's
193method),
194
195     s1,r1 = sqrtrem (a3*b + a2)
196
197   This is an approximation to the desired root and is extended by a
198division to give s,r,
199
200     q,u = divrem (r1*b + a1, 2*s1)
201     s = s1*b + q
202     r = u*b + a0 - q^2
203
204   The normalization requirement on a3 means at this point s is either
205correct or 1 too big.  r is negative in the latter case, so
206
207     if r < 0 then
208       r = r + 2*s - 1
209       s = s - 1
210
211   The algorithm is expressed in a divide and conquer form, but as
212noted in the paper it can also be viewed as a discrete variant of
213Newton's method, or as a variation on the schoolboy method (no longer
214taught) for square roots two digits at a time.
215
216   If the remainder r is not required then usually only a few high limbs
217of r and u need to be calculated to determine whether an adjustment to
218s is required.  This optimization is not currently implemented.
219
220   In the Karatsuba multiplication range this algorithm is
221O(1.5*M(N/2)), where M(n) is the time to multiply two numbers of n
222limbs.  In the FFT multiplication range this grows to a bound of
223O(6*M(N/2)).  In practice a factor of about 1.5 to 1.8 is found in the
224Karatsuba and Toom-3 ranges, growing to 2 or 3 in the FFT range.
225
226   The algorithm does all its calculations in integers and the resulting
227`mpn_sqrtrem' is used for both `mpz_sqrt' and `mpf_sqrt'.  The extended
228precision given by `mpf_sqrt_ui' is obtained by padding with zero limbs.
229
230
231File: gmp.info,  Node: Nth Root Algorithm,  Next: Perfect Square Algorithm,  Prev: Square Root Algorithm,  Up: Root Extraction Algorithms
232
23316.5.2 Nth Root
234---------------
235
236Integer Nth roots are taken using Newton's method with the following
237iteration, where A is the input and n is the root to be taken.
238
239              1         A
240     a[i+1] = - * ( --------- + (n-1)*a[i] )
241              n     a[i]^(n-1)
242
243   The initial approximation a[1] is generated bitwise by successively
244powering a trial root with or without new 1 bits, aiming to be just
245above the true root.  The iteration converges quadratically when
246started from a good approximation.  When n is large more initial bits
247are needed to get good convergence.  The current implementation is not
248particularly well optimized.
249
250
251File: gmp.info,  Node: Perfect Square Algorithm,  Next: Perfect Power Algorithm,  Prev: Nth Root Algorithm,  Up: Root Extraction Algorithms
252
25316.5.3 Perfect Square
254---------------------
255
256A significant fraction of non-squares can be quickly identified by
257checking whether the input is a quadratic residue modulo small integers.
258
259   `mpz_perfect_square_p' first tests the input mod 256, which means
260just examining the low byte.  Only 44 different values occur for
261squares mod 256, so 82.8% of inputs can be immediately identified as
262non-squares.
263
264   On a 32-bit system similar tests are done mod 9, 5, 7, 13 and 17,
265for a total 99.25% of inputs identified as non-squares.  On a 64-bit
266system 97 is tested too, for a total 99.62%.
267
268   These moduli are chosen because they're factors of 2^24-1 (or 2^48-1
269for 64-bits), and such a remainder can be quickly taken just using
270additions (see `mpn_mod_34lsub1').
271
272   When nails are in use moduli are instead selected by the `gen-psqr.c'
273program and applied with an `mpn_mod_1'.  The same 2^24-1 or 2^48-1
274could be done with nails using some extra bit shifts, but this is not
275currently implemented.
276
277   In any case each modulus is applied to the `mpn_mod_34lsub1' or
278`mpn_mod_1' remainder and a table lookup identifies non-squares.  By
279using a "modexact" style calculation, and suitably permuted tables,
280just one multiply each is required, see the code for details.  Moduli
281are also combined to save operations, so long as the lookup tables
282don't become too big.  `gen-psqr.c' does all the pre-calculations.
283
284   A square root must still be taken for any value that passes these
285tests, to verify it's really a square and not one of the small fraction
286of non-squares that get through (i.e. a pseudo-square to all the tested
287bases).
288
289   Clearly more residue tests could be done, `mpz_perfect_square_p' only
290uses a compact and efficient set.  Big inputs would probably benefit
291from more residue testing, small inputs might be better off with less.
292The assumed distribution of squares versus non-squares in the input
293would affect such considerations.
294
295
296File: gmp.info,  Node: Perfect Power Algorithm,  Prev: Perfect Square Algorithm,  Up: Root Extraction Algorithms
297
29816.5.4 Perfect Power
299--------------------
300
301Detecting perfect powers is required by some factorization algorithms.
302Currently `mpz_perfect_power_p' is implemented using repeated Nth root
303extractions, though naturally only prime roots need to be considered.
304(*Note Nth Root Algorithm::.)
305
306   If a prime divisor p with multiplicity e can be found, then only
307roots which are divisors of e need to be considered, much reducing the
308work necessary.  To this end divisibility by a set of small primes is
309checked.
310
311
312File: gmp.info,  Node: Radix Conversion Algorithms,  Next: Other Algorithms,  Prev: Root Extraction Algorithms,  Up: Algorithms
313
31416.6 Radix Conversion
315=====================
316
317Radix conversions are less important than other algorithms.  A program
318dominated by conversions should probably use a different data
319representation.
320
321* Menu:
322
323* Binary to Radix::
324* Radix to Binary::
325
326
327File: gmp.info,  Node: Binary to Radix,  Next: Radix to Binary,  Prev: Radix Conversion Algorithms,  Up: Radix Conversion Algorithms
328
32916.6.1 Binary to Radix
330----------------------
331
332Conversions from binary to a power-of-2 radix use a simple and fast
333O(N) bit extraction algorithm.
334
335   Conversions from binary to other radices use one of two algorithms.
336Sizes below `GET_STR_PRECOMPUTE_THRESHOLD' use a basic O(N^2) method.
337Repeated divisions by b^n are made, where b is the radix and n is the
338biggest power that fits in a limb.  But instead of simply using the
339remainder r from such divisions, an extra divide step is done to give a
340fractional limb representing r/b^n.  The digits of r can then be
341extracted using multiplications by b rather than divisions.  Special
342case code is provided for decimal, allowing multiplications by 10 to
343optimize to shifts and adds.
344
345   Above `GET_STR_PRECOMPUTE_THRESHOLD' a sub-quadratic algorithm is
346used.  For an input t, powers b^(n*2^i) of the radix are calculated,
347until a power between t and sqrt(t) is reached.  t is then divided by
348that largest power, giving a quotient which is the digits above that
349power, and a remainder which is those below.  These two parts are in
350turn divided by the second highest power, and so on recursively.  When
351a piece has been divided down to less than `GET_STR_DC_THRESHOLD'
352limbs, the basecase algorithm described above is used.
353
354   The advantage of this algorithm is that big divisions can make use
355of the sub-quadratic divide and conquer division (*note Divide and
356Conquer Division::), and big divisions tend to have less overheads than
357lots of separate single limb divisions anyway.  But in any case the
358cost of calculating the powers b^(n*2^i) must first be overcome.
359
360   `GET_STR_PRECOMPUTE_THRESHOLD' and `GET_STR_DC_THRESHOLD' represent
361the same basic thing, the point where it becomes worth doing a big
362division to cut the input in half.  `GET_STR_PRECOMPUTE_THRESHOLD'
363includes the cost of calculating the radix power required, whereas
364`GET_STR_DC_THRESHOLD' assumes that's already available, which is the
365case when recursing.
366
367   Since the base case produces digits from least to most significant
368but they want to be stored from most to least, it's necessary to
369calculate in advance how many digits there will be, or at least be sure
370not to underestimate that.  For GMP the number of input bits is
371multiplied by `chars_per_bit_exactly' from `mp_bases', rounding up.
372The result is either correct or one too big.
373
374   Examining some of the high bits of the input could increase the
375chance of getting the exact number of digits, but an exact result every
376time would not be practical, since in general the difference between
377numbers 100... and 99... is only in the last few bits and the work to
378identify 99...  might well be almost as much as a full conversion.
379
380   `mpf_get_str' doesn't currently use the algorithm described here, it
381multiplies or divides by a power of b to move the radix point to the
382just above the highest non-zero digit (or at worst one above that
383location), then multiplies by b^n to bring out digits.  This is O(N^2)
384and is certainly not optimal.
385
386   The r/b^n scheme described above for using multiplications to bring
387out digits might be useful for more than a single limb.  Some brief
388experiments with it on the base case when recursing didn't give a
389noticeable improvement, but perhaps that was only due to the
390implementation.  Something similar would work for the sub-quadratic
391divisions too, though there would be the cost of calculating a bigger
392radix power.
393
394   Another possible improvement for the sub-quadratic part would be to
395arrange for radix powers that balanced the sizes of quotient and
396remainder produced, i.e. the highest power would be an b^(n*k)
397approximately equal to sqrt(t), not restricted to a 2^i factor.  That
398ought to smooth out a graph of times against sizes, but may or may not
399be a net speedup.
400
401
402File: gmp.info,  Node: Radix to Binary,  Prev: Binary to Radix,  Up: Radix Conversion Algorithms
403
40416.6.2 Radix to Binary
405----------------------
406
407*This section needs to be rewritten, it currently describes the
408algorithms used before GMP 4.3.*
409
410   Conversions from a power-of-2 radix into binary use a simple and fast
411O(N) bitwise concatenation algorithm.
412
413   Conversions from other radices use one of two algorithms.  Sizes
414below `SET_STR_PRECOMPUTE_THRESHOLD' use a basic O(N^2) method.  Groups
415of n digits are converted to limbs, where n is the biggest power of the
416base b which will fit in a limb, then those groups are accumulated into
417the result by multiplying by b^n and adding.  This saves
418multi-precision operations, as per Knuth section 4.4 part E (*note
419References::).  Some special case code is provided for decimal, giving
420the compiler a chance to optimize multiplications by 10.
421
422   Above `SET_STR_PRECOMPUTE_THRESHOLD' a sub-quadratic algorithm is
423used.  First groups of n digits are converted into limbs.  Then adjacent
424limbs are combined into limb pairs with x*b^n+y, where x and y are the
425limbs.  Adjacent limb pairs are combined into quads similarly with
426x*b^(2n)+y.  This continues until a single block remains, that being
427the result.
428
429   The advantage of this method is that the multiplications for each x
430are big blocks, allowing Karatsuba and higher algorithms to be used.
431But the cost of calculating the powers b^(n*2^i) must be overcome.
432`SET_STR_PRECOMPUTE_THRESHOLD' usually ends up quite big, around 5000
433digits, and on some processors much bigger still.
434
435   `SET_STR_PRECOMPUTE_THRESHOLD' is based on the input digits (and
436tuned for decimal), though it might be better based on a limb count, so
437as to be independent of the base.  But that sort of count isn't used by
438the base case and so would need some sort of initial calculation or
439estimate.
440
441   The main reason `SET_STR_PRECOMPUTE_THRESHOLD' is so much bigger
442than the corresponding `GET_STR_PRECOMPUTE_THRESHOLD' is that
443`mpn_mul_1' is much faster than `mpn_divrem_1' (often by a factor of 5,
444or more).
445
446
447File: gmp.info,  Node: Other Algorithms,  Next: Assembly Coding,  Prev: Radix Conversion Algorithms,  Up: Algorithms
448
44916.7 Other Algorithms
450=====================
451
452* Menu:
453
454* Prime Testing Algorithm::
455* Factorial Algorithm::
456* Binomial Coefficients Algorithm::
457* Fibonacci Numbers Algorithm::
458* Lucas Numbers Algorithm::
459* Random Number Algorithms::
460
461
462File: gmp.info,  Node: Prime Testing Algorithm,  Next: Factorial Algorithm,  Prev: Other Algorithms,  Up: Other Algorithms
463
46416.7.1 Prime Testing
465--------------------
466
467The primality testing in `mpz_probab_prime_p' (*note Number Theoretic
468Functions::) first does some trial division by small factors and then
469uses the Miller-Rabin probabilistic primality testing algorithm, as
470described in Knuth section 4.5.4 algorithm P (*note References::).
471
472   For an odd input n, and with n = q*2^k+1 where q is odd, this
473algorithm selects a random base x and tests whether x^q mod n is 1 or
474-1, or an x^(q*2^j) mod n is 1, for 1<=j<=k.  If so then n is probably
475prime, if not then n is definitely composite.
476
477   Any prime n will pass the test, but some composites do too.  Such
478composites are known as strong pseudoprimes to base x.  No n is a
479strong pseudoprime to more than 1/4 of all bases (see Knuth exercise
48022), hence with x chosen at random there's no more than a 1/4 chance a
481"probable prime" will in fact be composite.
482
483   In fact strong pseudoprimes are quite rare, making the test much more
484powerful than this analysis would suggest, but 1/4 is all that's proven
485for an arbitrary n.
486
487
488File: gmp.info,  Node: Factorial Algorithm,  Next: Binomial Coefficients Algorithm,  Prev: Prime Testing Algorithm,  Up: Other Algorithms
489
49016.7.2 Factorial
491----------------
492
493Factorials are calculated by a combination of removal of twos,
494powering, and binary splitting.  The procedure can be best illustrated
495with an example,
496
497     23! = 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23
498
499has factors of two removed,
500
501     23! = 2^19.1.1.3.1.5.3.7.1.9.5.11.3.13.7.15.1.17.9.19.5.21.11.23
502
503and the resulting terms collected up according to their multiplicity,
504
505     23! = 2^19.(3.5)^3.(7.9.11)^2.(13.15.17.19.21.23)
506
507   Each sequence such as 13.15.17.19.21.23 is evaluated by splitting
508into every second term, as for instance (13.17.21).(15.19.23), and the
509same recursively on each half.  This is implemented iteratively using
510some bit twiddling.
511
512   Such splitting is more efficient than repeated Nx1 multiplies since
513it forms big multiplies, allowing Karatsuba and higher algorithms to be
514used.  And even below the Karatsuba threshold a big block of work can
515be more efficient for the basecase algorithm.
516
517   Splitting into subsequences of every second term keeps the resulting
518products more nearly equal in size than would the simpler approach of
519say taking the first half and second half of the sequence.  Nearly
520equal products are more efficient for the current multiply
521implementation.
522
523
524File: gmp.info,  Node: Binomial Coefficients Algorithm,  Next: Fibonacci Numbers Algorithm,  Prev: Factorial Algorithm,  Up: Other Algorithms
525
52616.7.3 Binomial Coefficients
527----------------------------
528
529Binomial coefficients C(n,k) are calculated by first arranging k <= n/2
530using C(n,k) = C(n,n-k) if necessary, and then evaluating the following
531product simply from i=2 to i=k.
532
533                           k  (n-k+i)
534     C(n,k) =  (n-k+1) * prod -------
535                          i=2    i
536
537   It's easy to show that each denominator i will divide the product so
538far, so the exact division algorithm is used (*note Exact Division::).
539
540   The numerators n-k+i and denominators i are first accumulated into
541as many fit a limb, to save multi-precision operations, though for
542`mpz_bin_ui' this applies only to the divisors, since n is an `mpz_t'
543and n-k+i in general won't fit in a limb at all.
544
545
546File: gmp.info,  Node: Fibonacci Numbers Algorithm,  Next: Lucas Numbers Algorithm,  Prev: Binomial Coefficients Algorithm,  Up: Other Algorithms
547
54816.7.4 Fibonacci Numbers
549------------------------
550
551The Fibonacci functions `mpz_fib_ui' and `mpz_fib2_ui' are designed for
552calculating isolated F[n] or F[n],F[n-1] values efficiently.
553
554   For small n, a table of single limb values in `__gmp_fib_table' is
555used.  On a 32-bit limb this goes up to F[47], or on a 64-bit limb up
556to F[93].  For convenience the table starts at F[-1].
557
558   Beyond the table, values are generated with a binary powering
559algorithm, calculating a pair F[n] and F[n-1] working from high to low
560across the bits of n.  The formulas used are
561
562     F[2k+1] = 4*F[k]^2 - F[k-1]^2 + 2*(-1)^k
563     F[2k-1] =   F[k]^2 + F[k-1]^2
564
565     F[2k] = F[2k+1] - F[2k-1]
566
567   At each step, k is the high b bits of n.  If the next bit of n is 0
568then F[2k],F[2k-1] is used, or if it's a 1 then F[2k+1],F[2k] is used,
569and the process repeated until all bits of n are incorporated.  Notice
570these formulas require just two squares per bit of n.
571
572   It'd be possible to handle the first few n above the single limb
573table with simple additions, using the defining Fibonacci recurrence
574F[k+1]=F[k]+F[k-1], but this is not done since it usually turns out to
575be faster for only about 10 or 20 values of n, and including a block of
576code for just those doesn't seem worthwhile.  If they really mattered
577it'd be better to extend the data table.
578
579   Using a table avoids lots of calculations on small numbers, and
580makes small n go fast.  A bigger table would make more small n go fast,
581it's just a question of balancing size against desired speed.  For GMP
582the code is kept compact, with the emphasis primarily on a good
583powering algorithm.
584
585   `mpz_fib2_ui' returns both F[n] and F[n-1], but `mpz_fib_ui' is only
586interested in F[n].  In this case the last step of the algorithm can
587become one multiply instead of two squares.  One of the following two
588formulas is used, according as n is odd or even.
589
590     F[2k]   = F[k]*(F[k]+2F[k-1])
591
592     F[2k+1] = (2F[k]+F[k-1])*(2F[k]-F[k-1]) + 2*(-1)^k
593
594   F[2k+1] here is the same as above, just rearranged to be a multiply.
595For interest, the 2*(-1)^k term both here and above can be applied just
596to the low limb of the calculation, without a carry or borrow into
597further limbs, which saves some code size.  See comments with
598`mpz_fib_ui' and the internal `mpn_fib2_ui' for how this is done.
599
600
601File: gmp.info,  Node: Lucas Numbers Algorithm,  Next: Random Number Algorithms,  Prev: Fibonacci Numbers Algorithm,  Up: Other Algorithms
602
60316.7.5 Lucas Numbers
604--------------------
605
606`mpz_lucnum2_ui' derives a pair of Lucas numbers from a pair of
607Fibonacci numbers with the following simple formulas.
608
609     L[k]   =   F[k] + 2*F[k-1]
610     L[k-1] = 2*F[k] -   F[k-1]
611
612   `mpz_lucnum_ui' is only interested in L[n], and some work can be
613saved.  Trailing zero bits on n can be handled with a single square
614each.
615
616     L[2k] = L[k]^2 - 2*(-1)^k
617
618   And the lowest 1 bit can be handled with one multiply of a pair of
619Fibonacci numbers, similar to what `mpz_fib_ui' does.
620
621     L[2k+1] = 5*F[k-1]*(2*F[k]+F[k-1]) - 4*(-1)^k
622
623
624File: gmp.info,  Node: Random Number Algorithms,  Prev: Lucas Numbers Algorithm,  Up: Other Algorithms
625
62616.7.6 Random Numbers
627---------------------
628
629For the `urandomb' functions, random numbers are generated simply by
630concatenating bits produced by the generator.  As long as the generator
631has good randomness properties this will produce well-distributed N bit
632numbers.
633
634   For the `urandomm' functions, random numbers in a range 0<=R<N are
635generated by taking values R of ceil(log2(N)) bits each until one
636satisfies R<N.  This will normally require only one or two attempts,
637but the attempts are limited in case the generator is somehow
638degenerate and produces only 1 bits or similar.
639
640   The Mersenne Twister generator is by Matsumoto and Nishimura (*note
641References::).  It has a non-repeating period of 2^19937-1, which is a
642Mersenne prime, hence the name of the generator.  The state is 624
643words of 32-bits each, which is iterated with one XOR and shift for each
64432-bit word generated, making the algorithm very fast.  Randomness
645properties are also very good and this is the default algorithm used by
646GMP.
647
648   Linear congruential generators are described in many text books, for
649instance Knuth volume 2 (*note References::).  With a modulus M and
650parameters A and C, a integer state S is iterated by the formula S <-
651A*S+C mod M.  At each step the new state is a linear function of the
652previous, mod M, hence the name of the generator.
653
654   In GMP only moduli of the form 2^N are supported, and the current
655implementation is not as well optimized as it could be.  Overheads are
656significant when N is small, and when N is large clearly the multiply
657at each step will become slow.  This is not a big concern, since the
658Mersenne Twister generator is better in every respect and is therefore
659recommended for all normal applications.
660
661   For both generators the current state can be deduced by observing
662enough output and applying some linear algebra (over GF(2) in the case
663of the Mersenne Twister).  This generally means raw output is
664unsuitable for cryptographic applications without further hashing or
665the like.
666
667
668File: gmp.info,  Node: Assembly Coding,  Prev: Other Algorithms,  Up: Algorithms
669
67016.8 Assembly Coding
671====================
672
673The assembly subroutines in GMP are the most significant source of
674speed at small to moderate sizes.  At larger sizes algorithm selection
675becomes more important, but of course speedups in low level routines
676will still speed up everything proportionally.
677
678   Carry handling and widening multiplies that are important for GMP
679can't be easily expressed in C.  GCC `asm' blocks help a lot and are
680provided in `longlong.h', but hand coding low level routines invariably
681offers a speedup over generic C by a factor of anything from 2 to 10.
682
683* Menu:
684
685* Assembly Code Organisation::
686* Assembly Basics::
687* Assembly Carry Propagation::
688* Assembly Cache Handling::
689* Assembly Functional Units::
690* Assembly Floating Point::
691* Assembly SIMD Instructions::
692* Assembly Software Pipelining::
693* Assembly Loop Unrolling::
694* Assembly Writing Guide::
695
696
697File: gmp.info,  Node: Assembly Code Organisation,  Next: Assembly Basics,  Prev: Assembly Coding,  Up: Assembly Coding
698
69916.8.1 Code Organisation
700------------------------
701
702The various `mpn' subdirectories contain machine-dependent code, written
703in C or assembly.  The `mpn/generic' subdirectory contains default code,
704used when there's no machine-specific version of a particular file.
705
706   Each `mpn' subdirectory is for an ISA family.  Generally 32-bit and
70764-bit variants in a family cannot share code and have separate
708directories.  Within a family further subdirectories may exist for CPU
709variants.
710
711   In each directory a `nails' subdirectory may exist, holding code with
712nails support for that CPU variant.  A `NAILS_SUPPORT' directive in each
713file indicates the nails values the code handles.  Nails code only
714exists where it's faster, or promises to be faster, than plain code.
715There's no effort put into nails if they're not going to enhance a
716given CPU.
717
718
719File: gmp.info,  Node: Assembly Basics,  Next: Assembly Carry Propagation,  Prev: Assembly Code Organisation,  Up: Assembly Coding
720
72116.8.2 Assembly Basics
722----------------------
723
724`mpn_addmul_1' and `mpn_submul_1' are the most important routines for
725overall GMP performance.  All multiplications and divisions come down to
726repeated calls to these.  `mpn_add_n', `mpn_sub_n', `mpn_lshift' and
727`mpn_rshift' are next most important.
728
729   On some CPUs assembly versions of the internal functions
730`mpn_mul_basecase' and `mpn_sqr_basecase' give significant speedups,
731mainly through avoiding function call overheads.  They can also
732potentially make better use of a wide superscalar processor, as can
733bigger primitives like `mpn_addmul_2' or `mpn_addmul_4'.
734
735   The restrictions on overlaps between sources and destinations (*note
736Low-level Functions::) are designed to facilitate a variety of
737implementations.  For example, knowing `mpn_add_n' won't have partly
738overlapping sources and destination means reading can be done far ahead
739of writing on superscalar processors, and loops can be vectorized on a
740vector processor, depending on the carry handling.
741
742
743File: gmp.info,  Node: Assembly Carry Propagation,  Next: Assembly Cache Handling,  Prev: Assembly Basics,  Up: Assembly Coding
744
74516.8.3 Carry Propagation
746------------------------
747
748The problem that presents most challenges in GMP is propagating carries
749from one limb to the next.  In functions like `mpn_addmul_1' and
750`mpn_add_n', carries are the only dependencies between limb operations.
751
752   On processors with carry flags, a straightforward CISC style `adc' is
753generally best.  AMD K6 `mpn_addmul_1' however is an example of an
754unusual set of circumstances where a branch works out better.
755
756   On RISC processors generally an add and compare for overflow is
757used.  This sort of thing can be seen in `mpn/generic/aors_n.c'.  Some
758carry propagation schemes require 4 instructions, meaning at least 4
759cycles per limb, but other schemes may use just 1 or 2.  On wide
760superscalar processors performance may be completely determined by the
761number of dependent instructions between carry-in and carry-out for
762each limb.
763
764   On vector processors good use can be made of the fact that a carry
765bit only very rarely propagates more than one limb.  When adding a
766single bit to a limb, there's only a carry out if that limb was
767`0xFF...FF' which on random data will be only 1 in 2^mp_bits_per_limb.
768`mpn/cray/add_n.c' is an example of this, it adds all limbs in
769parallel, adds one set of carry bits in parallel and then only rarely
770needs to fall through to a loop propagating further carries.
771
772   On the x86s, GCC (as of version 2.95.2) doesn't generate
773particularly good code for the RISC style idioms that are necessary to
774handle carry bits in C.  Often conditional jumps are generated where
775`adc' or `sbb' forms would be better.  And so unfortunately almost any
776loop involving carry bits needs to be coded in assembly for best
777results.
778
779
780File: gmp.info,  Node: Assembly Cache Handling,  Next: Assembly Functional Units,  Prev: Assembly Carry Propagation,  Up: Assembly Coding
781
78216.8.4 Cache Handling
783---------------------
784
785GMP aims to perform well both on operands that fit entirely in L1 cache
786and those which don't.
787
788   Basic routines like `mpn_add_n' or `mpn_lshift' are often used on
789large operands, so L2 and main memory performance is important for them.
790`mpn_mul_1' and `mpn_addmul_1' are mostly used for multiply and square
791basecases, so L1 performance matters most for them, unless assembly
792versions of `mpn_mul_basecase' and `mpn_sqr_basecase' exist, in which
793case the remaining uses are mostly for larger operands.
794
795   For L2 or main memory operands, memory access times will almost
796certainly be more than the calculation time.  The aim therefore is to
797maximize memory throughput, by starting a load of the next cache line
798while processing the contents of the previous one.  Clearly this is
799only possible if the chip has a lock-up free cache or some sort of
800prefetch instruction.  Most current chips have both these features.
801
802   Prefetching sources combines well with loop unrolling, since a
803prefetch can be initiated once per unrolled loop (or more than once if
804the loop covers more than one cache line).
805
806   On CPUs without write-allocate caches, prefetching destinations will
807ensure individual stores don't go further down the cache hierarchy,
808limiting bandwidth.  Of course for calculations which are slow anyway,
809like `mpn_divrem_1', write-throughs might be fine.
810
811   The distance ahead to prefetch will be determined by memory latency
812versus throughput.  The aim of course is to have data arriving
813continuously, at peak throughput.  Some CPUs have limits on the number
814of fetches or prefetches in progress.
815
816   If a special prefetch instruction doesn't exist then a plain load
817can be used, but in that case care must be taken not to attempt to read
818past the end of an operand, since that might produce a segmentation
819violation.
820
821   Some CPUs or systems have hardware that detects sequential memory
822accesses and initiates suitable cache movements automatically, making
823life easy.
824
825
826File: gmp.info,  Node: Assembly Functional Units,  Next: Assembly Floating Point,  Prev: Assembly Cache Handling,  Up: Assembly Coding
827
82816.8.5 Functional Units
829-----------------------
830
831When choosing an approach for an assembly loop, consideration is given
832to what operations can execute simultaneously and what throughput can
833thereby be achieved.  In some cases an algorithm can be tweaked to
834accommodate available resources.
835
836   Loop control will generally require a counter and pointer updates,
837costing as much as 5 instructions, plus any delays a branch introduces.
838CPU addressing modes might reduce pointer updates, perhaps by allowing
839just one updating pointer and others expressed as offsets from it, or
840on CISC chips with all addressing done with the loop counter as a
841scaled index.
842
843   The final loop control cost can be amortised by processing several
844limbs in each iteration (*note Assembly Loop Unrolling::).  This at
845least ensures loop control isn't a big fraction the work done.
846
847   Memory throughput is always a limit.  If perhaps only one load or
848one store can be done per cycle then 3 cycles/limb will the top speed
849for "binary" operations like `mpn_add_n', and any code achieving that
850is optimal.
851
852   Integer resources can be freed up by having the loop counter in a
853float register, or by pressing the float units into use for some
854multiplying, perhaps doing every second limb on the float side (*note
855Assembly Floating Point::).
856
857   Float resources can be freed up by doing carry propagation on the
858integer side, or even by doing integer to float conversions in integers
859using bit twiddling.
860
861
862File: gmp.info,  Node: Assembly Floating Point,  Next: Assembly SIMD Instructions,  Prev: Assembly Functional Units,  Up: Assembly Coding
863
86416.8.6 Floating Point
865---------------------
866
867Floating point arithmetic is used in GMP for multiplications on CPUs
868with poor integer multipliers.  It's mostly useful for `mpn_mul_1',
869`mpn_addmul_1' and `mpn_submul_1' on 64-bit machines, and
870`mpn_mul_basecase' on both 32-bit and 64-bit machines.
871
872   With IEEE 53-bit double precision floats, integer multiplications
873producing up to 53 bits will give exact results.  Breaking a 64x64
874multiplication into eight 16x32->48 bit pieces is convenient.  With
875some care though six 21x32->53 bit products can be used, if one of the
876lower two 21-bit pieces also uses the sign bit.
877
878   For the `mpn_mul_1' family of functions on a 64-bit machine, the
879invariant single limb is split at the start, into 3 or 4 pieces.
880Inside the loop, the bignum operand is split into 32-bit pieces.  Fast
881conversion of these unsigned 32-bit pieces to floating point is highly
882machine-dependent.  In some cases, reading the data into the integer
883unit, zero-extending to 64-bits, then transferring to the floating
884point unit back via memory is the only option.
885
886   Converting partial products back to 64-bit limbs is usually best
887done as a signed conversion.  Since all values are smaller than 2^53,
888signed and unsigned are the same, but most processors lack unsigned
889conversions.
890
891
892
893   Here is a diagram showing 16x32 bit products for an `mpn_mul_1' or
894`mpn_addmul_1' with a 64-bit limb.  The single limb operand V is split
895into four 16-bit parts.  The multi-limb operand U is split in the loop
896into two 32-bit parts.
897
898                     +---+---+---+---+
899                     |v48|v32|v16|v00|    V operand
900                     +---+---+---+---+
901
902                     +-------+---+---+
903                 x   |  u32  |  u00  |    U operand (one limb)
904                     +---------------+
905
906     ---------------------------------
907
908                         +-----------+
909                         | u00 x v00 |    p00    48-bit products
910                         +-----------+
911                     +-----------+
912                     | u00 x v16 |        p16
913                     +-----------+
914                 +-----------+
915                 | u00 x v32 |            p32
916                 +-----------+
917             +-----------+
918             | u00 x v48 |                p48
919             +-----------+
920                 +-----------+
921                 | u32 x v00 |            r32
922                 +-----------+
923             +-----------+
924             | u32 x v16 |                r48
925             +-----------+
926         +-----------+
927         | u32 x v32 |                    r64
928         +-----------+
929     +-----------+
930     | u32 x v48 |                        r80
931     +-----------+
932
933   p32 and r32 can be summed using floating-point addition, and
934likewise p48 and r48.  p00 and p16 can be summed with r64 and r80 from
935the previous iteration.
936
937   For each loop then, four 49-bit quantities are transferred to the
938integer unit, aligned as follows,
939
940     |-----64bits----|-----64bits----|
941                        +------------+
942                        | p00 + r64' |    i00
943                        +------------+
944                    +------------+
945                    | p16 + r80' |        i16
946                    +------------+
947                +------------+
948                | p32 + r32  |            i32
949                +------------+
950            +------------+
951            | p48 + r48  |                i48
952            +------------+
953
954   The challenge then is to sum these efficiently and add in a carry
955limb, generating a low 64-bit result limb and a high 33-bit carry limb
956(i48 extends 33 bits into the high half).
957
958
959File: gmp.info,  Node: Assembly SIMD Instructions,  Next: Assembly Software Pipelining,  Prev: Assembly Floating Point,  Up: Assembly Coding
960
96116.8.7 SIMD Instructions
962------------------------
963
964The single-instruction multiple-data support in current microprocessors
965is aimed at signal processing algorithms where each data point can be
966treated more or less independently.  There's generally not much support
967for propagating the sort of carries that arise in GMP.
968
969   SIMD multiplications of say four 16x16 bit multiplies only do as much
970work as one 32x32 from GMP's point of view, and need some shifts and
971adds besides.  But of course if say the SIMD form is fully pipelined
972and uses less instruction decoding then it may still be worthwhile.
973
974   On the x86 chips, MMX has so far found a use in `mpn_rshift' and
975`mpn_lshift', and is used in a special case for 16-bit multipliers in
976the P55 `mpn_mul_1'.  SSE2 is used for Pentium 4 `mpn_mul_1',
977`mpn_addmul_1', and `mpn_submul_1'.
978
979
980File: gmp.info,  Node: Assembly Software Pipelining,  Next: Assembly Loop Unrolling,  Prev: Assembly SIMD Instructions,  Up: Assembly Coding
981
98216.8.8 Software Pipelining
983--------------------------
984
985Software pipelining consists of scheduling instructions around the
986branch point in a loop.  For example a loop might issue a load not for
987use in the present iteration but the next, thereby allowing extra
988cycles for the data to arrive from memory.
989
990   Naturally this is wanted only when doing things like loads or
991multiplies that take several cycles to complete, and only where a CPU
992has multiple functional units so that other work can be done in the
993meantime.
994
995   A pipeline with several stages will have a data value in progress at
996each stage and each loop iteration moves them along one stage.  This is
997like juggling.
998
999   If the latency of some instruction is greater than the loop time
1000then it will be necessary to unroll, so one register has a result ready
1001to use while another (or multiple others) are still in progress.
1002(*note Assembly Loop Unrolling::).
1003
1004
1005File: gmp.info,  Node: Assembly Loop Unrolling,  Next: Assembly Writing Guide,  Prev: Assembly Software Pipelining,  Up: Assembly Coding
1006
100716.8.9 Loop Unrolling
1008---------------------
1009
1010Loop unrolling consists of replicating code so that several limbs are
1011processed in each loop.  At a minimum this reduces loop overheads by a
1012corresponding factor, but it can also allow better register usage, for
1013example alternately using one register combination and then another.
1014Judicious use of `m4' macros can help avoid lots of duplication in the
1015source code.
1016
1017   Any amount of unrolling can be handled with a loop counter that's
1018decremented by N each time, stopping when the remaining count is less
1019than the further N the loop will process.  Or by subtracting N at the
1020start, the termination condition becomes when the counter C is less
1021than 0 (and the count of remaining limbs is C+N).
1022
1023   Alternately for a power of 2 unroll the loop count and remainder can
1024be established with a shift and mask.  This is convenient if also
1025making a computed jump into the middle of a large loop.
1026
1027   The limbs not a multiple of the unrolling can be handled in various
1028ways, for example
1029
1030   * A simple loop at the end (or the start) to process the excess.
1031     Care will be wanted that it isn't too much slower than the
1032     unrolled part.
1033
1034   * A set of binary tests, for example after an 8-limb unrolling, test
1035     for 4 more limbs to process, then a further 2 more or not, and
1036     finally 1 more or not.  This will probably take more code space
1037     than a simple loop.
1038
1039   * A `switch' statement, providing separate code for each possible
1040     excess, for example an 8-limb unrolling would have separate code
1041     for 0 remaining, 1 remaining, etc, up to 7 remaining.  This might
1042     take a lot of code, but may be the best way to optimize all cases
1043     in combination with a deep pipelined loop.
1044
1045   * A computed jump into the middle of the loop, thus making the first
1046     iteration handle the excess.  This should make times smoothly
1047     increase with size, which is attractive, but setups for the jump
1048     and adjustments for pointers can be tricky and could become quite
1049     difficult in combination with deep pipelining.
1050
1051
1052File: gmp.info,  Node: Assembly Writing Guide,  Prev: Assembly Loop Unrolling,  Up: Assembly Coding
1053
105416.8.10 Writing Guide
1055---------------------
1056
1057This is a guide to writing software pipelined loops for processing limb
1058vectors in assembly.
1059
1060   First determine the algorithm and which instructions are needed.
1061Code it without unrolling or scheduling, to make sure it works.  On a
10623-operand CPU try to write each new value to a new register, this will
1063greatly simplify later steps.
1064
1065   Then note for each instruction the functional unit and/or issue port
1066requirements.  If an instruction can use either of two units, like U0
1067or U1 then make a category "U0/U1".  Count the total using each unit
1068(or combined unit), and count all instructions.
1069
1070   Figure out from those counts the best possible loop time.  The goal
1071will be to find a perfect schedule where instruction latencies are
1072completely hidden.  The total instruction count might be the limiting
1073factor, or perhaps a particular functional unit.  It might be possible
1074to tweak the instructions to help the limiting factor.
1075
1076   Suppose the loop time is N, then make N issue buckets, with the
1077final loop branch at the end of the last.  Now fill the buckets with
1078dummy instructions using the functional units desired.  Run this to
1079make sure the intended speed is reached.
1080
1081   Now replace the dummy instructions with the real instructions from
1082the slow but correct loop you started with.  The first will typically
1083be a load instruction.  Then the instruction using that value is placed
1084in a bucket an appropriate distance down.  Run the loop again, to check
1085it still runs at target speed.
1086
1087   Keep placing instructions, frequently measuring the loop.  After a
1088few you will need to wrap around from the last bucket back to the top
1089of the loop.  If you used the new-register for new-value strategy above
1090then there will be no register conflicts.  If not then take care not to
1091clobber something already in use.  Changing registers at this time is
1092very error prone.
1093
1094   The loop will overlap two or more of the original loop iterations,
1095and the computation of one vector element result will be started in one
1096iteration of the new loop, and completed one or several iterations
1097later.
1098
1099   The final step is to create feed-in and wind-down code for the loop.
1100A good way to do this is to make a copy (or copies) of the loop at the
1101start and delete those instructions which don't have valid antecedents,
1102and at the end replicate and delete those whose results are unwanted
1103(including any further loads).
1104
1105   The loop will have a minimum number of limbs loaded and processed,
1106so the feed-in code must test if the request size is smaller and skip
1107either to a suitable part of the wind-down or to special code for small
1108sizes.
1109
1110
1111File: gmp.info,  Node: Internals,  Next: Contributors,  Prev: Algorithms,  Up: Top
1112
111317 Internals
1114************
1115
1116*This chapter is provided only for informational purposes and the
1117various internals described here may change in future GMP releases.
1118Applications expecting to be compatible with future releases should use
1119only the documented interfaces described in previous chapters.*
1120
1121* Menu:
1122
1123* Integer Internals::
1124* Rational Internals::
1125* Float Internals::
1126* Raw Output Internals::
1127* C++ Interface Internals::
1128
1129
1130File: gmp.info,  Node: Integer Internals,  Next: Rational Internals,  Prev: Internals,  Up: Internals
1131
113217.1 Integer Internals
1133======================
1134
1135`mpz_t' variables represent integers using sign and magnitude, in space
1136dynamically allocated and reallocated.  The fields are as follows.
1137
1138`_mp_size'
1139     The number of limbs, or the negative of that when representing a
1140     negative integer.  Zero is represented by `_mp_size' set to zero,
1141     in which case the `_mp_d' data is unused.
1142
1143`_mp_d'
1144     A pointer to an array of limbs which is the magnitude.  These are
1145     stored "little endian" as per the `mpn' functions, so `_mp_d[0]'
1146     is the least significant limb and `_mp_d[ABS(_mp_size)-1]' is the
1147     most significant.  Whenever `_mp_size' is non-zero, the most
1148     significant limb is non-zero.
1149
1150     Currently there's always at least one limb allocated, so for
1151     instance `mpz_set_ui' never needs to reallocate, and `mpz_get_ui'
1152     can fetch `_mp_d[0]' unconditionally (though its value is then
1153     only wanted if `_mp_size' is non-zero).
1154
1155`_mp_alloc'
1156     `_mp_alloc' is the number of limbs currently allocated at `_mp_d',
1157     and naturally `_mp_alloc >= ABS(_mp_size)'.  When an `mpz' routine
1158     is about to (or might be about to) increase `_mp_size', it checks
1159     `_mp_alloc' to see whether there's enough space, and reallocates
1160     if not.  `MPZ_REALLOC' is generally used for this.
1161
1162   The various bitwise logical functions like `mpz_and' behave as if
1163negative values were twos complement.  But sign and magnitude is always
1164used internally, and necessary adjustments are made during the
1165calculations.  Sometimes this isn't pretty, but sign and magnitude are
1166best for other routines.
1167
1168   Some internal temporary variables are setup with `MPZ_TMP_INIT' and
1169these have `_mp_d' space obtained from `TMP_ALLOC' rather than the
1170memory allocation functions.  Care is taken to ensure that these are
1171big enough that no reallocation is necessary (since it would have
1172unpredictable consequences).
1173
1174   `_mp_size' and `_mp_alloc' are `int', although `mp_size_t' is
1175usually a `long'.  This is done to make the fields just 32 bits on some
117664 bits systems, thereby saving a few bytes of data space but still
1177providing plenty of range.
1178
1179
1180File: gmp.info,  Node: Rational Internals,  Next: Float Internals,  Prev: Integer Internals,  Up: Internals
1181
118217.2 Rational Internals
1183=======================
1184
1185`mpq_t' variables represent rationals using an `mpz_t' numerator and
1186denominator (*note Integer Internals::).
1187
1188   The canonical form adopted is denominator positive (and non-zero),
1189no common factors between numerator and denominator, and zero uniquely
1190represented as 0/1.
1191
1192   It's believed that casting out common factors at each stage of a
1193calculation is best in general.  A GCD is an O(N^2) operation so it's
1194better to do a few small ones immediately than to delay and have to do
1195a big one later.  Knowing the numerator and denominator have no common
1196factors can be used for example in `mpq_mul' to make only two cross
1197GCDs necessary, not four.
1198
1199   This general approach to common factors is badly sub-optimal in the
1200presence of simple factorizations or little prospect for cancellation,
1201but GMP has no way to know when this will occur.  As per *note
1202Efficiency::, that's left to applications.  The `mpq_t' framework might
1203still suit, with `mpq_numref' and `mpq_denref' for direct access to the
1204numerator and denominator, or of course `mpz_t' variables can be used
1205directly.
1206
1207
1208File: gmp.info,  Node: Float Internals,  Next: Raw Output Internals,  Prev: Rational Internals,  Up: Internals
1209
121017.3 Float Internals
1211====================
1212
1213Efficient calculation is the primary aim of GMP floats and the use of
1214whole limbs and simple rounding facilitates this.
1215
1216   `mpf_t' floats have a variable precision mantissa and a single
1217machine word signed exponent.  The mantissa is represented using sign
1218and magnitude.
1219
1220        most                   least
1221     significant            significant
1222        limb                   limb
1223
1224                                 _mp_d
1225      |---- _mp_exp --->           |
1226       _____ _____ _____ _____ _____
1227      |_____|_____|_____|_____|_____|
1228                        . <------------ radix point
1229
1230       <-------- _mp_size --------->
1231
1232The fields are as follows.
1233
1234`_mp_size'
1235     The number of limbs currently in use, or the negative of that when
1236     representing a negative value.  Zero is represented by `_mp_size'
1237     and `_mp_exp' both set to zero, and in that case the `_mp_d' data
1238     is unused.  (In the future `_mp_exp' might be undefined when
1239     representing zero.)
1240
1241`_mp_prec'
1242     The precision of the mantissa, in limbs.  In any calculation the
1243     aim is to produce `_mp_prec' limbs of result (the most significant
1244     being non-zero).
1245
1246`_mp_d'
1247     A pointer to the array of limbs which is the absolute value of the
1248     mantissa.  These are stored "little endian" as per the `mpn'
1249     functions, so `_mp_d[0]' is the least significant limb and
1250     `_mp_d[ABS(_mp_size)-1]' the most significant.
1251
1252     The most significant limb is always non-zero, but there are no
1253     other restrictions on its value, in particular the highest 1 bit
1254     can be anywhere within the limb.
1255
1256     `_mp_prec+1' limbs are allocated to `_mp_d', the extra limb being
1257     for convenience (see below).  There are no reallocations during a
1258     calculation, only in a change of precision with `mpf_set_prec'.
1259
1260`_mp_exp'
1261     The exponent, in limbs, determining the location of the implied
1262     radix point.  Zero means the radix point is just above the most
1263     significant limb.  Positive values mean a radix point offset
1264     towards the lower limbs and hence a value >= 1, as for example in
1265     the diagram above.  Negative exponents mean a radix point further
1266     above the highest limb.
1267
1268     Naturally the exponent can be any value, it doesn't have to fall
1269     within the limbs as the diagram shows, it can be a long way above
1270     or a long way below.  Limbs other than those included in the
1271     `{_mp_d,_mp_size}' data are treated as zero.
1272
1273   The `_mp_size' and `_mp_prec' fields are `int', although the
1274`mp_size_t' type is usually a `long'.  The `_mp_exp' field is usually
1275`long'.  This is done to make some fields just 32 bits on some 64 bits
1276systems, thereby saving a few bytes of data space but still providing
1277plenty of precision and a very large range.
1278
1279
1280The following various points should be noted.
1281
1282Low Zeros
1283     The least significant limbs `_mp_d[0]' etc can be zero, though
1284     such low zeros can always be ignored.  Routines likely to produce
1285     low zeros check and avoid them to save time in subsequent
1286     calculations, but for most routines they're quite unlikely and
1287     aren't checked.
1288
1289Mantissa Size Range
1290     The `_mp_size' count of limbs in use can be less than `_mp_prec' if
1291     the value can be represented in less.  This means low precision
1292     values or small integers stored in a high precision `mpf_t' can
1293     still be operated on efficiently.
1294
1295     `_mp_size' can also be greater than `_mp_prec'.  Firstly a value is
1296     allowed to use all of the `_mp_prec+1' limbs available at `_mp_d',
1297     and secondly when `mpf_set_prec_raw' lowers `_mp_prec' it leaves
1298     `_mp_size' unchanged and so the size can be arbitrarily bigger than
1299     `_mp_prec'.
1300
1301Rounding
1302     All rounding is done on limb boundaries.  Calculating `_mp_prec'
1303     limbs with the high non-zero will ensure the application requested
1304     minimum precision is obtained.
1305
1306     The use of simple "trunc" rounding towards zero is efficient,
1307     since there's no need to examine extra limbs and increment or
1308     decrement.
1309
1310Bit Shifts
1311     Since the exponent is in limbs, there are no bit shifts in basic
1312     operations like `mpf_add' and `mpf_mul'.  When differing exponents
1313     are encountered all that's needed is to adjust pointers to line up
1314     the relevant limbs.
1315
1316     Of course `mpf_mul_2exp' and `mpf_div_2exp' will require bit
1317     shifts, but the choice is between an exponent in limbs which
1318     requires shifts there, or one in bits which requires them almost
1319     everywhere else.
1320
1321Use of `_mp_prec+1' Limbs
1322     The extra limb on `_mp_d' (`_mp_prec+1' rather than just
1323     `_mp_prec') helps when an `mpf' routine might get a carry from its
1324     operation.  `mpf_add' for instance will do an `mpn_add' of
1325     `_mp_prec' limbs.  If there's no carry then that's the result, but
1326     if there is a carry then it's stored in the extra limb of space and
1327     `_mp_size' becomes `_mp_prec+1'.
1328
1329     Whenever `_mp_prec+1' limbs are held in a variable, the low limb
1330     is not needed for the intended precision, only the `_mp_prec' high
1331     limbs.  But zeroing it out or moving the rest down is unnecessary.
1332     Subsequent routines reading the value will simply take the high
1333     limbs they need, and this will be `_mp_prec' if their target has
1334     that same precision.  This is no more than a pointer adjustment,
1335     and must be checked anyway since the destination precision can be
1336     different from the sources.
1337
1338     Copy functions like `mpf_set' will retain a full `_mp_prec+1' limbs
1339     if available.  This ensures that a variable which has `_mp_size'
1340     equal to `_mp_prec+1' will get its full exact value copied.
1341     Strictly speaking this is unnecessary since only `_mp_prec' limbs
1342     are needed for the application's requested precision, but it's
1343     considered that an `mpf_set' from one variable into another of the
1344     same precision ought to produce an exact copy.
1345
1346Application Precisions
1347     `__GMPF_BITS_TO_PREC' converts an application requested precision
1348     to an `_mp_prec'.  The value in bits is rounded up to a whole limb
1349     then an extra limb is added since the most significant limb of
1350     `_mp_d' is only non-zero and therefore might contain only one bit.
1351
1352     `__GMPF_PREC_TO_BITS' does the reverse conversion, and removes the
1353     extra limb from `_mp_prec' before converting to bits.  The net
1354     effect of reading back with `mpf_get_prec' is simply the precision
1355     rounded up to a multiple of `mp_bits_per_limb'.
1356
1357     Note that the extra limb added here for the high only being
1358     non-zero is in addition to the extra limb allocated to `_mp_d'.
1359     For example with a 32-bit limb, an application request for 250
1360     bits will be rounded up to 8 limbs, then an extra added for the
1361     high being only non-zero, giving an `_mp_prec' of 9.  `_mp_d' then
1362     gets 10 limbs allocated.  Reading back with `mpf_get_prec' will
1363     take `_mp_prec' subtract 1 limb and multiply by 32, giving 256
1364     bits.
1365
1366     Strictly speaking, the fact the high limb has at least one bit
1367     means that a float with, say, 3 limbs of 32-bits each will be
1368     holding at least 65 bits, but for the purposes of `mpf_t' it's
1369     considered simply to be 64 bits, a nice multiple of the limb size.
1370
1371
1372File: gmp.info,  Node: Raw Output Internals,  Next: C++ Interface Internals,  Prev: Float Internals,  Up: Internals
1373
137417.4 Raw Output Internals
1375=========================
1376
1377`mpz_out_raw' uses the following format.
1378
1379     +------+------------------------+
1380     | size |       data bytes       |
1381     +------+------------------------+
1382
1383   The size is 4 bytes written most significant byte first, being the
1384number of subsequent data bytes, or the twos complement negative of
1385that when a negative integer is represented.  The data bytes are the
1386absolute value of the integer, written most significant byte first.
1387
1388   The most significant data byte is always non-zero, so the output is
1389the same on all systems, irrespective of limb size.
1390
1391   In GMP 1, leading zero bytes were written to pad the data bytes to a
1392multiple of the limb size.  `mpz_inp_raw' will still accept this, for
1393compatibility.
1394
1395   The use of "big endian" for both the size and data fields is
1396deliberate, it makes the data easy to read in a hex dump of a file.
1397Unfortunately it also means that the limb data must be reversed when
1398reading or writing, so neither a big endian nor little endian system
1399can just read and write `_mp_d'.
1400
1401
1402File: gmp.info,  Node: C++ Interface Internals,  Prev: Raw Output Internals,  Up: Internals
1403
140417.5 C++ Interface Internals
1405============================
1406
1407A system of expression templates is used to ensure something like
1408`a=b+c' turns into a simple call to `mpz_add' etc.  For `mpf_class' the
1409scheme also ensures the precision of the final destination is used for
1410any temporaries within a statement like `f=w*x+y*z'.  These are
1411important features which a naive implementation cannot provide.
1412
1413   A simplified description of the scheme follows.  The true scheme is
1414complicated by the fact that expressions have different return types.
1415For detailed information, refer to the source code.
1416
1417   To perform an operation, say, addition, we first define a "function
1418object" evaluating it,
1419
1420     struct __gmp_binary_plus
1421     {
1422       static void eval(mpf_t f, mpf_t g, mpf_t h) { mpf_add(f, g, h); }
1423     };
1424
1425And an "additive expression" object,
1426
1427     __gmp_expr<__gmp_binary_expr<mpf_class, mpf_class, __gmp_binary_plus> >
1428     operator+(const mpf_class &f, const mpf_class &g)
1429     {
1430       return __gmp_expr
1431         <__gmp_binary_expr<mpf_class, mpf_class, __gmp_binary_plus> >(f, g);
1432     }
1433
1434   The seemingly redundant `__gmp_expr<__gmp_binary_expr<...>>' is used
1435to encapsulate any possible kind of expression into a single template
1436type.  In fact even `mpf_class' etc are `typedef' specializations of
1437`__gmp_expr'.
1438
1439   Next we define assignment of `__gmp_expr' to `mpf_class'.
1440
1441     template <class T>
1442     mpf_class & mpf_class::operator=(const __gmp_expr<T> &expr)
1443     {
1444       expr.eval(this->get_mpf_t(), this->precision());
1445       return *this;
1446     }
1447
1448     template <class Op>
1449     void __gmp_expr<__gmp_binary_expr<mpf_class, mpf_class, Op> >::eval
1450     (mpf_t f, mp_bitcnt_t precision)
1451     {
1452       Op::eval(f, expr.val1.get_mpf_t(), expr.val2.get_mpf_t());
1453     }
1454
1455   where `expr.val1' and `expr.val2' are references to the expression's
1456operands (here `expr' is the `__gmp_binary_expr' stored within the
1457`__gmp_expr').
1458
1459   This way, the expression is actually evaluated only at the time of
1460assignment, when the required precision (that of `f') is known.
1461Furthermore the target `mpf_t' is now available, thus we can call
1462`mpf_add' directly with `f' as the output argument.
1463
1464   Compound expressions are handled by defining operators taking
1465subexpressions as their arguments, like this:
1466
1467     template <class T, class U>
1468     __gmp_expr
1469     <__gmp_binary_expr<__gmp_expr<T>, __gmp_expr<U>, __gmp_binary_plus> >
1470     operator+(const __gmp_expr<T> &expr1, const __gmp_expr<U> &expr2)
1471     {
1472       return __gmp_expr
1473         <__gmp_binary_expr<__gmp_expr<T>, __gmp_expr<U>, __gmp_binary_plus> >
1474         (expr1, expr2);
1475     }
1476
1477   And the corresponding specializations of `__gmp_expr::eval':
1478
1479     template <class T, class U, class Op>
1480     void __gmp_expr
1481     <__gmp_binary_expr<__gmp_expr<T>, __gmp_expr<U>, Op> >::eval
1482     (mpf_t f, mp_bitcnt_t precision)
1483     {
1484       // declare two temporaries
1485       mpf_class temp1(expr.val1, precision), temp2(expr.val2, precision);
1486       Op::eval(f, temp1.get_mpf_t(), temp2.get_mpf_t());
1487     }
1488
1489   The expression is thus recursively evaluated to any level of
1490complexity and all subexpressions are evaluated to the precision of `f'.
1491
1492
1493File: gmp.info,  Node: Contributors,  Next: References,  Prev: Internals,  Up: Top
1494
1495Appendix A Contributors
1496***********************
1497
1498Torbj�rn Granlund wrote the original GMP library and is still the main
1499developer.  Code not explicitly attributed to others, was contributed by
1500Torbj�rn.  Several other individuals and organizations have contributed
1501GMP.  Here is a list in chronological order on first contribution:
1502
1503   Gunnar Sj�din and Hans Riesel helped with mathematical problems in
1504early versions of the library.
1505
1506   Richard Stallman helped with the interface design and revised the
1507first version of this manual.
1508
1509   Brian Beuning and Doug Lea helped with testing of early versions of
1510the library and made creative suggestions.
1511
1512   John Amanatides of York University in Canada contributed the function
1513`mpz_probab_prime_p'.
1514
1515   Paul Zimmermann wrote the REDC-based mpz_powm code, the
1516Sch�nhage-Strassen FFT multiply code, and the Karatsuba square root
1517code.  He also improved the Toom3 code for GMP 4.2.  Paul sparked the
1518development of GMP 2, with his comparisons between bignum packages.
1519The ECMNET project Paul is organizing was a driving force behind many
1520of the optimizations in GMP 3.  Paul also wrote the new GMP 4.3 nth
1521root code (with Torbj�rn).
1522
1523   Ken Weber (Kent State University, Universidade Federal do Rio Grande
1524do Sul) contributed now defunct versions of `mpz_gcd', `mpz_divexact',
1525`mpn_gcd', and `mpn_bdivmod', partially supported by CNPq (Brazil)
1526grant 301314194-2.
1527
1528   Per Bothner of Cygnus Support helped to set up GMP to use Cygnus'
1529configure.  He has also made valuable suggestions and tested numerous
1530intermediary releases.
1531
1532   Joachim Hollman was involved in the design of the `mpf' interface,
1533and in the `mpz' design revisions for version 2.
1534
1535   Bennet Yee contributed the initial versions of `mpz_jacobi' and
1536`mpz_legendre'.
1537
1538   Andreas Schwab contributed the files `mpn/m68k/lshift.S' and
1539`mpn/m68k/rshift.S' (now in `.asm' form).
1540
1541   Robert Harley of Inria, France and David Seal of ARM, England,
1542suggested clever improvements for population count.  Robert also wrote
1543highly optimized Karatsuba and 3-way Toom multiplication functions for
1544GMP 3, and contributed the ARM assembly code.
1545
1546   Torsten Ekedahl of the Mathematical department of Stockholm
1547University provided significant inspiration during several phases of
1548the GMP development.  His mathematical expertise helped improve several
1549algorithms.
1550
1551   Linus Nordberg wrote the new configure system based on autoconf and
1552implemented the new random functions.
1553
1554   Kevin Ryde worked on a large number of things: optimized x86 code,
1555m4 asm macros, parameter tuning, speed measuring, the configure system,
1556function inlining, divisibility tests, bit scanning, Jacobi symbols,
1557Fibonacci and Lucas number functions, printf and scanf functions, perl
1558interface, demo expression parser, the algorithms chapter in the
1559manual, `gmpasm-mode.el', and various miscellaneous improvements
1560elsewhere.
1561
1562   Kent Boortz made the Mac OS 9 port.
1563
1564   Steve Root helped write the optimized alpha 21264 assembly code.
1565
1566   Gerardo Ballabio wrote the `gmpxx.h' C++ class interface and the C++
1567`istream' input routines.
1568
1569   Jason Moxham rewrote `mpz_fac_ui'.
1570
1571   Pedro Gimeno implemented the Mersenne Twister and made other random
1572number improvements.
1573
1574   Niels M�ller wrote the sub-quadratic GCD and extended GCD code, the
1575quadratic Hensel division code, and (with Torbj�rn) the new divide and
1576conquer division code for GMP 4.3.  Niels also helped implement the new
1577Toom multiply code for GMP 4.3 and implemented helper functions to
1578simplify Toom evaluations for GMP 5.0.  He wrote the original version
1579of mpn_mulmod_bnm1.
1580
1581   Alberto Zanoni and Marco Bodrato suggested the unbalanced multiply
1582strategy, and found the optimal strategies for evaluation and
1583interpolation in Toom multiplication.
1584
1585   Marco Bodrato helped implement the new Toom multiply code for GMP
15864.3 and implemented most of the new Toom multiply and squaring code for
15875.0.  He is the main author of the current mpn_mulmod_bnm1 and
1588mpn_mullo_n.  Marco also wrote the functions mpn_invert and
1589mpn_invertappr.
1590
1591   David Harvey suggested the internal function `mpn_bdiv_dbm1',
1592implementing division relevant to Toom multiplication.  He also worked
1593on fast assembly sequences, in particular on a fast AMD64
1594`mpn_mul_basecase'.
1595
1596   Martin Boij wrote `mpn_perfect_power_p'.
1597
1598   (This list is chronological, not ordered after significance.  If you
1599have contributed to GMP but are not listed above, please tell
1600<[email protected]> about the omission!)
1601
1602   The development of floating point functions of GNU MP 2, were
1603supported in part by the ESPRIT-BRA (Basic Research Activities) 6846
1604project POSSO (POlynomial System SOlving).
1605
1606   The development of GMP 2, 3, and 4 was supported in part by the IDA
1607Center for Computing Sciences.
1608
1609   Thanks go to Hans Thorsen for donating an SGI system for the GMP
1610test system environment.
1611
1612
1613File: gmp.info,  Node: References,  Next: GNU Free Documentation License,  Prev: Contributors,  Up: Top
1614
1615Appendix B References
1616*********************
1617
1618B.1 Books
1619=========
1620
1621   * Jonathan M. Borwein and Peter B. Borwein, "Pi and the AGM: A Study
1622     in Analytic Number Theory and Computational Complexity", Wiley,
1623     1998.
1624
1625   * Richard Crandall and Carl Pomerance, "Prime Numbers: A
1626     Computational Perspective", 2nd edition, Springer-Verlag, 2005.
1627     `http://www.math.dartmouth.edu/~carlp/'
1628
1629   * Henri Cohen, "A Course in Computational Algebraic Number Theory",
1630     Graduate Texts in Mathematics number 138, Springer-Verlag, 1993.
1631     `http://www.math.u-bordeaux.fr/~cohen/'
1632
1633   * Donald E. Knuth, "The Art of Computer Programming", volume 2,
1634     "Seminumerical Algorithms", 3rd edition, Addison-Wesley, 1998.
1635     `http://www-cs-faculty.stanford.edu/~knuth/taocp.html'
1636
1637   * John D. Lipson, "Elements of Algebra and Algebraic Computing", The
1638     Benjamin Cummings Publishing Company Inc, 1981.
1639
1640   * Alfred J. Menezes, Paul C. van Oorschot and Scott A. Vanstone,
1641     "Handbook of Applied Cryptography",
1642     `http://www.cacr.math.uwaterloo.ca/hac/'
1643
1644   * Richard M. Stallman and the GCC Developer Community, "Using the
1645     GNU Compiler Collection", Free Software Foundation, 2008,
1646     available online `http://gcc.gnu.org/onlinedocs/', and in the GCC
1647     package `ftp://ftp.gnu.org/gnu/gcc/'
1648
1649B.2 Papers
1650==========
1651
1652   * Yves Bertot, Nicolas Magaud and Paul Zimmermann, "A Proof of GMP
1653     Square Root", Journal of Automated Reasoning, volume 29, 2002, pp.
1654     225-252.  Also available online as INRIA Research Report 4475,
1655     June 2002, `http://hal.inria.fr/docs/00/07/21/13/PDF/RR-4475.pdf'
1656
1657   * Christoph Burnikel and Joachim Ziegler, "Fast Recursive Division",
1658     Max-Planck-Institut fuer Informatik Research Report MPI-I-98-1-022,
1659     `http://data.mpi-sb.mpg.de/internet/reports.nsf/NumberView/1998-1-022'
1660
1661   * Torbj�rn Granlund and Peter L. Montgomery, "Division by Invariant
1662     Integers using Multiplication", in Proceedings of the SIGPLAN
1663     PLDI'94 Conference, June 1994.  Also available
1664     `http://gmplib.org/~tege/divcnst-pldi94.pdf'.
1665
1666   * Niels M�ller and Torbj�rn Granlund, "Improved division by invariant
1667     integers", IEEE Transactions on Computers, 11 June 2010.
1668     `http://gmplib.org/~tege/division-paper.pdf'
1669
1670   * Torbj�rn Granlund and Niels M�ller, "Division of integers large and
1671     small", to appear.
1672
1673   * Tudor Jebelean, "An algorithm for exact division", Journal of
1674     Symbolic Computation, volume 15, 1993, pp. 169-180.  Research
1675     report version available
1676     `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1992/92-35.ps.gz'
1677
1678   * Tudor Jebelean, "Exact Division with Karatsuba Complexity -
1679     Extended Abstract", RISC-Linz technical report 96-31,
1680     `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1996/96-31.ps.gz'
1681
1682   * Tudor Jebelean, "Practical Integer Division with Karatsuba
1683     Complexity", ISSAC 97, pp. 339-341.  Technical report available
1684     `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1996/96-29.ps.gz'
1685
1686   * Tudor Jebelean, "A Generalization of the Binary GCD Algorithm",
1687     ISSAC 93, pp. 111-116.  Technical report version available
1688     `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1993/93-01.ps.gz'
1689
1690   * Tudor Jebelean, "A Double-Digit Lehmer-Euclid Algorithm for
1691     Finding the GCD of Long Integers", Journal of Symbolic
1692     Computation, volume 19, 1995, pp. 145-157.  Technical report
1693     version also available
1694     `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1992/92-69.ps.gz'
1695
1696   * Werner Krandick and Tudor Jebelean, "Bidirectional Exact Integer
1697     Division", Journal of Symbolic Computation, volume 21, 1996, pp.
1698     441-455.  Early technical report version also available
1699     `ftp://ftp.risc.uni-linz.ac.at/pub/techreports/1994/94-50.ps.gz'
1700
1701   * Makoto Matsumoto and Takuji Nishimura, "Mersenne Twister: A
1702     623-dimensionally equidistributed uniform pseudorandom number
1703     generator", ACM Transactions on Modelling and Computer Simulation,
1704     volume 8, January 1998, pp. 3-30.  Available online
1705     `http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.ps.gz'
1706     (or .pdf)
1707
1708   * R. Moenck and A. Borodin, "Fast Modular Transforms via Division",
1709     Proceedings of the 13th Annual IEEE Symposium on Switching and
1710     Automata Theory, October 1972, pp. 90-96.  Reprinted as "Fast
1711     Modular Transforms", Journal of Computer and System Sciences,
1712     volume 8, number 3, June 1974, pp. 366-386.
1713
1714   * Niels M�ller, "On Sch�nhage's algorithm and subquadratic integer
1715     GCD   computation", in Mathematics of Computation, volume 77,
1716     January 2008, pp.    589-607.
1717
1718   * Peter L. Montgomery, "Modular Multiplication Without Trial
1719     Division", in Mathematics of Computation, volume 44, number 170,
1720     April 1985.
1721
1722   * Arnold Sch�nhage and Volker Strassen, "Schnelle Multiplikation
1723     grosser Zahlen", Computing 7, 1971, pp. 281-292.
1724
1725   * Kenneth Weber, "The accelerated integer GCD algorithm", ACM
1726     Transactions on Mathematical Software, volume 21, number 1, March
1727     1995, pp. 111-122.
1728
1729   * Paul Zimmermann, "Karatsuba Square Root", INRIA Research Report
1730     3805, November 1999,
1731     `http://hal.inria.fr/inria-00072854/PDF/RR-3805.pdf'
1732
1733   * Paul Zimmermann, "A Proof of GMP Fast Division and Square Root
1734     Implementations",
1735     `http://www.loria.fr/~zimmerma/papers/proof-div-sqrt.ps.gz'
1736
1737   * Dan Zuras, "On Squaring and Multiplying Large Integers", ARITH-11:
1738     IEEE Symposium on Computer Arithmetic, 1993, pp. 260 to 271.
1739     Reprinted as "More on Multiplying and Squaring Large Integers",
1740     IEEE Transactions on Computers, volume 43, number 8, August 1994,
1741     pp. 899-908.
1742
1743
1744File: gmp.info,  Node: GNU Free Documentation License,  Next: Concept Index,  Prev: References,  Up: Top
1745
1746Appendix C GNU Free Documentation License
1747*****************************************
1748
1749                     Version 1.3, 3 November 2008
1750
1751     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
1752     `http://fsf.org/'
1753
1754     Everyone is permitted to copy and distribute verbatim copies
1755     of this license document, but changing it is not allowed.
1756
1757  0. PREAMBLE
1758
1759     The purpose of this License is to make a manual, textbook, or other
1760     functional and useful document "free" in the sense of freedom: to
1761     assure everyone the effective freedom to copy and redistribute it,
1762     with or without modifying it, either commercially or
1763     noncommercially.  Secondarily, this License preserves for the
1764     author and publisher a way to get credit for their work, while not
1765     being considered responsible for modifications made by others.
1766
1767     This License is a kind of "copyleft", which means that derivative
1768     works of the document must themselves be free in the same sense.
1769     It complements the GNU General Public License, which is a copyleft
1770     license designed for free software.
1771
1772     We have designed this License in order to use it for manuals for
1773     free software, because free software needs free documentation: a
1774     free program should come with manuals providing the same freedoms
1775     that the software does.  But this License is not limited to
1776     software manuals; it can be used for any textual work, regardless
1777     of subject matter or whether it is published as a printed book.
1778     We recommend this License principally for works whose purpose is
1779     instruction or reference.
1780
1781  1. APPLICABILITY AND DEFINITIONS
1782
1783     This License applies to any manual or other work, in any medium,
1784     that contains a notice placed by the copyright holder saying it
1785     can be distributed under the terms of this License.  Such a notice
1786     grants a world-wide, royalty-free license, unlimited in duration,
1787     to use that work under the conditions stated herein.  The
1788     "Document", below, refers to any such manual or work.  Any member
1789     of the public is a licensee, and is addressed as "you".  You
1790     accept the license if you copy, modify or distribute the work in a
1791     way requiring permission under copyright law.
1792
1793     A "Modified Version" of the Document means any work containing the
1794     Document or a portion of it, either copied verbatim, or with
1795     modifications and/or translated into another language.
1796
1797     A "Secondary Section" is a named appendix or a front-matter section
1798     of the Document that deals exclusively with the relationship of the
1799     publishers or authors of the Document to the Document's overall
1800     subject (or to related matters) and contains nothing that could
1801     fall directly within that overall subject.  (Thus, if the Document
1802     is in part a textbook of mathematics, a Secondary Section may not
1803     explain any mathematics.)  The relationship could be a matter of
1804     historical connection with the subject or with related matters, or
1805     of legal, commercial, philosophical, ethical or political position
1806     regarding them.
1807
1808     The "Invariant Sections" are certain Secondary Sections whose
1809     titles are designated, as being those of Invariant Sections, in
1810     the notice that says that the Document is released under this
1811     License.  If a section does not fit the above definition of
1812     Secondary then it is not allowed to be designated as Invariant.
1813     The Document may contain zero Invariant Sections.  If the Document
1814     does not identify any Invariant Sections then there are none.
1815
1816     The "Cover Texts" are certain short passages of text that are
1817     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
1818     that says that the Document is released under this License.  A
1819     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
1820     be at most 25 words.
1821
1822     A "Transparent" copy of the Document means a machine-readable copy,
1823     represented in a format whose specification is available to the
1824     general public, that is suitable for revising the document
1825     straightforwardly with generic text editors or (for images
1826     composed of pixels) generic paint programs or (for drawings) some
1827     widely available drawing editor, and that is suitable for input to
1828     text formatters or for automatic translation to a variety of
1829     formats suitable for input to text formatters.  A copy made in an
1830     otherwise Transparent file format whose markup, or absence of
1831     markup, has been arranged to thwart or discourage subsequent
1832     modification by readers is not Transparent.  An image format is
1833     not Transparent if used for any substantial amount of text.  A
1834     copy that is not "Transparent" is called "Opaque".
1835
1836     Examples of suitable formats for Transparent copies include plain
1837     ASCII without markup, Texinfo input format, LaTeX input format,
1838     SGML or XML using a publicly available DTD, and
1839     standard-conforming simple HTML, PostScript or PDF designed for
1840     human modification.  Examples of transparent image formats include
1841     PNG, XCF and JPG.  Opaque formats include proprietary formats that
1842     can be read and edited only by proprietary word processors, SGML or
1843     XML for which the DTD and/or processing tools are not generally
1844     available, and the machine-generated HTML, PostScript or PDF
1845     produced by some word processors for output purposes only.
1846
1847     The "Title Page" means, for a printed book, the title page itself,
1848     plus such following pages as are needed to hold, legibly, the
1849     material this License requires to appear in the title page.  For
1850     works in formats which do not have any title page as such, "Title
1851     Page" means the text near the most prominent appearance of the
1852     work's title, preceding the beginning of the body of the text.
1853
1854     The "publisher" means any person or entity that distributes copies
1855     of the Document to the public.
1856
1857     A section "Entitled XYZ" means a named subunit of the Document
1858     whose title either is precisely XYZ or contains XYZ in parentheses
1859     following text that translates XYZ in another language.  (Here XYZ
1860     stands for a specific section name mentioned below, such as
1861     "Acknowledgements", "Dedications", "Endorsements", or "History".)
1862     To "Preserve the Title" of such a section when you modify the
1863     Document means that it remains a section "Entitled XYZ" according
1864     to this definition.
1865
1866     The Document may include Warranty Disclaimers next to the notice
1867     which states that this License applies to the Document.  These
1868     Warranty Disclaimers are considered to be included by reference in
1869     this License, but only as regards disclaiming warranties: any other
1870     implication that these Warranty Disclaimers may have is void and
1871     has no effect on the meaning of this License.
1872
1873  2. VERBATIM COPYING
1874
1875     You may copy and distribute the Document in any medium, either
1876     commercially or noncommercially, provided that this License, the
1877     copyright notices, and the license notice saying this License
1878     applies to the Document are reproduced in all copies, and that you
1879     add no other conditions whatsoever to those of this License.  You
1880     may not use technical measures to obstruct or control the reading
1881     or further copying of the copies you make or distribute.  However,
1882     you may accept compensation in exchange for copies.  If you
1883     distribute a large enough number of copies you must also follow
1884     the conditions in section 3.
1885
1886     You may also lend copies, under the same conditions stated above,
1887     and you may publicly display copies.
1888
1889  3. COPYING IN QUANTITY
1890
1891     If you publish printed copies (or copies in media that commonly
1892     have printed covers) of the Document, numbering more than 100, and
1893     the Document's license notice requires Cover Texts, you must
1894     enclose the copies in covers that carry, clearly and legibly, all
1895     these Cover Texts: Front-Cover Texts on the front cover, and
1896     Back-Cover Texts on the back cover.  Both covers must also clearly
1897     and legibly identify you as the publisher of these copies.  The
1898     front cover must present the full title with all words of the
1899     title equally prominent and visible.  You may add other material
1900     on the covers in addition.  Copying with changes limited to the
1901     covers, as long as they preserve the title of the Document and
1902     satisfy these conditions, can be treated as verbatim copying in
1903     other respects.
1904
1905     If the required texts for either cover are too voluminous to fit
1906     legibly, you should put the first ones listed (as many as fit
1907     reasonably) on the actual cover, and continue the rest onto
1908     adjacent pages.
1909
1910     If you publish or distribute Opaque copies of the Document
1911     numbering more than 100, you must either include a
1912     machine-readable Transparent copy along with each Opaque copy, or
1913     state in or with each Opaque copy a computer-network location from
1914     which the general network-using public has access to download
1915     using public-standard network protocols a complete Transparent
1916     copy of the Document, free of added material.  If you use the
1917     latter option, you must take reasonably prudent steps, when you
1918     begin distribution of Opaque copies in quantity, to ensure that
1919     this Transparent copy will remain thus accessible at the stated
1920     location until at least one year after the last time you
1921     distribute an Opaque copy (directly or through your agents or
1922     retailers) of that edition to the public.
1923
1924     It is requested, but not required, that you contact the authors of
1925     the Document well before redistributing any large number of
1926     copies, to give them a chance to provide you with an updated
1927     version of the Document.
1928
1929  4. MODIFICATIONS
1930
1931     You may copy and distribute a Modified Version of the Document
1932     under the conditions of sections 2 and 3 above, provided that you
1933     release the Modified Version under precisely this License, with
1934     the Modified Version filling the role of the Document, thus
1935     licensing distribution and modification of the Modified Version to
1936     whoever possesses a copy of it.  In addition, you must do these
1937     things in the Modified Version:
1938
1939       A. Use in the Title Page (and on the covers, if any) a title
1940          distinct from that of the Document, and from those of
1941          previous versions (which should, if there were any, be listed
1942          in the History section of the Document).  You may use the
1943          same title as a previous version if the original publisher of
1944          that version gives permission.
1945
1946       B. List on the Title Page, as authors, one or more persons or
1947          entities responsible for authorship of the modifications in
1948          the Modified Version, together with at least five of the
1949          principal authors of the Document (all of its principal
1950          authors, if it has fewer than five), unless they release you
1951          from this requirement.
1952
1953       C. State on the Title page the name of the publisher of the
1954          Modified Version, as the publisher.
1955
1956       D. Preserve all the copyright notices of the Document.
1957
1958       E. Add an appropriate copyright notice for your modifications
1959          adjacent to the other copyright notices.
1960
1961       F. Include, immediately after the copyright notices, a license
1962          notice giving the public permission to use the Modified
1963          Version under the terms of this License, in the form shown in
1964          the Addendum below.
1965
1966       G. Preserve in that license notice the full lists of Invariant
1967          Sections and required Cover Texts given in the Document's
1968          license notice.
1969
1970       H. Include an unaltered copy of this License.
1971
1972       I. Preserve the section Entitled "History", Preserve its Title,
1973          and add to it an item stating at least the title, year, new
1974          authors, and publisher of the Modified Version as given on
1975          the Title Page.  If there is no section Entitled "History" in
1976          the Document, create one stating the title, year, authors,
1977          and publisher of the Document as given on its Title Page,
1978          then add an item describing the Modified Version as stated in
1979          the previous sentence.
1980
1981       J. Preserve the network location, if any, given in the Document
1982          for public access to a Transparent copy of the Document, and
1983          likewise the network locations given in the Document for
1984          previous versions it was based on.  These may be placed in
1985          the "History" section.  You may omit a network location for a
1986          work that was published at least four years before the
1987          Document itself, or if the original publisher of the version
1988          it refers to gives permission.
1989
1990       K. For any section Entitled "Acknowledgements" or "Dedications",
1991          Preserve the Title of the section, and preserve in the
1992          section all the substance and tone of each of the contributor
1993          acknowledgements and/or dedications given therein.
1994
1995       L. Preserve all the Invariant Sections of the Document,
1996          unaltered in their text and in their titles.  Section numbers
1997          or the equivalent are not considered part of the section
1998          titles.
1999
2000       M. Delete any section Entitled "Endorsements".  Such a section
2001          may not be included in the Modified Version.
2002
2003       N. Do not retitle any existing section to be Entitled
2004          "Endorsements" or to conflict in title with any Invariant
2005          Section.
2006
2007       O. Preserve any Warranty Disclaimers.
2008
2009     If the Modified Version includes new front-matter sections or
2010     appendices that qualify as Secondary Sections and contain no
2011     material copied from the Document, you may at your option
2012     designate some or all of these sections as invariant.  To do this,
2013     add their titles to the list of Invariant Sections in the Modified
2014     Version's license notice.  These titles must be distinct from any
2015     other section titles.
2016
2017     You may add a section Entitled "Endorsements", provided it contains
2018     nothing but endorsements of your Modified Version by various
2019     parties--for example, statements of peer review or that the text
2020     has been approved by an organization as the authoritative
2021     definition of a standard.
2022
2023     You may add a passage of up to five words as a Front-Cover Text,
2024     and a passage of up to 25 words as a Back-Cover Text, to the end
2025     of the list of Cover Texts in the Modified Version.  Only one
2026     passage of Front-Cover Text and one of Back-Cover Text may be
2027     added by (or through arrangements made by) any one entity.  If the
2028     Document already includes a cover text for the same cover,
2029     previously added by you or by arrangement made by the same entity
2030     you are acting on behalf of, you may not add another; but you may
2031     replace the old one, on explicit permission from the previous
2032     publisher that added the old one.
2033
2034     The author(s) and publisher(s) of the Document do not by this
2035     License give permission to use their names for publicity for or to
2036     assert or imply endorsement of any Modified Version.
2037
2038  5. COMBINING DOCUMENTS
2039
2040     You may combine the Document with other documents released under
2041     this License, under the terms defined in section 4 above for
2042     modified versions, provided that you include in the combination
2043     all of the Invariant Sections of all of the original documents,
2044     unmodified, and list them all as Invariant Sections of your
2045     combined work in its license notice, and that you preserve all
2046     their Warranty Disclaimers.
2047
2048     The combined work need only contain one copy of this License, and
2049     multiple identical Invariant Sections may be replaced with a single
2050     copy.  If there are multiple Invariant Sections with the same name
2051     but different contents, make the title of each such section unique
2052     by adding at the end of it, in parentheses, the name of the
2053     original author or publisher of that section if known, or else a
2054     unique number.  Make the same adjustment to the section titles in
2055     the list of Invariant Sections in the license notice of the
2056     combined work.
2057
2058     In the combination, you must combine any sections Entitled
2059     "History" in the various original documents, forming one section
2060     Entitled "History"; likewise combine any sections Entitled
2061     "Acknowledgements", and any sections Entitled "Dedications".  You
2062     must delete all sections Entitled "Endorsements."
2063
2064  6. COLLECTIONS OF DOCUMENTS
2065
2066     You may make a collection consisting of the Document and other
2067     documents released under this License, and replace the individual
2068     copies of this License in the various documents with a single copy
2069     that is included in the collection, provided that you follow the
2070     rules of this License for verbatim copying of each of the
2071     documents in all other respects.
2072
2073     You may extract a single document from such a collection, and
2074     distribute it individually under this License, provided you insert
2075     a copy of this License into the extracted document, and follow
2076     this License in all other respects regarding verbatim copying of
2077     that document.
2078
2079  7. AGGREGATION WITH INDEPENDENT WORKS
2080
2081     A compilation of the Document or its derivatives with other
2082     separate and independent documents or works, in or on a volume of
2083     a storage or distribution medium, is called an "aggregate" if the
2084     copyright resulting from the compilation is not used to limit the
2085     legal rights of the compilation's users beyond what the individual
2086     works permit.  When the Document is included in an aggregate, this
2087     License does not apply to the other works in the aggregate which
2088     are not themselves derivative works of the Document.
2089
2090     If the Cover Text requirement of section 3 is applicable to these
2091     copies of the Document, then if the Document is less than one half
2092     of the entire aggregate, the Document's Cover Texts may be placed
2093     on covers that bracket the Document within the aggregate, or the
2094     electronic equivalent of covers if the Document is in electronic
2095     form.  Otherwise they must appear on printed covers that bracket
2096     the whole aggregate.
2097
2098  8. TRANSLATION
2099
2100     Translation is considered a kind of modification, so you may
2101     distribute translations of the Document under the terms of section
2102     4.  Replacing Invariant Sections with translations requires special
2103     permission from their copyright holders, but you may include
2104     translations of some or all Invariant Sections in addition to the
2105     original versions of these Invariant Sections.  You may include a
2106     translation of this License, and all the license notices in the
2107     Document, and any Warranty Disclaimers, provided that you also
2108     include the original English version of this License and the
2109     original versions of those notices and disclaimers.  In case of a
2110     disagreement between the translation and the original version of
2111     this License or a notice or disclaimer, the original version will
2112     prevail.
2113
2114     If a section in the Document is Entitled "Acknowledgements",
2115     "Dedications", or "History", the requirement (section 4) to
2116     Preserve its Title (section 1) will typically require changing the
2117     actual title.
2118
2119  9. TERMINATION
2120
2121     You may not copy, modify, sublicense, or distribute the Document
2122     except as expressly provided under this License.  Any attempt
2123     otherwise to copy, modify, sublicense, or distribute it is void,
2124     and will automatically terminate your rights under this License.
2125
2126     However, if you cease all violation of this License, then your
2127     license from a particular copyright holder is reinstated (a)
2128     provisionally, unless and until the copyright holder explicitly
2129     and finally terminates your license, and (b) permanently, if the
2130     copyright holder fails to notify you of the violation by some
2131     reasonable means prior to 60 days after the cessation.
2132
2133     Moreover, your license from a particular copyright holder is
2134     reinstated permanently if the copyright holder notifies you of the
2135     violation by some reasonable means, this is the first time you have
2136     received notice of violation of this License (for any work) from
2137     that copyright holder, and you cure the violation prior to 30 days
2138     after your receipt of the notice.
2139
2140     Termination of your rights under this section does not terminate
2141     the licenses of parties who have received copies or rights from
2142     you under this License.  If your rights have been terminated and
2143     not permanently reinstated, receipt of a copy of some or all of
2144     the same material does not give you any rights to use it.
2145
2146 10. FUTURE REVISIONS OF THIS LICENSE
2147
2148     The Free Software Foundation may publish new, revised versions of
2149     the GNU Free Documentation License from time to time.  Such new
2150     versions will be similar in spirit to the present version, but may
2151     differ in detail to address new problems or concerns.  See
2152     `http://www.gnu.org/copyleft/'.
2153
2154     Each version of the License is given a distinguishing version
2155     number.  If the Document specifies that a particular numbered
2156     version of this License "or any later version" applies to it, you
2157     have the option of following the terms and conditions either of
2158     that specified version or of any later version that has been
2159     published (not as a draft) by the Free Software Foundation.  If
2160     the Document does not specify a version number of this License,
2161     you may choose any version ever published (not as a draft) by the
2162     Free Software Foundation.  If the Document specifies that a proxy
2163     can decide which future versions of this License can be used, that
2164     proxy's public statement of acceptance of a version permanently
2165     authorizes you to choose that version for the Document.
2166
2167 11. RELICENSING
2168
2169     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
2170     World Wide Web server that publishes copyrightable works and also
2171     provides prominent facilities for anybody to edit those works.  A
2172     public wiki that anybody can edit is an example of such a server.
2173     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
2174     site means any set of copyrightable works thus published on the MMC
2175     site.
2176
2177     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
2178     license published by Creative Commons Corporation, a not-for-profit
2179     corporation with a principal place of business in San Francisco,
2180     California, as well as future copyleft versions of that license
2181     published by that same organization.
2182
2183     "Incorporate" means to publish or republish a Document, in whole or
2184     in part, as part of another Document.
2185
2186     An MMC is "eligible for relicensing" if it is licensed under this
2187     License, and if all works that were first published under this
2188     License somewhere other than this MMC, and subsequently
2189     incorporated in whole or in part into the MMC, (1) had no cover
2190     texts or invariant sections, and (2) were thus incorporated prior
2191     to November 1, 2008.
2192
2193     The operator of an MMC Site may republish an MMC contained in the
2194     site under CC-BY-SA on the same site at any time before August 1,
2195     2009, provided the MMC is eligible for relicensing.
2196
2197
2198ADDENDUM: How to use this License for your documents
2199====================================================
2200
2201To use this License in a document you have written, include a copy of
2202the License in the document and put the following copyright and license
2203notices just after the title page:
2204
2205       Copyright (C)  YEAR  YOUR NAME.
2206       Permission is granted to copy, distribute and/or modify this document
2207       under the terms of the GNU Free Documentation License, Version 1.3
2208       or any later version published by the Free Software Foundation;
2209       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
2210       Texts.  A copy of the license is included in the section entitled ``GNU
2211       Free Documentation License''.
2212
2213   If you have Invariant Sections, Front-Cover Texts and Back-Cover
2214Texts, replace the "with...Texts." line with this:
2215
2216         with the Invariant Sections being LIST THEIR TITLES, with
2217         the Front-Cover Texts being LIST, and with the Back-Cover Texts
2218         being LIST.
2219
2220   If you have Invariant Sections without Cover Texts, or some other
2221combination of the three, merge those two alternatives to suit the
2222situation.
2223
2224   If your document contains nontrivial examples of program code, we
2225recommend releasing these examples in parallel under your choice of
2226free software license, such as the GNU General Public License, to
2227permit their use in free software.
2228
2229
2230File: gmp.info,  Node: Concept Index,  Next: Function Index,  Prev: GNU Free Documentation License,  Up: Top
2231
2232Concept Index
2233*************
2234
2235�[index�]
2236* Menu:
2237
2238* #include:                              Headers and Libraries.
2239                                                              (line   6)
2240* --build:                               Build Options.       (line  52)
2241* --disable-fft:                         Build Options.       (line 317)
2242* --disable-shared:                      Build Options.       (line  45)
2243* --disable-static:                      Build Options.       (line  45)
2244* --enable-alloca:                       Build Options.       (line 278)
2245* --enable-assert:                       Build Options.       (line 328)
2246* --enable-cxx:                          Build Options.       (line 230)
2247* --enable-fat:                          Build Options.       (line 164)
2248* --enable-mpbsd:                        Build Options.       (line 323)
2249* --enable-profiling <1>:                Profiling.           (line   6)
2250* --enable-profiling:                    Build Options.       (line 332)
2251* --exec-prefix:                         Build Options.       (line  32)
2252* --host:                                Build Options.       (line  66)
2253* --prefix:                              Build Options.       (line  32)
2254* -finstrument-functions:                Profiling.           (line  66)
2255* 2exp functions:                        Efficiency.          (line  43)
2256* 68000:                                 Notes for Particular Systems.
2257                                                              (line  80)
2258* 80x86:                                 Notes for Particular Systems.
2259                                                              (line 126)
2260* ABI <1>:                               Build Options.       (line 171)
2261* ABI:                                   ABI and ISA.         (line   6)
2262* About this manual:                     Introduction to GMP. (line  58)
2263* AC_CHECK_LIB:                          Autoconf.            (line  11)
2264* AIX <1>:                               ABI and ISA.         (line 169)
2265* AIX:                                   Notes for Particular Systems.
2266                                                              (line   7)
2267* Algorithms:                            Algorithms.          (line   6)
2268* alloca:                                Build Options.       (line 278)
2269* Allocation of memory:                  Custom Allocation.   (line   6)
2270* AMD64:                                 ABI and ISA.         (line  44)
2271* Anonymous FTP of latest version:       Introduction to GMP. (line  38)
2272* Application Binary Interface:          ABI and ISA.         (line   6)
2273* Arithmetic functions <1>:              Float Arithmetic.    (line   6)
2274* Arithmetic functions <2>:              Integer Arithmetic.  (line   6)
2275* Arithmetic functions:                  Rational Arithmetic. (line   6)
2276* ARM:                                   Notes for Particular Systems.
2277                                                              (line  20)
2278* Assembly cache handling:               Assembly Cache Handling.
2279                                                              (line   6)
2280* Assembly carry propagation:            Assembly Carry Propagation.
2281                                                              (line   6)
2282* Assembly code organisation:            Assembly Code Organisation.
2283                                                              (line   6)
2284* Assembly coding:                       Assembly Coding.     (line   6)
2285* Assembly floating Point:               Assembly Floating Point.
2286                                                              (line   6)
2287* Assembly loop unrolling:               Assembly Loop Unrolling.
2288                                                              (line   6)
2289* Assembly SIMD:                         Assembly SIMD Instructions.
2290                                                              (line   6)
2291* Assembly software pipelining:          Assembly Software Pipelining.
2292                                                              (line   6)
2293* Assembly writing guide:                Assembly Writing Guide.
2294                                                              (line   6)
2295* Assertion checking <1>:                Debugging.           (line  79)
2296* Assertion checking:                    Build Options.       (line 328)
2297* Assignment functions <1>:              Assigning Integers.  (line   6)
2298* Assignment functions <2>:              Simultaneous Float Init & Assign.
2299                                                              (line   6)
2300* Assignment functions <3>:              Assigning Floats.    (line   6)
2301* Assignment functions <4>:              Initializing Rationals.
2302                                                              (line   6)
2303* Assignment functions:                  Simultaneous Integer Init & Assign.
2304                                                              (line   6)
2305* Autoconf:                              Autoconf.            (line   6)
2306* Basics:                                GMP Basics.          (line   6)
2307* Berkeley MP compatible functions <1>:  Build Options.       (line 323)
2308* Berkeley MP compatible functions:      BSD Compatible Functions.
2309                                                              (line   6)
2310* Binomial coefficient algorithm:        Binomial Coefficients Algorithm.
2311                                                              (line   6)
2312* Binomial coefficient functions:        Number Theoretic Functions.
2313                                                              (line 113)
2314* Binutils strip:                        Known Build Problems.
2315                                                              (line  28)
2316* Bit manipulation functions:            Integer Logic and Bit Fiddling.
2317                                                              (line   6)
2318* Bit scanning functions:                Integer Logic and Bit Fiddling.
2319                                                              (line  38)
2320* Bit shift left:                        Integer Arithmetic.  (line  35)
2321* Bit shift right:                       Integer Division.    (line  53)
2322* Bits per limb:                         Useful Macros and Constants.
2323                                                              (line   7)
2324* BSD MP compatible functions <1>:       BSD Compatible Functions.
2325                                                              (line   6)
2326* BSD MP compatible functions:           Build Options.       (line 323)
2327* Bug reporting:                         Reporting Bugs.      (line   6)
2328* Build directory:                       Build Options.       (line  19)
2329* Build notes for binary packaging:      Notes for Package Builds.
2330                                                              (line   6)
2331* Build notes for particular systems:    Notes for Particular Systems.
2332                                                              (line   6)
2333* Build options:                         Build Options.       (line   6)
2334* Build problems known:                  Known Build Problems.
2335                                                              (line   6)
2336* Build system:                          Build Options.       (line  52)
2337* Building GMP:                          Installing GMP.      (line   6)
2338* Bus error:                             Debugging.           (line   7)
2339* C compiler:                            Build Options.       (line 182)
2340* C++ compiler:                          Build Options.       (line 254)
2341* C++ interface:                         C++ Class Interface. (line   6)
2342* C++ interface internals:               C++ Interface Internals.
2343                                                              (line   6)
2344* C++ istream input:                     C++ Formatted Input. (line   6)
2345* C++ ostream output:                    C++ Formatted Output.
2346                                                              (line   6)
2347* C++ support:                           Build Options.       (line 230)
2348* CC:                                    Build Options.       (line 182)
2349* CC_FOR_BUILD:                          Build Options.       (line 217)
2350* CFLAGS:                                Build Options.       (line 182)
2351* Checker:                               Debugging.           (line 115)
2352* checkergcc:                            Debugging.           (line 122)
2353* Code organisation:                     Assembly Code Organisation.
2354                                                              (line   6)
2355* Compaq C++:                            Notes for Particular Systems.
2356                                                              (line  25)
2357* Comparison functions <1>:              Float Comparison.    (line   6)
2358* Comparison functions <2>:              Integer Comparisons. (line   6)
2359* Comparison functions:                  Comparing Rationals. (line   6)
2360* Compatibility with older versions:     Compatibility with older versions.
2361                                                              (line   6)
2362* Conditions for copying GNU MP:         Copying.             (line   6)
2363* Configuring GMP:                       Installing GMP.      (line   6)
2364* Congruence algorithm:                  Exact Remainder.     (line  29)
2365* Congruence functions:                  Integer Division.    (line 124)
2366* Constants:                             Useful Macros and Constants.
2367                                                              (line   6)
2368* Contributors:                          Contributors.        (line   6)
2369* Conventions for parameters:            Parameter Conventions.
2370                                                              (line   6)
2371* Conventions for variables:             Variable Conventions.
2372                                                              (line   6)
2373* Conversion functions <1>:              Rational Conversions.
2374                                                              (line   6)
2375* Conversion functions <2>:              Converting Integers. (line   6)
2376* Conversion functions:                  Converting Floats.   (line   6)
2377* Copying conditions:                    Copying.             (line   6)
2378* CPPFLAGS:                              Build Options.       (line 208)
2379* CPU types <1>:                         Introduction to GMP. (line  24)
2380* CPU types:                             Build Options.       (line 108)
2381* Cross compiling:                       Build Options.       (line  66)
2382* Custom allocation:                     Custom Allocation.   (line   6)
2383* CXX:                                   Build Options.       (line 254)
2384* CXXFLAGS:                              Build Options.       (line 254)
2385* Cygwin:                                Notes for Particular Systems.
2386                                                              (line  43)
2387* Darwin:                                Known Build Problems.
2388                                                              (line  51)
2389* Debugging:                             Debugging.           (line   6)
2390* Demonstration programs:                Demonstration Programs.
2391                                                              (line   6)
2392* Digits in an integer:                  Miscellaneous Integer Functions.
2393                                                              (line  23)
2394* Divisibility algorithm:                Exact Remainder.     (line  29)
2395* Divisibility functions:                Integer Division.    (line 112)
2396* Divisibility testing:                  Efficiency.          (line  91)
2397* Division algorithms:                   Division Algorithms. (line   6)
2398* Division functions <1>:                Float Arithmetic.    (line  33)
2399* Division functions <2>:                Rational Arithmetic. (line  22)
2400* Division functions:                    Integer Division.    (line   6)
2401* DJGPP <1>:                             Notes for Particular Systems.
2402                                                              (line  43)
2403* DJGPP:                                 Known Build Problems.
2404                                                              (line  18)
2405* DLLs:                                  Notes for Particular Systems.
2406                                                              (line  56)
2407* DocBook:                               Build Options.       (line 355)
2408* Documentation formats:                 Build Options.       (line 348)
2409* Documentation license:                 GNU Free Documentation License.
2410                                                              (line   6)
2411* DVI:                                   Build Options.       (line 351)
2412* Efficiency:                            Efficiency.          (line   6)
2413* Emacs:                                 Emacs.               (line   6)
2414* Exact division functions:              Integer Division.    (line 102)
2415* Exact remainder:                       Exact Remainder.     (line   6)
2416* Example programs:                      Demonstration Programs.
2417                                                              (line   6)
2418* Exec prefix:                           Build Options.       (line  32)
2419* Execution profiling <1>:               Profiling.           (line   6)
2420* Execution profiling:                   Build Options.       (line 332)
2421* Exponentiation functions <1>:          Integer Exponentiation.
2422                                                              (line   6)
2423* Exponentiation functions:              Float Arithmetic.    (line  41)
2424* Export:                                Integer Import and Export.
2425                                                              (line  45)
2426* Expression parsing demo:               Demonstration Programs.
2427                                                              (line  15)
2428* Extended GCD:                          Number Theoretic Functions.
2429                                                              (line  47)
2430* Factor removal functions:              Number Theoretic Functions.
2431                                                              (line 103)
2432* Factorial algorithm:                   Factorial Algorithm. (line   6)
2433* Factorial functions:                   Number Theoretic Functions.
2434                                                              (line 108)
2435* Factorization demo:                    Demonstration Programs.
2436                                                              (line  25)
2437* Fast Fourier Transform:                FFT Multiplication.  (line   6)
2438* Fat binary:                            Build Options.       (line 164)
2439* FFT multiplication <1>:                Build Options.       (line 317)
2440* FFT multiplication:                    FFT Multiplication.  (line   6)
2441* Fibonacci number algorithm:            Fibonacci Numbers Algorithm.
2442                                                              (line   6)
2443* Fibonacci sequence functions:          Number Theoretic Functions.
2444                                                              (line 121)
2445* Float arithmetic functions:            Float Arithmetic.    (line   6)
2446* Float assignment functions <1>:        Simultaneous Float Init & Assign.
2447                                                              (line   6)
2448* Float assignment functions:            Assigning Floats.    (line   6)
2449* Float comparison functions:            Float Comparison.    (line   6)
2450* Float conversion functions:            Converting Floats.   (line   6)
2451* Float functions:                       Floating-point Functions.
2452                                                              (line   6)
2453* Float initialization functions <1>:    Simultaneous Float Init & Assign.
2454                                                              (line   6)
2455* Float initialization functions:        Initializing Floats. (line   6)
2456* Float input and output functions:      I/O of Floats.       (line   6)
2457* Float internals:                       Float Internals.     (line   6)
2458* Float miscellaneous functions:         Miscellaneous Float Functions.
2459                                                              (line   6)
2460* Float random number functions:         Miscellaneous Float Functions.
2461                                                              (line  27)
2462* Float rounding functions:              Miscellaneous Float Functions.
2463                                                              (line   9)
2464* Float sign tests:                      Float Comparison.    (line  33)
2465* Floating point mode:                   Notes for Particular Systems.
2466                                                              (line  34)
2467* Floating-point functions:              Floating-point Functions.
2468                                                              (line   6)
2469* Floating-point number:                 Nomenclature and Types.
2470                                                              (line  21)
2471* fnccheck:                              Profiling.           (line  77)
2472* Formatted input:                       Formatted Input.     (line   6)
2473* Formatted output:                      Formatted Output.    (line   6)
2474* Free Documentation License:            GNU Free Documentation License.
2475                                                              (line   6)
2476* frexp <1>:                             Converting Floats.   (line  23)
2477* frexp:                                 Converting Integers. (line  42)
2478* FTP of latest version:                 Introduction to GMP. (line  38)
2479* Function classes:                      Function Classes.    (line   6)
2480* FunctionCheck:                         Profiling.           (line  77)
2481* GCC Checker:                           Debugging.           (line 115)
2482* GCD algorithms:                        Greatest Common Divisor Algorithms.
2483                                                              (line   6)
2484* GCD extended:                          Number Theoretic Functions.
2485                                                              (line  47)
2486* GCD functions:                         Number Theoretic Functions.
2487                                                              (line  30)
2488* GDB:                                   Debugging.           (line  58)
2489* Generic C:                             Build Options.       (line 153)
2490* GMP Perl module:                       Demonstration Programs.
2491                                                              (line  35)
2492* GMP version number:                    Useful Macros and Constants.
2493                                                              (line  12)
2494* gmp.h:                                 Headers and Libraries.
2495                                                              (line   6)
2496* gmpxx.h:                               C++ Interface General.
2497                                                              (line   8)
2498* GNU Debugger:                          Debugging.           (line  58)
2499* GNU Free Documentation License:        GNU Free Documentation License.
2500                                                              (line   6)
2501* GNU strip:                             Known Build Problems.
2502                                                              (line  28)
2503* gprof:                                 Profiling.           (line  41)
2504* Greatest common divisor algorithms:    Greatest Common Divisor Algorithms.
2505                                                              (line   6)
2506* Greatest common divisor functions:     Number Theoretic Functions.
2507                                                              (line  30)
2508* Hardware floating point mode:          Notes for Particular Systems.
2509                                                              (line  34)
2510* Headers:                               Headers and Libraries.
2511                                                              (line   6)
2512* Heap problems:                         Debugging.           (line  24)
2513* Home page:                             Introduction to GMP. (line  34)
2514* Host system:                           Build Options.       (line  66)
2515* HP-UX:                                 ABI and ISA.         (line 107)
2516* HPPA:                                  ABI and ISA.         (line  68)
2517* I/O functions <1>:                     I/O of Floats.       (line   6)
2518* I/O functions <2>:                     I/O of Integers.     (line   6)
2519* I/O functions:                         I/O of Rationals.    (line   6)
2520* i386:                                  Notes for Particular Systems.
2521                                                              (line 126)
2522* IA-64:                                 ABI and ISA.         (line 107)
2523* Import:                                Integer Import and Export.
2524                                                              (line  11)
2525* In-place operations:                   Efficiency.          (line  57)
2526* Include files:                         Headers and Libraries.
2527                                                              (line   6)
2528* info-lookup-symbol:                    Emacs.               (line   6)
2529* Initialization functions <1>:          Initializing Integers.
2530                                                              (line   6)
2531* Initialization functions <2>:          Random State Initialization.
2532                                                              (line   6)
2533* Initialization functions <3>:          Initializing Rationals.
2534                                                              (line   6)
2535* Initialization functions <4>:          Initializing Floats. (line   6)
2536* Initialization functions <5>:          Simultaneous Float Init & Assign.
2537                                                              (line   6)
2538* Initialization functions:              Simultaneous Integer Init & Assign.
2539                                                              (line   6)
2540* Initializing and clearing:             Efficiency.          (line  21)
2541* Input functions <1>:                   I/O of Floats.       (line   6)
2542* Input functions <2>:                   I/O of Rationals.    (line   6)
2543* Input functions <3>:                   I/O of Integers.     (line   6)
2544* Input functions:                       Formatted Input Functions.
2545                                                              (line   6)
2546* Install prefix:                        Build Options.       (line  32)
2547* Installing GMP:                        Installing GMP.      (line   6)
2548* Instruction Set Architecture:          ABI and ISA.         (line   6)
2549* instrument-functions:                  Profiling.           (line  66)
2550* Integer:                               Nomenclature and Types.
2551                                                              (line   6)
2552* Integer arithmetic functions:          Integer Arithmetic.  (line   6)
2553* Integer assignment functions <1>:      Assigning Integers.  (line   6)
2554* Integer assignment functions:          Simultaneous Integer Init & Assign.
2555                                                              (line   6)
2556* Integer bit manipulation functions:    Integer Logic and Bit Fiddling.
2557                                                              (line   6)
2558* Integer comparison functions:          Integer Comparisons. (line   6)
2559* Integer conversion functions:          Converting Integers. (line   6)
2560* Integer division functions:            Integer Division.    (line   6)
2561* Integer exponentiation functions:      Integer Exponentiation.
2562                                                              (line   6)
2563* Integer export:                        Integer Import and Export.
2564                                                              (line  45)
2565* Integer functions:                     Integer Functions.   (line   6)
2566* Integer import:                        Integer Import and Export.
2567                                                              (line  11)
2568* Integer initialization functions <1>:  Initializing Integers.
2569                                                              (line   6)
2570* Integer initialization functions:      Simultaneous Integer Init & Assign.
2571                                                              (line   6)
2572* Integer input and output functions:    I/O of Integers.     (line   6)
2573* Integer internals:                     Integer Internals.   (line   6)
2574* Integer logical functions:             Integer Logic and Bit Fiddling.
2575                                                              (line   6)
2576* Integer miscellaneous functions:       Miscellaneous Integer Functions.
2577                                                              (line   6)
2578* Integer random number functions:       Integer Random Numbers.
2579                                                              (line   6)
2580* Integer root functions:                Integer Roots.       (line   6)
2581* Integer sign tests:                    Integer Comparisons. (line  28)
2582* Integer special functions:             Integer Special Functions.
2583                                                              (line   6)
2584* Interix:                               Notes for Particular Systems.
2585                                                              (line  51)
2586* Internals:                             Internals.           (line   6)
2587* Introduction:                          Introduction to GMP. (line   6)
2588* Inverse modulo functions:              Number Theoretic Functions.
2589                                                              (line  72)
2590* IRIX <1>:                              Known Build Problems.
2591                                                              (line  38)
2592* IRIX:                                  ABI and ISA.         (line 132)
2593* ISA:                                   ABI and ISA.         (line   6)
2594* istream input:                         C++ Formatted Input. (line   6)
2595* Jacobi symbol algorithm:               Jacobi Symbol.       (line   6)
2596* Jacobi symbol functions:               Number Theoretic Functions.
2597                                                              (line  79)
2598* Karatsuba multiplication:              Karatsuba Multiplication.
2599                                                              (line   6)
2600* Karatsuba square root algorithm:       Square Root Algorithm.
2601                                                              (line   6)
2602* Kronecker symbol functions:            Number Theoretic Functions.
2603                                                              (line  91)
2604* Language bindings:                     Language Bindings.   (line   6)
2605* Latest version of GMP:                 Introduction to GMP. (line  38)
2606* LCM functions:                         Number Theoretic Functions.
2607                                                              (line  67)
2608* Least common multiple functions:       Number Theoretic Functions.
2609                                                              (line  67)
2610* Legendre symbol functions:             Number Theoretic Functions.
2611                                                              (line  82)
2612* libgmp:                                Headers and Libraries.
2613                                                              (line  22)
2614* libgmpxx:                              Headers and Libraries.
2615                                                              (line  27)
2616* Libraries:                             Headers and Libraries.
2617                                                              (line  22)
2618* Libtool:                               Headers and Libraries.
2619                                                              (line  33)
2620* Libtool versioning:                    Notes for Package Builds.
2621                                                              (line   9)
2622* License conditions:                    Copying.             (line   6)
2623* Limb:                                  Nomenclature and Types.
2624                                                              (line  31)
2625* Limb size:                             Useful Macros and Constants.
2626                                                              (line   7)
2627* Linear congruential algorithm:         Random Number Algorithms.
2628                                                              (line  25)
2629* Linear congruential random numbers:    Random State Initialization.
2630                                                              (line  18)
2631* Linking:                               Headers and Libraries.
2632                                                              (line  22)
2633* Logical functions:                     Integer Logic and Bit Fiddling.
2634                                                              (line   6)
2635* Low-level functions:                   Low-level Functions. (line   6)
2636* Lucas number algorithm:                Lucas Numbers Algorithm.
2637                                                              (line   6)
2638* Lucas number functions:                Number Theoretic Functions.
2639                                                              (line 132)
2640* MacOS X:                               Known Build Problems.
2641                                                              (line  51)
2642* Mailing lists:                         Introduction to GMP. (line  45)
2643* Malloc debugger:                       Debugging.           (line  30)
2644* Malloc problems:                       Debugging.           (line  24)
2645* Memory allocation:                     Custom Allocation.   (line   6)
2646* Memory management:                     Memory Management.   (line   6)
2647* Mersenne twister algorithm:            Random Number Algorithms.
2648                                                              (line  17)
2649* Mersenne twister random numbers:       Random State Initialization.
2650                                                              (line  13)
2651* MINGW:                                 Notes for Particular Systems.
2652                                                              (line  43)
2653* MIPS:                                  ABI and ISA.         (line 132)
2654* Miscellaneous float functions:         Miscellaneous Float Functions.
2655                                                              (line   6)
2656* Miscellaneous integer functions:       Miscellaneous Integer Functions.
2657                                                              (line   6)
2658* MMX:                                   Notes for Particular Systems.
2659                                                              (line 132)
2660* Modular inverse functions:             Number Theoretic Functions.
2661                                                              (line  72)
2662* Most significant bit:                  Miscellaneous Integer Functions.
2663                                                              (line  34)
2664* mp.h:                                  BSD Compatible Functions.
2665                                                              (line  21)
2666* MPN_PATH:                              Build Options.       (line 336)
2667* MS Windows:                            Notes for Particular Systems.
2668                                                              (line  43)
2669* MS-DOS:                                Notes for Particular Systems.
2670                                                              (line  43)
2671* Multi-threading:                       Reentrancy.          (line   6)
2672* Multiplication algorithms:             Multiplication Algorithms.
2673                                                              (line   6)
2674* Nails:                                 Low-level Functions. (line 485)
2675* Native compilation:                    Build Options.       (line  52)
2676* NeXT:                                  Known Build Problems.
2677                                                              (line  57)
2678* Next prime function:                   Number Theoretic Functions.
2679                                                              (line  23)
2680* Nomenclature:                          Nomenclature and Types.
2681                                                              (line   6)
2682* Non-Unix systems:                      Build Options.       (line  11)
2683* Nth root algorithm:                    Nth Root Algorithm.  (line   6)
2684* Number sequences:                      Efficiency.          (line 147)
2685* Number theoretic functions:            Number Theoretic Functions.
2686                                                              (line   6)
2687* Numerator and denominator:             Applying Integer Functions.
2688                                                              (line   6)
2689* obstack output:                        Formatted Output Functions.
2690                                                              (line  81)
2691* OpenBSD:                               Notes for Particular Systems.
2692                                                              (line  86)
2693* Optimizing performance:                Performance optimization.
2694                                                              (line   6)
2695* ostream output:                        C++ Formatted Output.
2696                                                              (line   6)
2697* Other languages:                       Language Bindings.   (line   6)
2698* Output functions <1>:                  I/O of Integers.     (line   6)
2699* Output functions <2>:                  I/O of Rationals.    (line   6)
2700* Output functions <3>:                  Formatted Output Functions.
2701                                                              (line   6)
2702* Output functions:                      I/O of Floats.       (line   6)
2703* Packaged builds:                       Notes for Package Builds.
2704                                                              (line   6)
2705* Parameter conventions:                 Parameter Conventions.
2706                                                              (line   6)
2707* Parsing expressions demo:              Demonstration Programs.
2708                                                              (line  21)
2709* Particular systems:                    Notes for Particular Systems.
2710                                                              (line   6)
2711* Past GMP versions:                     Compatibility with older versions.
2712                                                              (line   6)
2713* PDF:                                   Build Options.       (line 351)
2714* Perfect power algorithm:               Perfect Power Algorithm.
2715                                                              (line   6)
2716* Perfect power functions:               Integer Roots.       (line  27)
2717* Perfect square algorithm:              Perfect Square Algorithm.
2718                                                              (line   6)
2719* Perfect square functions:              Integer Roots.       (line  36)
2720* perl:                                  Demonstration Programs.
2721                                                              (line  35)
2722* Perl module:                           Demonstration Programs.
2723                                                              (line  35)
2724* Postscript:                            Build Options.       (line 351)
2725* Power/PowerPC <1>:                     Known Build Problems.
2726                                                              (line  63)
2727* Power/PowerPC:                         Notes for Particular Systems.
2728                                                              (line  92)
2729* Powering algorithms:                   Powering Algorithms. (line   6)
2730* Powering functions <1>:                Float Arithmetic.    (line  41)
2731* Powering functions:                    Integer Exponentiation.
2732                                                              (line   6)
2733* PowerPC:                               ABI and ISA.         (line 167)
2734* Precision of floats:                   Floating-point Functions.
2735                                                              (line   6)
2736* Precision of hardware floating point:  Notes for Particular Systems.
2737                                                              (line  34)
2738* Prefix:                                Build Options.       (line  32)
2739* Prime testing algorithms:              Prime Testing Algorithm.
2740                                                              (line   6)
2741* Prime testing functions:               Number Theoretic Functions.
2742                                                              (line   7)
2743* printf formatted output:               Formatted Output.    (line   6)
2744* Probable prime testing functions:      Number Theoretic Functions.
2745                                                              (line   7)
2746* prof:                                  Profiling.           (line  24)
2747* Profiling:                             Profiling.           (line   6)
2748* Radix conversion algorithms:           Radix Conversion Algorithms.
2749                                                              (line   6)
2750* Random number algorithms:              Random Number Algorithms.
2751                                                              (line   6)
2752* Random number functions <1>:           Random Number Functions.
2753                                                              (line   6)
2754* Random number functions <2>:           Miscellaneous Float Functions.
2755                                                              (line  27)
2756* Random number functions:               Integer Random Numbers.
2757                                                              (line   6)
2758* Random number seeding:                 Random State Seeding.
2759                                                              (line   6)
2760* Random number state:                   Random State Initialization.
2761                                                              (line   6)
2762* Random state:                          Nomenclature and Types.
2763                                                              (line  46)
2764* Rational arithmetic:                   Efficiency.          (line 113)
2765* Rational arithmetic functions:         Rational Arithmetic. (line   6)
2766* Rational assignment functions:         Initializing Rationals.
2767                                                              (line   6)
2768* Rational comparison functions:         Comparing Rationals. (line   6)
2769* Rational conversion functions:         Rational Conversions.
2770                                                              (line   6)
2771* Rational initialization functions:     Initializing Rationals.
2772                                                              (line   6)
2773* Rational input and output functions:   I/O of Rationals.    (line   6)
2774* Rational internals:                    Rational Internals.  (line   6)
2775* Rational number:                       Nomenclature and Types.
2776                                                              (line  16)
2777* Rational number functions:             Rational Number Functions.
2778                                                              (line   6)
2779* Rational numerator and denominator:    Applying Integer Functions.
2780                                                              (line   6)
2781* Rational sign tests:                   Comparing Rationals. (line  27)
2782* Raw output internals:                  Raw Output Internals.
2783                                                              (line   6)
2784* Reallocations:                         Efficiency.          (line  30)
2785* Reentrancy:                            Reentrancy.          (line   6)
2786* References:                            References.          (line   6)
2787* Remove factor functions:               Number Theoretic Functions.
2788                                                              (line 103)
2789* Reporting bugs:                        Reporting Bugs.      (line   6)
2790* Root extraction algorithm:             Nth Root Algorithm.  (line   6)
2791* Root extraction algorithms:            Root Extraction Algorithms.
2792                                                              (line   6)
2793* Root extraction functions <1>:         Float Arithmetic.    (line  37)
2794* Root extraction functions:             Integer Roots.       (line   6)
2795* Root testing functions:                Integer Roots.       (line  27)
2796* Rounding functions:                    Miscellaneous Float Functions.
2797                                                              (line   9)
2798* Sample programs:                       Demonstration Programs.
2799                                                              (line   6)
2800* Scan bit functions:                    Integer Logic and Bit Fiddling.
2801                                                              (line  38)
2802* scanf formatted input:                 Formatted Input.     (line   6)
2803* SCO:                                   Known Build Problems.
2804                                                              (line  38)
2805* Seeding random numbers:                Random State Seeding.
2806                                                              (line   6)
2807* Segmentation violation:                Debugging.           (line   7)
2808* Sequent Symmetry:                      Known Build Problems.
2809                                                              (line  68)
2810* Services for Unix:                     Notes for Particular Systems.
2811                                                              (line  51)
2812* Shared library versioning:             Notes for Package Builds.
2813                                                              (line   9)
2814* Sign tests <1>:                        Integer Comparisons. (line  28)
2815* Sign tests <2>:                        Comparing Rationals. (line  27)
2816* Sign tests:                            Float Comparison.    (line  33)
2817* Size in digits:                        Miscellaneous Integer Functions.
2818                                                              (line  23)
2819* Small operands:                        Efficiency.          (line   7)
2820* Solaris <1>:                           Known Build Problems.
2821                                                              (line  78)
2822* Solaris:                               ABI and ISA.         (line 201)
2823* Sparc:                                 Notes for Particular Systems.
2824                                                              (line 103)
2825* Sparc V9:                              ABI and ISA.         (line 201)
2826* Special integer functions:             Integer Special Functions.
2827                                                              (line   6)
2828* Square root algorithm:                 Square Root Algorithm.
2829                                                              (line   6)
2830* SSE2:                                  Notes for Particular Systems.
2831                                                              (line 132)
2832* Stack backtrace:                       Debugging.           (line  50)
2833* Stack overflow <1>:                    Build Options.       (line 278)
2834* Stack overflow:                        Debugging.           (line   7)
2835* Static linking:                        Efficiency.          (line  14)
2836* stdarg.h:                              Headers and Libraries.
2837                                                              (line  17)
2838* stdio.h:                               Headers and Libraries.
2839                                                              (line  11)
2840* Stripped libraries:                    Known Build Problems.
2841                                                              (line  28)
2842* Sun:                                   ABI and ISA.         (line 201)
2843* SunOS:                                 Notes for Particular Systems.
2844                                                              (line 120)
2845* Systems:                               Notes for Particular Systems.
2846                                                              (line   6)
2847* Temporary memory:                      Build Options.       (line 278)
2848* Texinfo:                               Build Options.       (line 348)
2849* Text input/output:                     Efficiency.          (line 153)
2850* Thread safety:                         Reentrancy.          (line   6)
2851* Toom multiplication <1>:               Other Multiplication.
2852                                                              (line   6)
2853* Toom multiplication <2>:               Toom 3-Way Multiplication.
2854                                                              (line   6)
2855* Toom multiplication <3>:               Toom 4-Way Multiplication.
2856                                                              (line   6)
2857* Toom multiplication:                   Higher degree Toom'n'half.
2858                                                              (line   6)
2859* Types:                                 Nomenclature and Types.
2860                                                              (line   6)
2861* ui and si functions:                   Efficiency.          (line  50)
2862* Unbalanced multiplication:             Unbalanced Multiplication.
2863                                                              (line   6)
2864* Upward compatibility:                  Compatibility with older versions.
2865                                                              (line   6)
2866* Useful macros and constants:           Useful Macros and Constants.
2867                                                              (line   6)
2868* User-defined precision:                Floating-point Functions.
2869                                                              (line   6)
2870* Valgrind:                              Debugging.           (line 130)
2871* Variable conventions:                  Variable Conventions.
2872                                                              (line   6)
2873* Version number:                        Useful Macros and Constants.
2874                                                              (line  12)
2875* Web page:                              Introduction to GMP. (line  34)
2876* Windows:                               Notes for Particular Systems.
2877                                                              (line  43)
2878* x86:                                   Notes for Particular Systems.
2879                                                              (line 126)
2880* x87:                                   Notes for Particular Systems.
2881                                                              (line  34)
2882* XML:                                   Build Options.       (line 355)
2883
2884
2885File: gmp.info,  Node: Function Index,  Prev: Concept Index,  Up: Top
2886
2887Function and Type Index
2888***********************
2889
2890�[index�]
2891* Menu:
2892
2893* __GMP_CC:                              Useful Macros and Constants.
2894                                                              (line  23)
2895* __GMP_CFLAGS:                          Useful Macros and Constants.
2896                                                              (line  24)
2897* __GNU_MP_VERSION:                      Useful Macros and Constants.
2898                                                              (line  10)
2899* __GNU_MP_VERSION_MINOR:                Useful Macros and Constants.
2900                                                              (line  11)
2901* __GNU_MP_VERSION_PATCHLEVEL:           Useful Macros and Constants.
2902                                                              (line  12)
2903* _mpz_realloc:                          Integer Special Functions.
2904                                                              (line  51)
2905* abs <1>:                               C++ Interface Floats.
2906                                                              (line  79)
2907* abs <2>:                               C++ Interface Rationals.
2908                                                              (line  43)
2909* abs:                                   C++ Interface Integers.
2910                                                              (line  42)
2911* ceil:                                  C++ Interface Floats.
2912                                                              (line  80)
2913* cmp <1>:                               C++ Interface Floats.
2914                                                              (line  81)
2915* cmp <2>:                               C++ Interface Integers.
2916                                                              (line  43)
2917* cmp <3>:                               C++ Interface Floats.
2918                                                              (line  82)
2919* cmp <4>:                               C++ Interface Rationals.
2920                                                              (line  45)
2921* cmp:                                   C++ Interface Integers.
2922                                                              (line  44)
2923* floor:                                 C++ Interface Floats.
2924                                                              (line  89)
2925* gcd:                                   BSD Compatible Functions.
2926                                                              (line  82)
2927* gmp_asprintf:                          Formatted Output Functions.
2928                                                              (line  65)
2929* gmp_errno:                             Random State Initialization.
2930                                                              (line  55)
2931* GMP_ERROR_INVALID_ARGUMENT:            Random State Initialization.
2932                                                              (line  55)
2933* GMP_ERROR_UNSUPPORTED_ARGUMENT:        Random State Initialization.
2934                                                              (line  55)
2935* gmp_fprintf:                           Formatted Output Functions.
2936                                                              (line  29)
2937* gmp_fscanf:                            Formatted Input Functions.
2938                                                              (line  25)
2939* GMP_LIMB_BITS:                         Low-level Functions. (line 515)
2940* GMP_NAIL_BITS:                         Low-level Functions. (line 513)
2941* GMP_NAIL_MASK:                         Low-level Functions. (line 523)
2942* GMP_NUMB_BITS:                         Low-level Functions. (line 514)
2943* GMP_NUMB_MASK:                         Low-level Functions. (line 524)
2944* GMP_NUMB_MAX:                          Low-level Functions. (line 532)
2945* gmp_obstack_printf:                    Formatted Output Functions.
2946                                                              (line  79)
2947* gmp_obstack_vprintf:                   Formatted Output Functions.
2948                                                              (line  81)
2949* gmp_printf:                            Formatted Output Functions.
2950                                                              (line  24)
2951* GMP_RAND_ALG_DEFAULT:                  Random State Initialization.
2952                                                              (line  49)
2953* GMP_RAND_ALG_LC:                       Random State Initialization.
2954                                                              (line  49)
2955* gmp_randclass:                         C++ Interface Random Numbers.
2956                                                              (line   7)
2957* gmp_randclass::get_f:                  C++ Interface Random Numbers.
2958                                                              (line  45)
2959* gmp_randclass::get_z_bits:             C++ Interface Random Numbers.
2960                                                              (line  38)
2961* gmp_randclass::get_z_range:            C++ Interface Random Numbers.
2962                                                              (line  42)
2963* gmp_randclass::gmp_randclass:          C++ Interface Random Numbers.
2964                                                              (line  27)
2965* gmp_randclass::seed:                   C++ Interface Random Numbers.
2966                                                              (line  34)
2967* gmp_randclear:                         Random State Initialization.
2968                                                              (line  62)
2969* gmp_randinit:                          Random State Initialization.
2970                                                              (line  47)
2971* gmp_randinit_default:                  Random State Initialization.
2972                                                              (line   7)
2973* gmp_randinit_lc_2exp:                  Random State Initialization.
2974                                                              (line  18)
2975* gmp_randinit_lc_2exp_size:             Random State Initialization.
2976                                                              (line  32)
2977* gmp_randinit_mt:                       Random State Initialization.
2978                                                              (line  13)
2979* gmp_randinit_set:                      Random State Initialization.
2980                                                              (line  43)
2981* gmp_randseed:                          Random State Seeding.
2982                                                              (line   7)
2983* gmp_randseed_ui:                       Random State Seeding.
2984                                                              (line   9)
2985* gmp_randstate_t:                       Nomenclature and Types.
2986                                                              (line  46)
2987* gmp_scanf:                             Formatted Input Functions.
2988                                                              (line  21)
2989* gmp_snprintf:                          Formatted Output Functions.
2990                                                              (line  46)
2991* gmp_sprintf:                           Formatted Output Functions.
2992                                                              (line  34)
2993* gmp_sscanf:                            Formatted Input Functions.
2994                                                              (line  29)
2995* gmp_urandomb_ui:                       Random State Miscellaneous.
2996                                                              (line   8)
2997* gmp_urandomm_ui:                       Random State Miscellaneous.
2998                                                              (line  14)
2999* gmp_vasprintf:                         Formatted Output Functions.
3000                                                              (line  66)
3001* gmp_version:                           Useful Macros and Constants.
3002                                                              (line  18)
3003* gmp_vfprintf:                          Formatted Output Functions.
3004                                                              (line  30)
3005* gmp_vfscanf:                           Formatted Input Functions.
3006                                                              (line  26)
3007* gmp_vprintf:                           Formatted Output Functions.
3008                                                              (line  25)
3009* gmp_vscanf:                            Formatted Input Functions.
3010                                                              (line  22)
3011* gmp_vsnprintf:                         Formatted Output Functions.
3012                                                              (line  48)
3013* gmp_vsprintf:                          Formatted Output Functions.
3014                                                              (line  35)
3015* gmp_vsscanf:                           Formatted Input Functions.
3016                                                              (line  31)
3017* hypot:                                 C++ Interface Floats.
3018                                                              (line  90)
3019* itom:                                  BSD Compatible Functions.
3020                                                              (line  29)
3021* madd:                                  BSD Compatible Functions.
3022                                                              (line  43)
3023* mcmp:                                  BSD Compatible Functions.
3024                                                              (line  85)
3025* mdiv:                                  BSD Compatible Functions.
3026                                                              (line  53)
3027* mfree:                                 BSD Compatible Functions.
3028                                                              (line 105)
3029* min:                                   BSD Compatible Functions.
3030                                                              (line  89)
3031* MINT:                                  BSD Compatible Functions.
3032                                                              (line  21)
3033* mout:                                  BSD Compatible Functions.
3034                                                              (line  94)
3035* move:                                  BSD Compatible Functions.
3036                                                              (line  39)
3037* mp_bitcnt_t:                           Nomenclature and Types.
3038                                                              (line  42)
3039* mp_bits_per_limb:                      Useful Macros and Constants.
3040                                                              (line   7)
3041* mp_exp_t:                              Nomenclature and Types.
3042                                                              (line  27)
3043* mp_get_memory_functions:               Custom Allocation.   (line  93)
3044* mp_limb_t:                             Nomenclature and Types.
3045                                                              (line  31)
3046* mp_set_memory_functions:               Custom Allocation.   (line  21)
3047* mp_size_t:                             Nomenclature and Types.
3048                                                              (line  37)
3049* mpf_abs:                               Float Arithmetic.    (line  47)
3050* mpf_add:                               Float Arithmetic.    (line   7)
3051* mpf_add_ui:                            Float Arithmetic.    (line   9)
3052* mpf_ceil:                              Miscellaneous Float Functions.
3053                                                              (line   7)
3054* mpf_class:                             C++ Interface General.
3055                                                              (line  20)
3056* mpf_class::fits_sint_p:                C++ Interface Floats.
3057                                                              (line  83)
3058* mpf_class::fits_slong_p:               C++ Interface Floats.
3059                                                              (line  84)
3060* mpf_class::fits_sshort_p:              C++ Interface Floats.
3061                                                              (line  85)
3062* mpf_class::fits_uint_p:                C++ Interface Floats.
3063                                                              (line  86)
3064* mpf_class::fits_ulong_p:               C++ Interface Floats.
3065                                                              (line  87)
3066* mpf_class::fits_ushort_p:              C++ Interface Floats.
3067                                                              (line  88)
3068* mpf_class::get_d:                      C++ Interface Floats.
3069                                                              (line  91)
3070* mpf_class::get_mpf_t:                  C++ Interface General.
3071                                                              (line  66)
3072* mpf_class::get_prec:                   C++ Interface Floats.
3073                                                              (line 109)
3074* mpf_class::get_si:                     C++ Interface Floats.
3075                                                              (line  92)
3076* mpf_class::get_str:                    C++ Interface Floats.
3077                                                              (line  94)
3078* mpf_class::get_ui:                     C++ Interface Floats.
3079                                                              (line  95)
3080* mpf_class::mpf_class:                  C++ Interface Floats.
3081                                                              (line  12)
3082* mpf_class::operator=:                  C++ Interface Floats.
3083                                                              (line  56)
3084* mpf_class::set_prec:                   C++ Interface Floats.
3085                                                              (line 110)
3086* mpf_class::set_prec_raw:               C++ Interface Floats.
3087                                                              (line 111)
3088* mpf_class::set_str:                    C++ Interface Floats.
3089                                                              (line  97)
3090* mpf_clear:                             Initializing Floats. (line  37)
3091* mpf_clears:                            Initializing Floats. (line  41)
3092* mpf_cmp:                               Float Comparison.    (line   7)
3093* mpf_cmp_d:                             Float Comparison.    (line   8)
3094* mpf_cmp_si:                            Float Comparison.    (line  10)
3095* mpf_cmp_ui:                            Float Comparison.    (line   9)
3096* mpf_div:                               Float Arithmetic.    (line  29)
3097* mpf_div_2exp:                          Float Arithmetic.    (line  53)
3098* mpf_div_ui:                            Float Arithmetic.    (line  33)
3099* mpf_eq:                                Float Comparison.    (line  17)
3100* mpf_fits_sint_p:                       Miscellaneous Float Functions.
3101                                                              (line  20)
3102* mpf_fits_slong_p:                      Miscellaneous Float Functions.
3103                                                              (line  18)
3104* mpf_fits_sshort_p:                     Miscellaneous Float Functions.
3105                                                              (line  22)
3106* mpf_fits_uint_p:                       Miscellaneous Float Functions.
3107                                                              (line  19)
3108* mpf_fits_ulong_p:                      Miscellaneous Float Functions.
3109                                                              (line  17)
3110* mpf_fits_ushort_p:                     Miscellaneous Float Functions.
3111                                                              (line  21)
3112* mpf_floor:                             Miscellaneous Float Functions.
3113                                                              (line   8)
3114* mpf_get_d:                             Converting Floats.   (line   7)
3115* mpf_get_d_2exp:                        Converting Floats.   (line  16)
3116* mpf_get_default_prec:                  Initializing Floats. (line  12)
3117* mpf_get_prec:                          Initializing Floats. (line  62)
3118* mpf_get_si:                            Converting Floats.   (line  27)
3119* mpf_get_str:                           Converting Floats.   (line  37)
3120* mpf_get_ui:                            Converting Floats.   (line  28)
3121* mpf_init:                              Initializing Floats. (line  19)
3122* mpf_init2:                             Initializing Floats. (line  26)
3123* mpf_init_set:                          Simultaneous Float Init & Assign.
3124                                                              (line  16)
3125* mpf_init_set_d:                        Simultaneous Float Init & Assign.
3126                                                              (line  19)
3127* mpf_init_set_si:                       Simultaneous Float Init & Assign.
3128                                                              (line  18)
3129* mpf_init_set_str:                      Simultaneous Float Init & Assign.
3130                                                              (line  25)
3131* mpf_init_set_ui:                       Simultaneous Float Init & Assign.
3132                                                              (line  17)
3133* mpf_inits:                             Initializing Floats. (line  31)
3134* mpf_inp_str:                           I/O of Floats.       (line  39)
3135* mpf_integer_p:                         Miscellaneous Float Functions.
3136                                                              (line  14)
3137* mpf_mul:                               Float Arithmetic.    (line  19)
3138* mpf_mul_2exp:                          Float Arithmetic.    (line  50)
3139* mpf_mul_ui:                            Float Arithmetic.    (line  21)
3140* mpf_neg:                               Float Arithmetic.    (line  44)
3141* mpf_out_str:                           I/O of Floats.       (line  19)
3142* mpf_pow_ui:                            Float Arithmetic.    (line  41)
3143* mpf_random2:                           Miscellaneous Float Functions.
3144                                                              (line  37)
3145* mpf_reldiff:                           Float Comparison.    (line  29)
3146* mpf_set:                               Assigning Floats.    (line  10)
3147* mpf_set_d:                             Assigning Floats.    (line  13)
3148* mpf_set_default_prec:                  Initializing Floats. (line   7)
3149* mpf_set_prec:                          Initializing Floats. (line  65)
3150* mpf_set_prec_raw:                      Initializing Floats. (line  72)
3151* mpf_set_q:                             Assigning Floats.    (line  15)
3152* mpf_set_si:                            Assigning Floats.    (line  12)
3153* mpf_set_str:                           Assigning Floats.    (line  18)
3154* mpf_set_ui:                            Assigning Floats.    (line  11)
3155* mpf_set_z:                             Assigning Floats.    (line  14)
3156* mpf_sgn:                               Float Comparison.    (line  33)
3157* mpf_sqrt:                              Float Arithmetic.    (line  36)
3158* mpf_sqrt_ui:                           Float Arithmetic.    (line  37)
3159* mpf_sub:                               Float Arithmetic.    (line  12)
3160* mpf_sub_ui:                            Float Arithmetic.    (line  16)
3161* mpf_swap:                              Assigning Floats.    (line  52)
3162* mpf_t:                                 Nomenclature and Types.
3163                                                              (line  21)
3164* mpf_trunc:                             Miscellaneous Float Functions.
3165                                                              (line   9)
3166* mpf_ui_div:                            Float Arithmetic.    (line  31)
3167* mpf_ui_sub:                            Float Arithmetic.    (line  14)
3168* mpf_urandomb:                          Miscellaneous Float Functions.
3169                                                              (line  27)
3170* mpn_add:                               Low-level Functions. (line  69)
3171* mpn_add_1:                             Low-level Functions. (line  64)
3172* mpn_add_n:                             Low-level Functions. (line  54)
3173* mpn_addmul_1:                          Low-level Functions. (line 148)
3174* mpn_and_n:                             Low-level Functions. (line 427)
3175* mpn_andn_n:                            Low-level Functions. (line 442)
3176* mpn_cmp:                               Low-level Functions. (line 284)
3177* mpn_com:                               Low-level Functions. (line 467)
3178* mpn_copyd:                             Low-level Functions. (line 476)
3179* mpn_copyi:                             Low-level Functions. (line 472)
3180* mpn_divexact_by3:                      Low-level Functions. (line 229)
3181* mpn_divexact_by3c:                     Low-level Functions. (line 231)
3182* mpn_divmod:                            Low-level Functions. (line 224)
3183* mpn_divmod_1:                          Low-level Functions. (line 208)
3184* mpn_divrem:                            Low-level Functions. (line 182)
3185* mpn_divrem_1:                          Low-level Functions. (line 206)
3186* mpn_gcd:                               Low-level Functions. (line 289)
3187* mpn_gcd_1:                             Low-level Functions. (line 299)
3188* mpn_gcdext:                            Low-level Functions. (line 305)
3189* mpn_get_str:                           Low-level Functions. (line 352)
3190* mpn_hamdist:                           Low-level Functions. (line 416)
3191* mpn_ior_n:                             Low-level Functions. (line 432)
3192* mpn_iorn_n:                            Low-level Functions. (line 447)
3193* mpn_lshift:                            Low-level Functions. (line 260)
3194* mpn_mod_1:                             Low-level Functions. (line 255)
3195* mpn_mul:                               Low-level Functions. (line 114)
3196* mpn_mul_1:                             Low-level Functions. (line 133)
3197* mpn_mul_n:                             Low-level Functions. (line 103)
3198* mpn_nand_n:                            Low-level Functions. (line 452)
3199* mpn_neg:                               Low-level Functions. (line  98)
3200* mpn_nior_n:                            Low-level Functions. (line 457)
3201* mpn_perfect_square_p:                  Low-level Functions. (line 422)
3202* mpn_popcount:                          Low-level Functions. (line 412)
3203* mpn_random:                            Low-level Functions. (line 401)
3204* mpn_random2:                           Low-level Functions. (line 402)
3205* mpn_rshift:                            Low-level Functions. (line 272)
3206* mpn_scan0:                             Low-level Functions. (line 386)
3207* mpn_scan1:                             Low-level Functions. (line 394)
3208* mpn_set_str:                           Low-level Functions. (line 367)
3209* mpn_sqr:                               Low-level Functions. (line 125)
3210* mpn_sqrtrem:                           Low-level Functions. (line 334)
3211* mpn_sub:                               Low-level Functions. (line  90)
3212* mpn_sub_1:                             Low-level Functions. (line  85)
3213* mpn_sub_n:                             Low-level Functions. (line  76)
3214* mpn_submul_1:                          Low-level Functions. (line 159)
3215* mpn_tdiv_qr:                           Low-level Functions. (line 171)
3216* mpn_xnor_n:                            Low-level Functions. (line 462)
3217* mpn_xor_n:                             Low-level Functions. (line 437)
3218* mpn_zero:                              Low-level Functions. (line 479)
3219* mpq_abs:                               Rational Arithmetic. (line  31)
3220* mpq_add:                               Rational Arithmetic. (line   7)
3221* mpq_canonicalize:                      Rational Number Functions.
3222                                                              (line  22)
3223* mpq_class:                             C++ Interface General.
3224                                                              (line  19)
3225* mpq_class::canonicalize:               C++ Interface Rationals.
3226                                                              (line  37)
3227* mpq_class::get_d:                      C++ Interface Rationals.
3228                                                              (line  46)
3229* mpq_class::get_den:                    C++ Interface Rationals.
3230                                                              (line  58)
3231* mpq_class::get_den_mpz_t:              C++ Interface Rationals.
3232                                                              (line  68)
3233* mpq_class::get_mpq_t:                  C++ Interface General.
3234                                                              (line  65)
3235* mpq_class::get_num:                    C++ Interface Rationals.
3236                                                              (line  57)
3237* mpq_class::get_num_mpz_t:              C++ Interface Rationals.
3238                                                              (line  67)
3239* mpq_class::get_str:                    C++ Interface Rationals.
3240                                                              (line  47)
3241* mpq_class::mpq_class:                  C++ Interface Rationals.
3242                                                              (line  30)
3243* mpq_class::set_str:                    C++ Interface Rationals.
3244                                                              (line  48)
3245* mpq_clear:                             Initializing Rationals.
3246                                                              (line  16)
3247* mpq_clears:                            Initializing Rationals.
3248                                                              (line  20)
3249* mpq_cmp:                               Comparing Rationals. (line   7)
3250* mpq_cmp_si:                            Comparing Rationals. (line  17)
3251* mpq_cmp_ui:                            Comparing Rationals. (line  15)
3252* mpq_denref:                            Applying Integer Functions.
3253                                                              (line  18)
3254* mpq_div:                               Rational Arithmetic. (line  22)
3255* mpq_div_2exp:                          Rational Arithmetic. (line  25)
3256* mpq_equal:                             Comparing Rationals. (line  33)
3257* mpq_get_d:                             Rational Conversions.
3258                                                              (line   7)
3259* mpq_get_den:                           Applying Integer Functions.
3260                                                              (line  24)
3261* mpq_get_num:                           Applying Integer Functions.
3262                                                              (line  23)
3263* mpq_get_str:                           Rational Conversions.
3264                                                              (line  22)
3265* mpq_init:                              Initializing Rationals.
3266                                                              (line   7)
3267* mpq_inits:                             Initializing Rationals.
3268                                                              (line  12)
3269* mpq_inp_str:                           I/O of Rationals.    (line  26)
3270* mpq_inv:                               Rational Arithmetic. (line  34)
3271* mpq_mul:                               Rational Arithmetic. (line  15)
3272* mpq_mul_2exp:                          Rational Arithmetic. (line  18)
3273* mpq_neg:                               Rational Arithmetic. (line  28)
3274* mpq_numref:                            Applying Integer Functions.
3275                                                              (line  17)
3276* mpq_out_str:                           I/O of Rationals.    (line  18)
3277* mpq_set:                               Initializing Rationals.
3278                                                              (line  24)
3279* mpq_set_d:                             Rational Conversions.
3280                                                              (line  17)
3281* mpq_set_den:                           Applying Integer Functions.
3282                                                              (line  26)
3283* mpq_set_f:                             Rational Conversions.
3284                                                              (line  18)
3285* mpq_set_num:                           Applying Integer Functions.
3286                                                              (line  25)
3287* mpq_set_si:                            Initializing Rationals.
3288                                                              (line  31)
3289* mpq_set_str:                           Initializing Rationals.
3290                                                              (line  36)
3291* mpq_set_ui:                            Initializing Rationals.
3292                                                              (line  29)
3293* mpq_set_z:                             Initializing Rationals.
3294                                                              (line  25)
3295* mpq_sgn:                               Comparing Rationals. (line  27)
3296* mpq_sub:                               Rational Arithmetic. (line  11)
3297* mpq_swap:                              Initializing Rationals.
3298                                                              (line  56)
3299* mpq_t:                                 Nomenclature and Types.
3300                                                              (line  16)
3301* mpz_abs:                               Integer Arithmetic.  (line  42)
3302* mpz_add:                               Integer Arithmetic.  (line   7)
3303* mpz_add_ui:                            Integer Arithmetic.  (line   9)
3304* mpz_addmul:                            Integer Arithmetic.  (line  25)
3305* mpz_addmul_ui:                         Integer Arithmetic.  (line  27)
3306* mpz_and:                               Integer Logic and Bit Fiddling.
3307                                                              (line  11)
3308* mpz_array_init:                        Integer Special Functions.
3309                                                              (line  11)
3310* mpz_bin_ui:                            Number Theoretic Functions.
3311                                                              (line 111)
3312* mpz_bin_uiui:                          Number Theoretic Functions.
3313                                                              (line 113)
3314* mpz_cdiv_q:                            Integer Division.    (line  13)
3315* mpz_cdiv_q_2exp:                       Integer Division.    (line  24)
3316* mpz_cdiv_q_ui:                         Integer Division.    (line  17)
3317* mpz_cdiv_qr:                           Integer Division.    (line  15)
3318* mpz_cdiv_qr_ui:                        Integer Division.    (line  21)
3319* mpz_cdiv_r:                            Integer Division.    (line  14)
3320* mpz_cdiv_r_2exp:                       Integer Division.    (line  25)
3321* mpz_cdiv_r_ui:                         Integer Division.    (line  19)
3322* mpz_cdiv_ui:                           Integer Division.    (line  23)
3323* mpz_class:                             C++ Interface General.
3324                                                              (line  18)
3325* mpz_class::fits_sint_p:                C++ Interface Integers.
3326                                                              (line  45)
3327* mpz_class::fits_slong_p:               C++ Interface Integers.
3328                                                              (line  46)
3329* mpz_class::fits_sshort_p:              C++ Interface Integers.
3330                                                              (line  47)
3331* mpz_class::fits_uint_p:                C++ Interface Integers.
3332                                                              (line  48)
3333* mpz_class::fits_ulong_p:               C++ Interface Integers.
3334                                                              (line  49)
3335* mpz_class::fits_ushort_p:              C++ Interface Integers.
3336                                                              (line  50)
3337* mpz_class::get_d:                      C++ Interface Integers.
3338                                                              (line  51)
3339* mpz_class::get_mpz_t:                  C++ Interface General.
3340                                                              (line  64)
3341* mpz_class::get_si:                     C++ Interface Integers.
3342                                                              (line  52)
3343* mpz_class::get_str:                    C++ Interface Integers.
3344                                                              (line  53)
3345* mpz_class::get_ui:                     C++ Interface Integers.
3346                                                              (line  54)
3347* mpz_class::mpz_class:                  C++ Interface Integers.
3348                                                              (line  20)
3349* mpz_class::set_str:                    C++ Interface Integers.
3350                                                              (line  55)
3351* mpz_clear:                             Initializing Integers.
3352                                                              (line  44)
3353* mpz_clears:                            Initializing Integers.
3354                                                              (line  48)
3355* mpz_clrbit:                            Integer Logic and Bit Fiddling.
3356                                                              (line  54)
3357* mpz_cmp:                               Integer Comparisons. (line   7)
3358* mpz_cmp_d:                             Integer Comparisons. (line   8)
3359* mpz_cmp_si:                            Integer Comparisons. (line   9)
3360* mpz_cmp_ui:                            Integer Comparisons. (line  10)
3361* mpz_cmpabs:                            Integer Comparisons. (line  18)
3362* mpz_cmpabs_d:                          Integer Comparisons. (line  19)
3363* mpz_cmpabs_ui:                         Integer Comparisons. (line  20)
3364* mpz_com:                               Integer Logic and Bit Fiddling.
3365                                                              (line  20)
3366* mpz_combit:                            Integer Logic and Bit Fiddling.
3367                                                              (line  57)
3368* mpz_congruent_2exp_p:                  Integer Division.    (line 124)
3369* mpz_congruent_p:                       Integer Division.    (line 121)
3370* mpz_congruent_ui_p:                    Integer Division.    (line 123)
3371* mpz_divexact:                          Integer Division.    (line 101)
3372* mpz_divexact_ui:                       Integer Division.    (line 102)
3373* mpz_divisible_2exp_p:                  Integer Division.    (line 112)
3374* mpz_divisible_p:                       Integer Division.    (line 110)
3375* mpz_divisible_ui_p:                    Integer Division.    (line 111)
3376* mpz_even_p:                            Miscellaneous Integer Functions.
3377                                                              (line  18)
3378* mpz_export:                            Integer Import and Export.
3379                                                              (line  45)
3380* mpz_fac_ui:                            Number Theoretic Functions.
3381                                                              (line 108)
3382* mpz_fdiv_q:                            Integer Division.    (line  27)
3383* mpz_fdiv_q_2exp:                       Integer Division.    (line  38)
3384* mpz_fdiv_q_ui:                         Integer Division.    (line  31)
3385* mpz_fdiv_qr:                           Integer Division.    (line  29)
3386* mpz_fdiv_qr_ui:                        Integer Division.    (line  35)
3387* mpz_fdiv_r:                            Integer Division.    (line  28)
3388* mpz_fdiv_r_2exp:                       Integer Division.    (line  39)
3389* mpz_fdiv_r_ui:                         Integer Division.    (line  33)
3390* mpz_fdiv_ui:                           Integer Division.    (line  37)
3391* mpz_fib2_ui:                           Number Theoretic Functions.
3392                                                              (line 121)
3393* mpz_fib_ui:                            Number Theoretic Functions.
3394                                                              (line 119)
3395* mpz_fits_sint_p:                       Miscellaneous Integer Functions.
3396                                                              (line  10)
3397* mpz_fits_slong_p:                      Miscellaneous Integer Functions.
3398                                                              (line   8)
3399* mpz_fits_sshort_p:                     Miscellaneous Integer Functions.
3400                                                              (line  12)
3401* mpz_fits_uint_p:                       Miscellaneous Integer Functions.
3402                                                              (line   9)
3403* mpz_fits_ulong_p:                      Miscellaneous Integer Functions.
3404                                                              (line   7)
3405* mpz_fits_ushort_p:                     Miscellaneous Integer Functions.
3406                                                              (line  11)
3407* mpz_gcd:                               Number Theoretic Functions.
3408                                                              (line  30)
3409* mpz_gcd_ui:                            Number Theoretic Functions.
3410                                                              (line  37)
3411* mpz_gcdext:                            Number Theoretic Functions.
3412                                                              (line  47)
3413* mpz_get_d:                             Converting Integers. (line  27)
3414* mpz_get_d_2exp:                        Converting Integers. (line  35)
3415* mpz_get_si:                            Converting Integers. (line  18)
3416* mpz_get_str:                           Converting Integers. (line  46)
3417* mpz_get_ui:                            Converting Integers. (line  11)
3418* mpz_getlimbn:                          Integer Special Functions.
3419                                                              (line  60)
3420* mpz_hamdist:                           Integer Logic and Bit Fiddling.
3421                                                              (line  29)
3422* mpz_import:                            Integer Import and Export.
3423                                                              (line  11)
3424* mpz_init:                              Initializing Integers.
3425                                                              (line  26)
3426* mpz_init2:                             Initializing Integers.
3427                                                              (line  33)
3428* mpz_init_set:                          Simultaneous Integer Init & Assign.
3429                                                              (line  27)
3430* mpz_init_set_d:                        Simultaneous Integer Init & Assign.
3431                                                              (line  30)
3432* mpz_init_set_si:                       Simultaneous Integer Init & Assign.
3433                                                              (line  29)
3434* mpz_init_set_str:                      Simultaneous Integer Init & Assign.
3435                                                              (line  34)
3436* mpz_init_set_ui:                       Simultaneous Integer Init & Assign.
3437                                                              (line  28)
3438* mpz_inits:                             Initializing Integers.
3439                                                              (line  29)
3440* mpz_inp_raw:                           I/O of Integers.     (line  61)
3441* mpz_inp_str:                           I/O of Integers.     (line  30)
3442* mpz_invert:                            Number Theoretic Functions.
3443                                                              (line  72)
3444* mpz_ior:                               Integer Logic and Bit Fiddling.
3445                                                              (line  14)
3446* mpz_jacobi:                            Number Theoretic Functions.
3447                                                              (line  79)
3448* mpz_kronecker:                         Number Theoretic Functions.
3449                                                              (line  87)
3450* mpz_kronecker_si:                      Number Theoretic Functions.
3451                                                              (line  88)
3452* mpz_kronecker_ui:                      Number Theoretic Functions.
3453                                                              (line  89)
3454* mpz_lcm:                               Number Theoretic Functions.
3455                                                              (line  66)
3456* mpz_lcm_ui:                            Number Theoretic Functions.
3457                                                              (line  67)
3458* mpz_legendre:                          Number Theoretic Functions.
3459                                                              (line  82)
3460* mpz_lucnum2_ui:                        Number Theoretic Functions.
3461                                                              (line 132)
3462* mpz_lucnum_ui:                         Number Theoretic Functions.
3463                                                              (line 130)
3464* mpz_mod:                               Integer Division.    (line  91)
3465* mpz_mod_ui:                            Integer Division.    (line  93)
3466* mpz_mul:                               Integer Arithmetic.  (line  19)
3467* mpz_mul_2exp:                          Integer Arithmetic.  (line  35)
3468* mpz_mul_si:                            Integer Arithmetic.  (line  20)
3469* mpz_mul_ui:                            Integer Arithmetic.  (line  22)
3470* mpz_neg:                               Integer Arithmetic.  (line  39)
3471* mpz_nextprime:                         Number Theoretic Functions.
3472                                                              (line  23)
3473* mpz_odd_p:                             Miscellaneous Integer Functions.
3474                                                              (line  17)
3475* mpz_out_raw:                           I/O of Integers.     (line  45)
3476* mpz_out_str:                           I/O of Integers.     (line  18)
3477* mpz_perfect_power_p:                   Integer Roots.       (line  27)
3478* mpz_perfect_square_p:                  Integer Roots.       (line  36)
3479* mpz_popcount:                          Integer Logic and Bit Fiddling.
3480                                                              (line  23)
3481* mpz_pow_ui:                            Integer Exponentiation.
3482                                                              (line  31)
3483* mpz_powm:                              Integer Exponentiation.
3484                                                              (line   8)
3485* mpz_powm_sec:                          Integer Exponentiation.
3486                                                              (line  18)
3487* mpz_powm_ui:                           Integer Exponentiation.
3488                                                              (line  10)
3489* mpz_probab_prime_p:                    Number Theoretic Functions.
3490                                                              (line   7)
3491* mpz_random:                            Integer Random Numbers.
3492                                                              (line  42)
3493* mpz_random2:                           Integer Random Numbers.
3494                                                              (line  51)
3495* mpz_realloc2:                          Initializing Integers.
3496                                                              (line  52)
3497* mpz_remove:                            Number Theoretic Functions.
3498                                                              (line 103)
3499* mpz_root:                              Integer Roots.       (line   7)
3500* mpz_rootrem:                           Integer Roots.       (line  13)
3501* mpz_rrandomb:                          Integer Random Numbers.
3502                                                              (line  31)
3503* mpz_scan0:                             Integer Logic and Bit Fiddling.
3504                                                              (line  37)
3505* mpz_scan1:                             Integer Logic and Bit Fiddling.
3506                                                              (line  38)
3507* mpz_set:                               Assigning Integers.  (line  10)
3508* mpz_set_d:                             Assigning Integers.  (line  13)
3509* mpz_set_f:                             Assigning Integers.  (line  15)
3510* mpz_set_q:                             Assigning Integers.  (line  14)
3511* mpz_set_si:                            Assigning Integers.  (line  12)
3512* mpz_set_str:                           Assigning Integers.  (line  21)
3513* mpz_set_ui:                            Assigning Integers.  (line  11)
3514* mpz_setbit:                            Integer Logic and Bit Fiddling.
3515                                                              (line  51)
3516* mpz_sgn:                               Integer Comparisons. (line  28)
3517* mpz_si_kronecker:                      Number Theoretic Functions.
3518                                                              (line  90)
3519* mpz_size:                              Integer Special Functions.
3520                                                              (line  68)
3521* mpz_sizeinbase:                        Miscellaneous Integer Functions.
3522                                                              (line  23)
3523* mpz_sqrt:                              Integer Roots.       (line  17)
3524* mpz_sqrtrem:                           Integer Roots.       (line  20)
3525* mpz_sub:                               Integer Arithmetic.  (line  12)
3526* mpz_sub_ui:                            Integer Arithmetic.  (line  14)
3527* mpz_submul:                            Integer Arithmetic.  (line  30)
3528* mpz_submul_ui:                         Integer Arithmetic.  (line  32)
3529* mpz_swap:                              Assigning Integers.  (line  37)
3530* mpz_t:                                 Nomenclature and Types.
3531                                                              (line   6)
3532* mpz_tdiv_q:                            Integer Division.    (line  41)
3533* mpz_tdiv_q_2exp:                       Integer Division.    (line  52)
3534* mpz_tdiv_q_ui:                         Integer Division.    (line  45)
3535* mpz_tdiv_qr:                           Integer Division.    (line  43)
3536* mpz_tdiv_qr_ui:                        Integer Division.    (line  49)
3537* mpz_tdiv_r:                            Integer Division.    (line  42)
3538* mpz_tdiv_r_2exp:                       Integer Division.    (line  53)
3539* mpz_tdiv_r_ui:                         Integer Division.    (line  47)
3540* mpz_tdiv_ui:                           Integer Division.    (line  51)
3541* mpz_tstbit:                            Integer Logic and Bit Fiddling.
3542                                                              (line  60)
3543* mpz_ui_kronecker:                      Number Theoretic Functions.
3544                                                              (line  91)
3545* mpz_ui_pow_ui:                         Integer Exponentiation.
3546                                                              (line  33)
3547* mpz_ui_sub:                            Integer Arithmetic.  (line  16)
3548* mpz_urandomb:                          Integer Random Numbers.
3549                                                              (line  14)
3550* mpz_urandomm:                          Integer Random Numbers.
3551                                                              (line  23)
3552* mpz_xor:                               Integer Logic and Bit Fiddling.
3553                                                              (line  17)
3554* msqrt:                                 BSD Compatible Functions.
3555                                                              (line  63)
3556* msub:                                  BSD Compatible Functions.
3557                                                              (line  46)
3558* mtox:                                  BSD Compatible Functions.
3559                                                              (line  98)
3560* mult:                                  BSD Compatible Functions.
3561                                                              (line  49)
3562* operator%:                             C++ Interface Integers.
3563                                                              (line  30)
3564* operator/:                             C++ Interface Integers.
3565                                                              (line  29)
3566* operator<<:                            C++ Formatted Output.
3567                                                              (line  11)
3568* operator>> <1>:                        C++ Formatted Input. (line  11)
3569* operator>> <2>:                        C++ Interface Rationals.
3570                                                              (line  77)
3571* operator>>:                            C++ Formatted Input. (line  14)
3572* pow:                                   BSD Compatible Functions.
3573                                                              (line  71)
3574* rpow:                                  BSD Compatible Functions.
3575                                                              (line  79)
3576* sdiv:                                  BSD Compatible Functions.
3577                                                              (line  55)
3578* sgn <1>:                               C++ Interface Rationals.
3579                                                              (line  50)
3580* sgn <2>:                               C++ Interface Integers.
3581                                                              (line  57)
3582* sgn:                                   C++ Interface Floats.
3583                                                              (line  98)
3584* sqrt <1>:                              C++ Interface Floats.
3585                                                              (line  99)
3586* sqrt:                                  C++ Interface Integers.
3587                                                              (line  58)
3588* trunc:                                 C++ Interface Floats.
3589                                                              (line 100)
3590* xtom:                                  BSD Compatible Functions.
3591                                                              (line  34)
3592
3593
3594
3595
3596Local Variables:
3597coding: iso-8859-1
3598End:
3599