home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 46 75 6e 63 74 69 6f |\chapter|{Functio|
|00000010| 6e 73 20 61 6e 64 20 4f | 70 65 72 61 74 69 6f 6e |ns and O|peration|
|00000020| 73 20 61 76 61 69 6c 61 | 62 6c 65 20 69 6e 20 50 |s availa|ble in P|
|00000030| 41 52 49 20 61 6e 64 20 | 47 50 7d 0a 0a 54 68 65 |ARI and |GP}..The|
|00000040| 20 66 75 6e 63 74 69 6f | 6e 73 20 61 6e 64 20 6f | functio|ns and o|
|00000050| 70 65 72 61 74 6f 72 73 | 20 61 76 61 69 6c 61 62 |perators| availab|
|00000060| 6c 65 20 69 6e 20 50 41 | 52 49 20 61 6e 64 20 69 |le in PA|RI and i|
|00000070| 6e 20 74 68 65 20 47 50 | 2f 50 41 52 49 20 63 61 |n the GP|/PARI ca|
|00000080| 6c 63 75 6c 61 74 6f 72 | 0a 61 72 65 20 6e 75 6d |lculator|.are num|
|00000090| 65 72 6f 75 73 20 61 6e | 64 20 65 76 65 72 65 78 |erous an|d everex|
|000000a0| 70 61 6e 64 69 6e 67 2e | 20 48 65 72 65 20 69 73 |panding.| Here is|
|000000b0| 20 61 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f | a descr|iption o|
|000000c0| 66 20 74 68 65 20 6f 6e | 65 73 20 61 76 61 69 6c |f the on|es avail|
|000000d0| 61 62 6c 65 0a 69 6e 20 | 76 65 72 73 69 6f 6e 20 |able.in |version |
|000000e0| 31 2e 33 35 2e 20 49 74 | 20 73 68 6f 75 6c 64 20 |1.35. It| should |
|000000f0| 62 65 20 6e 6f 74 65 64 | 20 74 68 61 74 20 6d 61 |be noted| that ma|
|00000100| 6e 79 20 6f 66 20 74 68 | 65 73 65 20 66 75 6e 63 |ny of th|ese func|
|00000110| 74 69 6f 6e 73 20 61 63 | 63 65 70 74 0a 71 75 69 |tions ac|cept.qui|
|00000120| 74 65 20 64 69 66 66 65 | 72 65 6e 74 20 74 79 70 |te diffe|rent typ|
|00000130| 65 73 20 61 73 20 61 72 | 67 75 6d 65 6e 74 73 2c |es as ar|guments,|
|00000140| 20 62 75 74 20 6f 74 68 | 65 72 73 20 61 72 65 20 | but oth|ers are |
|00000150| 6d 6f 72 65 20 72 65 73 | 74 72 69 63 74 65 64 2e |more res|tricted.|
|00000160| 20 54 68 65 20 6c 69 73 | 74 0a 6f 66 20 61 63 63 | The lis|t.of acc|
|00000170| 65 70 74 61 62 6c 65 20 | 74 79 70 65 73 20 77 69 |eptable |types wi|
|00000180| 6c 6c 20 62 65 20 67 69 | 76 65 6e 20 66 6f 72 20 |ll be gi|ven for |
|00000190| 65 61 63 68 20 66 75 6e | 63 74 69 6f 6e 20 6f 72 |each fun|ction or|
|000001a0| 20 63 6c 61 73 73 20 6f | 66 20 66 75 6e 63 74 69 | class o|f functi|
|000001b0| 6f 6e 73 2e 0a 45 78 63 | 65 70 74 20 77 68 65 6e |ons..Exc|ept when|
|000001c0| 20 73 74 61 74 65 64 20 | 6f 74 68 65 72 77 69 73 | stated |otherwis|
|000001d0| 65 2c 20 69 74 20 69 73 | 20 75 6e 64 65 72 73 74 |e, it is| underst|
|000001e0| 6f 6f 64 20 74 68 61 74 | 20 61 20 66 75 6e 63 74 |ood that| a funct|
|000001f0| 69 6f 6e 20 6f 72 20 6f | 70 65 72 61 74 69 6f 6e |ion or o|peration|
|00000200| 0a 77 68 69 63 68 20 73 | 68 6f 75 6c 64 20 6d 61 |.which s|hould ma|
|00000210| 6b 65 20 6e 61 74 75 72 | 61 6c 20 73 65 6e 73 65 |ke natur|al sense|
|00000220| 20 69 73 20 6c 65 67 61 | 6c 2e 0a 49 6e 20 74 68 | is lega|l..In th|
|00000230| 69 73 20 63 68 61 70 74 | 65 72 2c 20 77 65 20 77 |is chapt|er, we w|
|00000240| 69 6c 6c 20 64 65 73 63 | 72 69 62 65 20 74 68 65 |ill desc|ribe the|
|00000250| 20 66 75 6e 63 74 69 6f | 6e 73 20 61 63 63 6f 72 | functio|ns accor|
|00000260| 64 69 6e 67 20 74 6f 20 | 61 20 72 6f 75 67 68 0a |ding to |a rough.|
|00000270| 63 6c 61 73 73 69 66 69 | 63 61 74 69 6f 6e 2e 20 |classifi|cation. |
|00000280| 46 6f 72 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |For the |function|
|00000290| 73 20 69 6e 20 61 6c 70 | 68 61 62 65 74 69 63 61 |s in alp|habetica|
|000002a0| 6c 20 6f 72 64 65 72 2c | 20 73 65 65 20 74 68 65 |l order,| see the|
|000002b0| 20 67 65 6e 65 72 61 6c | 20 0a 69 6e 64 65 78 2e | general| .index.|
|000002c0| 0a 0a 5c 73 65 63 74 69 | 6f 6e 7b 53 74 61 6e 64 |..\secti|on{Stand|
|000002d0| 61 72 64 20 6d 6f 6e 61 | 64 69 63 20 6f 72 20 64 |ard mona|dic or d|
|000002e0| 79 61 64 69 63 20 6f 70 | 65 72 61 74 6f 72 73 2e |yadic op|erators.|
|000002f0| 7d 0a 0a 5c 73 75 62 73 | 65 63 7b 24 5c 70 6d 24 |}..\subs|ec{$\pm$|
|00000300| 7d 20 24 2b 78 24 20 61 | 6e 64 20 24 2d 78 24 20 |} $+x$ a|nd $-x$ |
|00000310| 72 65 66 65 72 20 74 6f | 20 6d 6f 6e 61 64 69 63 |refer to| monadic|
|00000320| 20 6f 70 65 72 61 74 6f | 72 73 0a 28 24 2b 78 24 | operato|rs.($+x$|
|00000330| 20 64 6f 65 73 20 6e 6f | 74 68 69 6e 67 20 61 6e | does no|thing an|
|00000340| 64 20 24 2d 78 24 20 6e | 65 67 61 74 65 73 20 24 |d $-x$ n|egates $|
|00000350| 78 24 29 2e 0a 0a 54 68 | 65 20 6c 69 62 72 61 72 |x$)...Th|e librar|
|00000360| 79 20 73 79 6e 74 61 78 | 20 69 73 20 24 5c 74 65 |y syntax| is $\te|
|00000370| 62 7b 67 6e 65 67 7d 28 | 78 29 24 20 66 6f 72 20 |b{gneg}(|x)$ for |
|00000380| 24 2d 78 24 2e 0a 0a 5c | 73 75 62 73 65 63 7b 24 |$-x$...\|subsec{$|
|00000390| 2b 24 2c 20 24 2d 24 7d | 20 24 78 2b 79 24 20 61 |+$, $-$}| $x+y$ a|
|000003a0| 6e 64 20 24 78 2d 79 24 | 20 61 72 65 20 74 68 65 |nd $x-y$| are the|
|000003b0| 20 5c 72 65 66 7b 73 75 | 6d 7d 20 61 6e 64 20 5c | \ref{su|m} and \|
|000003c0| 72 65 66 7b 64 69 66 66 | 65 72 65 6e 63 65 7d 20 |ref{diff|erence} |
|000003d0| 6f 66 20 24 78 24 20 61 | 6e 64 20 24 79 24 2e 0a |of $x$ a|nd $y$..|
|000003e0| 41 6d 6f 6e 67 20 74 68 | 65 20 70 72 6f 6d 69 6e |Among th|e promin|
|000003f0| 65 6e 74 20 69 6d 70 6f | 73 73 69 62 69 6c 69 74 |ent impo|ssibilit|
|00000400| 69 65 73 20 61 72 65 20 | 61 64 64 69 74 69 6f 6e |ies are |addition|
|00000410| 2f 73 75 62 74 72 61 63 | 74 69 6f 6e 20 62 65 74 |/subtrac|tion bet|
|00000420| 77 65 65 6e 20 61 20 73 | 63 61 6c 61 72 0a 74 79 |ween a s|calar.ty|
|00000430| 70 65 20 61 6e 64 20 61 | 20 76 65 63 74 6f 72 20 |pe and a| vector |
|00000440| 6f 72 20 61 20 6d 61 74 | 72 69 78 2c 20 62 65 74 |or a mat|rix, bet|
|00000450| 77 65 65 6e 20 76 65 63 | 74 6f 72 2f 6d 61 74 72 |ween vec|tor/matr|
|00000460| 69 63 65 73 20 6f 66 20 | 69 6e 63 6f 6d 70 61 74 |ices of |incompat|
|00000470| 69 62 6c 65 20 73 69 7a | 65 73 0a 61 6e 64 20 62 |ible siz|es.and b|
|00000480| 65 74 77 65 65 6e 20 61 | 6e 20 69 6e 74 65 67 65 |etween a|n intege|
|00000490| 72 6d 6f 64 20 61 6e 64 | 20 61 20 72 65 61 6c 20 |rmod and| a real |
|000004a0| 6e 75 6d 62 65 72 2e 0a | 0a 54 68 65 20 6c 69 62 |number..|.The lib|
|000004b0| 72 61 72 79 20 73 79 6e | 74 61 78 20 69 73 20 24 |rary syn|tax is $|
|000004c0| 5c 74 65 62 7b 67 61 64 | 64 7d 20 28 20 78 2c 20 |\teb{gad|d} ( x, |
|000004d0| 79 20 29 24 20 66 6f 72 | 20 24 78 2b 79 24 2c 20 |y )$ for| $x+y$, |
|000004e0| 24 5c 74 65 62 7b 67 73 | 75 62 7d 20 28 20 78 2c |$\teb{gs|ub} ( x,|
|000004f0| 20 79 20 29 24 0a 66 6f | 72 20 24 78 2d 79 24 2e | y )$.fo|r $x-y$.|
|00000500| 0a 0a 5c 73 75 62 73 65 | 63 7b 24 2a 24 7d 20 24 |..\subse|c{$*$} $|
|00000510| 78 2a 79 24 20 69 73 20 | 74 68 65 20 5c 72 65 66 |x*y$ is |the \ref|
|00000520| 7b 70 72 6f 64 75 63 74 | 7d 20 6f 66 20 24 78 24 |{product|} of $x$|
|00000530| 20 61 6e 64 20 24 79 24 | 2e 20 41 6d 6f 6e 67 20 | and $y$|. Among |
|00000540| 74 68 65 0a 70 72 6f 6d | 69 6e 65 6e 74 20 69 6d |the.prom|inent im|
|00000550| 70 6f 73 73 69 62 69 6c | 69 74 69 65 73 20 61 72 |possibil|ities ar|
|00000560| 65 20 6d 75 6c 74 69 70 | 6c 69 63 61 74 69 6f 6e |e multip|lication|
|00000570| 20 62 65 74 77 65 65 6e | 20 76 65 63 74 6f 72 2f | between| vector/|
|00000580| 6d 61 74 72 69 63 65 73 | 20 6f 66 0a 69 6e 63 6f |matrices| of.inco|
|00000590| 6d 70 61 74 69 62 6c 65 | 20 73 69 7a 65 73 2c 20 |mpatible| sizes, |
|000005a0| 62 65 74 77 65 65 6e 20 | 61 6e 20 69 6e 74 65 67 |between |an integ|
|000005b0| 65 72 6d 6f 64 20 61 6e | 64 20 61 20 72 65 61 6c |ermod an|d a real|
|000005c0| 20 6e 75 6d 62 65 72 2e | 20 4e 6f 74 65 0a 74 68 | number.| Note.th|
|000005d0| 61 74 20 62 65 63 61 75 | 73 65 20 6f 66 20 76 65 |at becau|se of ve|
|000005e0| 63 74 6f 72 20 61 6e 64 | 20 6d 61 74 72 69 78 20 |ctor and| matrix |
|000005f0| 6f 70 65 72 61 74 69 6f | 6e 73 2c 20 24 2a 24 20 |operatio|ns, $*$ |
|00000600| 69 73 20 6e 6f 74 20 6e | 65 63 65 73 73 61 72 69 |is not n|ecessari|
|00000610| 6c 79 0a 63 6f 6d 6d 75 | 74 61 74 69 76 65 2e 20 |ly.commu|tative. |
|00000620| 4e 6f 74 65 20 61 6c 73 | 6f 20 74 68 61 74 20 73 |Note als|o that s|
|00000630| 69 6e 63 65 20 6d 75 6c | 74 69 70 6c 69 63 61 74 |ince mul|tiplicat|
|00000640| 69 6f 6e 20 62 65 74 77 | 65 65 6e 20 74 77 6f 20 |ion betw|een two |
|00000650| 63 6f 6c 75 6d 6e 20 6f | 72 20 74 77 6f 0a 72 6f |column o|r two.ro|
|00000660| 77 0a 76 65 63 74 6f 72 | 73 20 69 73 20 6e 6f 74 |w.vector|s is not|
|00000670| 20 61 6c 6c 6f 77 65 64 | 2c 20 74 6f 20 6f 62 74 | allowed|, to obt|
|00000680| 61 69 6e 20 74 68 65 20 | 5c 72 65 66 7b 73 63 61 |ain the |\ref{sca|
|00000690| 6c 61 72 20 70 72 6f 64 | 75 63 74 7d 20 6f 66 20 |lar prod|uct} of |
|000006a0| 74 77 6f 20 76 65 63 74 | 6f 72 73 20 6f 66 20 74 |two vect|ors of t|
|000006b0| 68 65 0a 73 61 6d 65 0a | 6c 65 6e 67 74 68 2c 20 |he.same.|length, |
|000006c0| 79 6f 75 20 6d 75 73 74 | 20 6d 75 6c 74 69 70 6c |you must| multipl|
|000006d0| 79 20 61 20 6c 69 6e 65 | 20 76 65 63 74 6f 72 20 |y a line| vector |
|000006e0| 62 79 20 61 20 63 6f 6c | 75 6d 6e 20 76 65 63 74 |by a col|umn vect|
|000006f0| 6f 72 2c 20 69 66 20 6e | 65 63 65 73 73 61 72 79 |or, if n|ecessary|
|00000700| 20 62 79 0a 74 72 61 6e | 73 70 6f 73 69 6e 67 20 | by.tran|sposing |
|00000710| 6f 6e 65 20 6f 66 20 74 | 68 65 20 76 65 63 74 6f |one of t|he vecto|
|00000720| 72 73 20 28 75 73 69 6e | 67 20 7b 5c 74 74 20 5c |rs (usin|g {\tt \|
|00000730| 7e 7b 7d 7d 20 6f 72 20 | 7b 5c 74 74 20 74 72 61 |~{}} or |{\tt tra|
|00000740| 6e 73 24 28 5c 2c 29 24 | 7d 2c 20 73 65 65 20 33 |ns$(\,)$|}, see 3|
|00000750| 2e 37 2e 33 30 29 2e 0a | 0a 54 68 65 20 6c 69 62 |.7.30)..|.The lib|
|00000760| 72 61 72 79 20 73 79 6e | 74 61 78 20 69 73 20 24 |rary syn|tax is $|
|00000770| 5c 74 65 62 7b 67 6d 75 | 6c 7d 20 28 20 78 2c 20 |\teb{gmu|l} ( x, |
|00000780| 79 20 29 24 20 66 6f 72 | 20 24 78 2a 79 24 2e 0a |y )$ for| $x*y$..|
|00000790| 0a 5c 73 75 62 73 65 63 | 7b 24 2f 24 7d 20 24 78 |.\subsec|{$/$} $x|
|000007a0| 2f 79 24 20 69 73 20 74 | 68 65 20 5c 72 65 66 7b |/y$ is t|he \ref{|
|000007b0| 71 75 6f 74 69 65 6e 74 | 7d 20 6f 66 20 24 78 24 |quotient|} of $x$|
|000007c0| 20 61 6e 64 20 24 79 24 | 2e 20 49 6e 20 61 64 64 | and $y$|. In add|
|000007d0| 69 74 69 6f 6e 20 74 6f | 20 74 68 65 0a 69 6d 70 |ition to| the.imp|
|000007e0| 6f 73 73 69 62 69 6c 69 | 74 69 65 73 20 66 6f 72 |ossibili|ties for|
|000007f0| 20 6d 75 6c 74 69 70 6c | 69 63 61 74 69 6f 6e 2c | multipl|ication,|
|00000800| 20 6e 6f 74 65 20 74 68 | 61 74 20 69 66 20 74 68 | note th|at if th|
|00000810| 65 20 64 69 76 69 73 6f | 72 20 69 73 20 61 20 6d |e diviso|r is a m|
|00000820| 61 74 72 69 78 2c 20 69 | 74 0a 6d 75 73 74 20 62 |atrix, i|t.must b|
|00000830| 65 20 61 6e 20 69 6e 76 | 65 72 74 69 62 6c 65 20 |e an inv|ertible |
|00000840| 73 71 75 61 72 65 20 6d | 61 74 72 69 78 2c 20 61 |square m|atrix, a|
|00000850| 6e 64 20 69 6e 20 74 68 | 61 74 20 63 61 73 65 20 |nd in th|at case |
|00000860| 74 68 65 20 72 65 73 75 | 6c 74 20 69 73 20 24 78 |the resu|lt is $x|
|00000870| 2a 79 5e 7b 2d 31 7d 24 | 2e 0a 46 75 72 74 68 65 |*y^{-1}$|..Furthe|
|00000880| 72 6d 6f 72 65 20 6e 6f | 74 65 20 74 68 61 74 20 |rmore no|te that |
|00000890| 74 68 65 20 72 65 73 75 | 6c 74 20 69 73 20 61 73 |the resu|lt is as|
|000008a0| 0a 65 78 61 63 74 20 61 | 73 20 70 6f 73 73 69 62 |.exact a|s possib|
|000008b0| 6c 65 3a 20 69 6e 20 70 | 61 72 74 69 63 75 6c 61 |le: in p|articula|
|000008c0| 72 2c 20 64 69 76 69 73 | 69 6f 6e 20 6f 66 20 74 |r, divis|ion of t|
|000008d0| 77 6f 20 69 6e 74 65 67 | 65 72 73 20 61 6c 77 61 |wo integ|ers alwa|
|000008e0| 79 73 20 67 69 76 65 73 | 20 61 0a 72 61 74 69 6f |ys gives| a.ratio|
|000008f0| 6e 61 6c 20 6e 75 6d 62 | 65 72 20 28 77 68 69 63 |nal numb|er (whic|
|00000900| 68 20 6d 61 79 20 62 65 | 20 61 6e 20 69 6e 74 65 |h may be| an inte|
|00000910| 67 65 72 20 69 66 20 74 | 68 65 20 71 75 6f 74 69 |ger if t|he quoti|
|00000920| 65 6e 74 20 69 73 20 65 | 78 61 63 74 29 20 61 6e |ent is e|xact) an|
|00000930| 64 20 7b 5c 73 6c 0a 6e | 6f 74 5c 2f 7d 20 74 68 |d {\sl.n|ot\/} th|
|00000940| 65 20 65 75 63 6c 69 64 | 65 61 6e 20 71 75 6f 74 |e euclid|ean quot|
|00000950| 69 65 6e 74 20 28 73 65 | 65 20 24 78 5c 62 61 63 |ient (se|e $x\bac|
|00000960| 6b 73 6c 61 73 68 20 79 | 24 20 66 6f 72 20 74 68 |kslash y|$ for th|
|00000970| 61 74 29 2c 20 61 6e 64 | 20 73 69 6d 69 6c 61 72 |at), and| similar|
|00000980| 6c 79 20 74 68 65 0a 71 | 75 6f 74 69 65 6e 74 20 |ly the.q|uotient |
|00000990| 6f 66 20 74 77 6f 20 70 | 6f 6c 79 6e 6f 6d 69 61 |of two p|olynomia|
|000009a0| 6c 73 20 69 73 20 61 20 | 72 61 74 69 6f 6e 61 6c |ls is a |rational|
|000009b0| 20 66 75 6e 63 74 69 6f | 6e 20 69 6e 20 67 65 6e | functio|n in gen|
|000009c0| 65 72 61 6c 2e 20 54 6f | 20 6f 62 74 61 69 6e 20 |eral. To| obtain |
|000009d0| 74 68 65 0a 61 70 70 72 | 6f 78 69 6d 61 74 65 20 |the.appr|oximate |
|000009e0| 72 65 61 6c 20 76 61 6c | 75 65 20 6f 66 20 74 68 |real val|ue of th|
|000009f0| 65 20 71 75 6f 74 69 65 | 6e 74 20 6f 66 20 74 77 |e quotie|nt of tw|
|00000a00| 6f 20 69 6e 74 65 67 65 | 72 73 2c 20 61 64 64 20 |o intege|rs, add |
|00000a10| 24 30 2e 24 20 74 6f 20 | 74 68 65 0a 72 65 73 75 |$0.$ to |the.resu|
|00000a20| 6c 74 3b 20 74 6f 20 6f | 62 74 61 69 6e 20 74 68 |lt; to o|btain th|
|00000a30| 65 20 61 70 70 72 6f 78 | 69 6d 61 74 65 20 24 70 |e approx|imate $p|
|00000a40| 24 2d 61 64 69 63 20 76 | 61 6c 75 65 20 6f 66 20 |$-adic v|alue of |
|00000a50| 74 68 65 20 71 75 6f 74 | 69 65 6e 74 20 6f 66 20 |the quot|ient of |
|00000a60| 74 77 6f 0a 69 6e 74 65 | 67 65 72 73 2c 20 61 64 |two.inte|gers, ad|
|00000a70| 64 20 24 4f 28 70 5e 6b | 29 24 20 74 6f 20 74 68 |d $O(p^k|)$ to th|
|00000a80| 65 20 72 65 73 75 6c 74 | 3b 20 66 69 6e 61 6c 6c |e result|; finall|
|00000a90| 79 2c 0a 74 6f 20 6f 62 | 74 61 69 6e 20 74 68 65 |y,.to ob|tain the|
|00000aa0| 20 5c 72 65 66 7b 74 61 | 79 6c 6f 72 20 73 65 72 | \ref{ta|ylor ser|
|00000ab0| 69 65 73 7d 20 65 78 70 | 61 6e 73 69 6f 6e 20 6f |ies} exp|ansion o|
|00000ac0| 66 20 74 68 65 20 71 75 | 6f 74 69 65 6e 74 20 6f |f the qu|otient o|
|00000ad0| 66 20 74 77 6f 20 70 6f | 6c 79 6e 6f 6d 69 61 6c |f two po|lynomial|
|00000ae0| 73 2c 0a 61 64 64 20 24 | 4f 28 58 5c 68 61 74 7b |s,.add $|O(X\hat{|
|00000af0| 5c 20 7d 6b 29 24 20 74 | 6f 20 74 68 65 20 72 65 |\ }k)$ t|o the re|
|00000b00| 73 75 6c 74 20 6f 72 20 | 75 73 65 20 74 68 65 20 |sult or |use the |
|00000b10| 7b 5c 74 74 20 74 61 79 | 6c 6f 72 7d 20 66 75 6e |{\tt tay|lor} fun|
|00000b20| 63 74 69 6f 6e 20 28 33 | 2e 36 2e 33 33 29 2e 0a |ction (3|.6.33)..|
|00000b30| 0a 54 68 65 20 6c 69 62 | 72 61 72 79 20 73 79 6e |.The lib|rary syn|
|00000b40| 74 61 78 20 69 73 20 24 | 5c 74 65 62 7b 67 64 69 |tax is $|\teb{gdi|
|00000b50| 76 7d 20 28 20 78 2c 20 | 79 20 29 24 20 66 6f 72 |v} ( x, |y )$ for|
|00000b60| 20 24 78 2f 79 24 2e 0a | 0a 5c 73 75 62 73 65 63 | $x/y$..|.\subsec|
|00000b70| 7b 24 5c 62 61 63 6b 73 | 6c 61 73 68 24 7d 20 24 |{$\backs|lash$} $|
|00000b80| 78 5c 62 61 63 6b 73 6c | 61 73 68 20 79 24 20 69 |x\backsl|ash y$ i|
|00000b90| 73 20 74 68 65 20 5c 72 | 65 66 7b 65 75 63 6c 69 |s the \r|ef{eucli|
|00000ba0| 64 65 61 6e 20 71 75 6f | 74 69 65 6e 74 7d 20 6f |dean quo|tient} o|
|00000bb0| 66 20 24 78 24 20 61 6e | 64 20 24 79 24 2e 0a 54 |f $x$ an|d $y$..T|
|00000bc0| 68 65 20 74 79 70 65 73 | 20 6d 75 73 74 20 62 65 |he types| must be|
|00000bd0| 20 65 69 74 68 65 72 0a | 62 6f 74 68 20 69 6e 74 | either.|both int|
|00000be0| 65 67 65 72 20 6f 72 20 | 62 6f 74 68 20 70 6f 6c |eger or |both pol|
|00000bf0| 79 6e 6f 6d 69 61 6c 73 | 2e 20 54 68 65 20 72 65 |ynomials|. The re|
|00000c00| 73 75 6c 74 20 69 73 20 | 74 68 65 20 65 75 63 6c |sult is |the eucl|
|00000c10| 69 64 65 61 6e 20 71 75 | 6f 74 69 65 6e 74 2e 0a |idean qu|otient..|
|00000c20| 49 6e 20 74 68 65 20 63 | 61 73 65 20 6f 66 20 69 |In the c|ase of i|
|00000c30| 6e 74 65 67 65 72 20 64 | 69 76 69 73 69 6f 6e 2c |nteger d|ivision,|
|00000c40| 20 74 68 65 20 71 75 6f | 74 69 65 6e 74 20 69 73 | the quo|tient is|
|00000c50| 20 73 75 63 68 20 74 68 | 61 74 20 74 68 65 20 63 | such th|at the c|
|00000c60| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 0a 72 65 6d |orrespon|ding.rem|
|00000c70| 61 69 6e 64 65 72 20 69 | 73 20 6e 6f 6e 6e 65 67 |ainder i|s nonneg|
|00000c80| 61 74 69 76 65 2e 0a 0a | 54 68 65 20 6c 69 62 72 |ative...|The libr|
|00000c90| 61 72 79 20 73 79 6e 74 | 61 78 20 69 73 20 24 5c |ary synt|ax is $\|
|00000ca0| 74 65 62 7b 67 64 69 76 | 65 6e 74 7d 20 28 20 78 |teb{gdiv|ent} ( x|
|00000cb0| 2c 20 79 20 29 24 20 66 | 6f 72 20 24 78 5c 62 61 |, y )$ f|or $x\ba|
|00000cc0| 63 6b 73 6c 61 73 68 20 | 79 24 2e 0a 0a 5c 73 75 |ckslash |y$...\su|
|00000cd0| 62 73 65 63 7b 24 5c 25 | 24 7d 20 24 78 5c 25 79 |bsec{$\%|$} $x\%y|
|00000ce0| 24 20 69 73 20 74 68 65 | 20 5c 72 65 66 7b 65 75 |$ is the| \ref{eu|
|00000cf0| 63 6c 69 64 65 61 6e 20 | 72 65 6d 61 69 6e 64 65 |clidean |remainde|
|00000d00| 72 7d 20 6f 66 20 24 78 | 24 20 61 6e 64 20 24 79 |r} of $x|$ and $y|
|00000d10| 24 2e 20 54 68 65 20 0a | 6d 6f 64 75 6c 75 73 20 |$. The .|modulus |
|00000d20| 24 79 24 20 6d 75 73 74 | 20 62 65 20 6f 66 20 74 |$y$ must| be of t|
|00000d30| 79 70 65 20 69 6e 74 65 | 67 65 72 20 6f 72 20 70 |ype inte|ger or p|
|00000d40| 6f 6c 79 6e 6f 6d 69 61 | 6c 2e 0a 54 68 65 20 72 |olynomia|l..The r|
|00000d50| 65 73 75 6c 74 20 69 73 | 20 74 68 65 20 72 65 6d |esult is| the rem|
|00000d60| 61 69 6e 64 65 72 2c 20 | 61 6c 77 61 79 73 20 6e |ainder, |always n|
|00000d70| 6f 6e 6e 65 67 61 74 69 | 76 65 0a 69 6e 20 74 68 |onnegati|ve.in th|
|00000d80| 65 20 63 61 73 65 20 6f | 66 20 69 6e 74 65 67 65 |e case o|f intege|
|00000d90| 72 73 2e 20 41 6c 6c 6f | 77 65 64 20 64 69 76 69 |rs. Allo|wed divi|
|00000da0| 64 65 6e 64 20 74 79 70 | 65 73 20 61 72 65 20 73 |dend typ|es are s|
|00000db0| 63 61 6c 61 72 20 65 78 | 61 63 74 20 74 79 70 65 |calar ex|act type|
|00000dc0| 73 20 77 68 65 6e 0a 74 | 68 65 20 6d 6f 64 75 6c |s when.t|he modul|
|00000dd0| 75 73 20 69 73 20 61 6e | 20 69 6e 74 65 67 65 72 |us is an| integer|
|00000de0| 2c 20 61 6e 64 20 70 6f | 6c 79 6e 6f 6d 69 61 6c |, and po|lynomial|
|00000df0| 73 2c 20 70 6f 6c 79 6d | 6f 64 73 20 61 6e 64 20 |s, polym|ods and |
|00000e00| 72 61 74 69 6f 6e 61 6c | 20 66 75 6e 63 74 69 6f |rational| functio|
|00000e10| 6e 73 0a 77 68 65 6e 20 | 74 68 65 20 6d 6f 64 75 |ns.when |the modu|
|00000e20| 6c 75 73 20 69 73 20 61 | 20 70 6f 6c 79 6e 6f 6d |lus is a| polynom|
|00000e30| 69 61 6c 2e 0a 0a 54 68 | 65 20 6c 69 62 72 61 72 |ial...Th|e librar|
|00000e40| 79 20 73 79 6e 74 61 78 | 20 69 73 20 24 5c 74 65 |y syntax| is $\te|
|00000e50| 62 7b 67 6d 6f 64 7d 20 | 28 20 78 2c 20 79 20 29 |b{gmod} |( x, y )|
|00000e60| 24 20 66 6f 72 20 24 78 | 5c 25 79 24 2e 0a 0a 5c |$ for $x|\%y$...\|
|00000e70| 73 75 62 73 65 63 7b 5c | 72 65 66 7b 64 69 76 72 |subsec{\|ref{divr|
|00000e80| 65 73 7d 7d 24 28 20 78 | 2c 20 79 20 29 24 20 63 |es}}$( x|, y )$ c|
|00000e90| 72 65 61 74 65 73 20 61 | 20 76 65 63 74 6f 72 20 |reates a| vector |
|00000ea0| 77 69 74 68 20 74 77 6f | 20 63 6f 6d 70 6f 6e 65 |with two| compone|
|00000eb0| 6e 74 73 2c 0a 74 68 65 | 20 66 69 72 73 74 20 62 |nts,.the| first b|
|00000ec0| 65 69 6e 67 20 74 68 65 | 20 65 75 63 6c 69 64 65 |eing the| euclide|
|00000ed0| 61 6e 20 71 75 6f 74 69 | 65 6e 74 2c 20 74 68 65 |an quoti|ent, the|
|00000ee0| 20 73 65 63 6f 6e 64 20 | 74 68 65 20 65 75 63 6c | second |the eucl|
|00000ef0| 69 64 65 61 6e 20 72 65 | 6d 61 69 6e 64 65 72 2c |idean re|mainder,|
|00000f00| 0a 6f 66 20 74 68 65 20 | 64 69 76 69 73 69 6f 6e |.of the |division|
|00000f10| 20 6f 66 20 24 78 24 20 | 62 79 20 24 79 24 2e 20 | of $x$ |by $y$. |
|00000f20| 54 68 69 73 20 61 76 6f | 69 64 73 20 74 68 65 20 |This avo|ids the |
|00000f30| 6e 65 65 64 20 74 6f 20 | 64 6f 20 74 77 6f 20 64 |need to |do two d|
|00000f40| 69 76 69 73 69 6f 6e 73 | 20 69 66 0a 6f 6e 65 20 |ivisions| if.one |
|00000f50| 6e 65 65 64 73 20 62 6f | 74 68 20 74 68 65 20 71 |needs bo|th the q|
|00000f60| 75 6f 74 69 65 6e 74 20 | 61 6e 64 20 74 68 65 20 |uotient |and the |
|00000f70| 72 65 6d 61 69 6e 64 65 | 72 2e 20 54 68 65 20 61 |remainde|r. The a|
|00000f80| 72 67 75 6d 65 6e 74 73 | 20 6d 75 73 74 20 62 65 |rguments| must be|
|00000f90| 20 62 6f 74 68 0a 69 6e | 74 65 67 65 72 73 20 6f | both.in|tegers o|
|00000fa0| 72 20 62 6f 74 68 20 70 | 6f 6c 79 6e 6f 6d 69 61 |r both p|olynomia|
|00000fb0| 6c 73 2c 20 61 6e 64 20 | 69 6e 20 74 68 65 20 63 |ls, and |in the c|
|00000fc0| 61 73 65 20 6f 66 20 69 | 6e 74 65 67 65 72 73 20 |ase of i|ntegers |
|00000fd0| 74 68 65 20 72 65 6d 61 | 69 6e 64 65 72 0a 69 73 |the rema|inder.is|
|00000fe0| 20 61 6c 77 61 79 73 20 | 6e 6f 6e 6e 65 67 61 74 | always |nonnegat|
|00000ff0| 69 76 65 2e 0a 0a 54 68 | 65 20 6c 69 62 72 61 72 |ive...Th|e librar|
|00001000| 79 20 73 79 6e 74 61 78 | 20 69 73 20 24 5c 74 65 |y syntax| is $\te|
|00001010| 62 7b 67 64 69 76 65 6e | 74 72 65 73 7d 20 28 20 |b{gdiven|tres} ( |
|00001020| 78 2c 20 79 20 29 24 2e | 0a 0a 5c 73 75 62 73 65 |x, y )$.|..\subse|
|00001030| 63 7b 24 5c 68 61 74 7b | 7d 24 7d 20 24 78 5c 68 |c{$\hat{|}$} $x\h|
|00001040| 61 74 7b 5c 20 7d 79 24 | 20 69 73 20 5c 72 65 66 |at{\ }y$| is \ref|
|00001050| 7b 70 6f 77 65 72 69 6e | 67 7d 2e 20 49 66 20 74 |{powerin|g}. If t|
|00001060| 68 65 20 65 78 70 6f 6e | 65 6e 74 20 69 73 20 61 |he expon|ent is a|
|00001070| 6e 20 69 6e 74 65 67 65 | 72 2c 0a 74 68 65 6e 20 |n intege|r,.then |
|00001080| 65 78 61 63 74 0a 6f 70 | 65 72 61 74 69 6f 6e 73 |exact.op|erations|
|00001090| 20 61 72 65 20 70 65 72 | 66 6f 72 6d 65 64 20 75 | are per|formed u|
|000010a0| 73 69 6e 67 20 62 69 6e | 61 72 79 20 70 6f 77 65 |sing bin|ary powe|
|000010b0| 72 69 6e 67 20 74 65 63 | 68 6e 69 71 75 65 73 2e |ring tec|hniques.|
|000010c0| 20 49 6e 20 70 61 72 74 | 69 63 75 6c 61 72 2c 20 | In part|icular, |
|000010d0| 69 6e 0a 74 68 69 73 20 | 63 61 73 65 0a 74 68 65 |in.this |case.the|
|000010e0| 20 66 69 72 73 74 20 61 | 72 67 75 6d 65 6e 74 20 | first a|rgument |
|000010f0| 63 61 6e 6e 6f 74 20 62 | 65 20 61 20 76 65 63 74 |cannot b|e a vect|
|00001100| 6f 72 20 6f 72 20 6d 61 | 74 72 69 78 20 75 6e 6c |or or ma|trix unl|
|00001110| 65 73 73 20 69 74 20 69 | 73 20 61 20 73 71 75 61 |ess it i|s a squa|
|00001120| 72 65 20 6d 61 74 72 69 | 78 0a 28 61 6e 64 20 6d |re matri|x.(and m|
|00001130| 6f 72 65 6f 76 65 72 20 | 69 6e 76 65 72 74 69 62 |oreover |invertib|
|00001140| 6c 65 20 69 66 20 74 68 | 65 20 65 78 70 6f 6e 65 |le if th|e expone|
|00001150| 6e 74 20 69 73 20 6e 65 | 67 61 74 69 76 65 29 2e |nt is ne|gative).|
|00001160| 20 49 66 20 74 68 65 20 | 65 78 70 6f 6e 65 6e 74 | If the |exponent|
|00001170| 20 69 73 0a 6e 6f 74 20 | 6f 66 20 74 79 70 65 20 | is.not |of type |
|00001180| 69 6e 74 65 67 65 72 2c | 20 74 68 69 73 20 69 73 |integer,| this is|
|00001190| 20 74 72 65 61 74 65 64 | 20 61 73 20 61 20 74 72 | treated| as a tr|
|000011a0| 61 6e 73 63 65 6e 64 65 | 6e 74 61 6c 20 66 75 6e |anscende|ntal fun|
|000011b0| 63 74 69 6f 6e 20 28 73 | 65 65 20 33 2e 33 2e 31 |ction (s|ee 3.3.1|
|000011c0| 2e 29 2c 0a 61 6e 64 20 | 69 6e 20 70 61 72 74 69 |.),.and |in parti|
|000011d0| 63 75 6c 61 72 20 68 61 | 73 20 74 68 65 20 65 66 |cular ha|s the ef|
|000011e0| 66 65 63 74 20 6f 66 20 | 63 6f 6d 70 6f 6e 65 6e |fect of |componen|
|000011f0| 74 77 69 73 65 20 70 6f | 77 65 72 69 6e 67 20 6f |twise po|wering o|
|00001200| 6e 20 76 65 63 74 6f 72 | 20 6f 72 0a 6d 61 74 72 |n vector| or.matr|
|00001210| 69 63 65 73 2e 0a 0a 54 | 68 65 20 6c 69 62 72 61 |ices...T|he libra|
|00001220| 72 79 20 73 79 6e 74 61 | 78 20 69 73 20 24 5c 74 |ry synta|x is $\t|
|00001230| 65 62 7b 67 70 75 69 7d | 20 28 20 78 2c 20 79 20 |eb{gpui}| ( x, y |
|00001240| 29 24 20 66 6f 72 20 24 | 78 5c 68 61 74 7b 5c 20 |)$ for $|x\hat{\ |
|00001250| 7d 79 24 2e 0a 0a 5c 73 | 75 62 73 65 63 7b 63 6f |}y$...\s|ubsec{co|
|00001260| 6d 70 61 72 69 73 6f 6e | 20 61 6e 64 20 5c 72 65 |mparison| and \re|
|00001270| 66 7b 62 6f 6f 6c 65 61 | 6e 20 6f 70 65 72 61 74 |f{boolea|n operat|
|00001280| 6f 72 73 7d 7d 2e 20 0a | 54 68 65 20 73 69 78 20 |ors}}. .|The six |
|00001290| 73 74 61 6e 64 61 72 64 | 20 5c 72 65 66 7b 63 6f |standard| \ref{co|
|000012a0| 6d 70 61 72 69 73 6f 6e | 20 6f 70 65 72 61 74 6f |mparison| operato|
|000012b0| 72 73 7d 0a 24 3c 3d 24 | 2c 20 24 3c 24 2c 20 24 |rs}.$<=$|, $<$, $|
|000012c0| 3e 3d 24 2c 20 24 3e 24 | 2c 20 24 3d 3d 24 2c 20 |>=$, $>$|, $==$, |
|000012d0| 24 21 3d 24 20 61 72 65 | 20 61 76 61 69 6c 61 62 |$!=$ are| availab|
|000012e0| 6c 65 20 69 6e 20 47 50 | 2c 20 61 6e 64 20 69 6e |le in GP|, and in|
|000012f0| 20 6c 69 62 72 61 72 79 | 20 6d 6f 64 65 20 0a 75 | library| mode .u|
|00001300| 6e 64 65 72 20 74 68 65 | 20 6e 61 6d 65 73 20 7b |nder the| names {|
|00001310| 5c 62 66 20 5c 72 65 66 | 7b 67 6c 65 7d 2c 20 5c |\bf \ref|{gle}, \|
|00001320| 72 65 66 7b 67 6c 74 7d | 2c 20 5c 72 65 66 7b 67 |ref{glt}|, \ref{g|
|00001330| 67 65 7d 2c 20 5c 72 65 | 66 7b 67 67 74 7d 2c 20 |ge}, \re|f{ggt}, |
|00001340| 5c 72 65 66 7b 67 65 71 | 7d 2c 20 5c 72 65 66 7b |\ref{geq|}, \ref{|
|00001350| 67 6e 65 7d 7d 20 72 65 | 73 70 65 63 74 69 76 65 |gne}} re|spective|
|00001360| 6c 79 2e 20 54 68 65 20 | 0a 6c 69 62 72 61 72 79 |ly. The |.library|
|00001370| 20 73 79 6e 74 61 78 20 | 69 73 20 24 7b 5c 62 66 | syntax |is ${\bf|
|00001380| 20 63 6f 7d 20 28 20 78 | 2c 20 79 20 29 24 2c 20 | co} ( x|, y )$, |
|00001390| 77 68 65 72 65 20 63 6f | 20 69 73 20 74 68 65 20 |where co| is the |
|000013a0| 63 6f 6d 70 61 72 69 73 | 6f 6e 20 0a 6f 70 65 72 |comparis|on .oper|
|000013b0| 61 74 6f 72 2e 20 54 68 | 65 20 72 65 73 75 6c 74 |ator. Th|e result|
|000013c0| 20 69 73 20 31 20 69 66 | 20 74 68 65 20 63 6f 6d | is 1 if| the com|
|000013d0| 70 61 72 69 73 6f 6e 20 | 69 73 20 74 72 75 65 2c |parison |is true,|
|000013e0| 20 30 20 69 66 20 69 74 | 20 69 73 20 66 61 6c 73 | 0 if it| is fals|
|000013f0| 65 2e 0a 0a 54 68 65 20 | 73 74 61 6e 64 61 72 64 |e...The |standard|
|00001400| 20 62 6f 6f 6c 65 61 6e | 20 66 75 6e 63 74 69 6f | boolean| functio|
|00001410| 6e 73 20 24 7c 5c 2c 7c | 24 20 28 5c 72 65 66 7b |ns $|\,||$ (\ref{|
|00001420| 69 6e 63 6c 75 73 69 76 | 65 20 6f 72 7d 29 20 61 |inclusiv|e or}) a|
|00001430| 6e 64 20 24 5c 26 5c 26 | 24 20 28 5c 72 65 66 7b |nd $\&\&|$ (\ref{|
|00001440| 61 6e 64 7d 29 20 5c 73 | 72 65 66 7b 6f 72 7d 61 |and}) \s|ref{or}a|
|00001450| 72 65 0a 61 6c 73 6f 20 | 61 76 61 69 6c 61 62 6c |re.also |availabl|
|00001460| 65 2c 20 61 6e 64 20 74 | 68 65 20 6c 69 62 72 61 |e, and t|he libra|
|00001470| 72 79 20 73 79 6e 74 61 | 78 20 69 73 20 24 5c 74 |ry synta|x is $\t|
|00001480| 65 62 7b 67 6f 72 7d 20 | 28 20 78 2c 20 79 29 24 |eb{gor} |( x, y)$|
|00001490| 20 61 6e 64 0a 24 5c 74 | 65 62 7b 67 61 6e 64 7d | and.$\t|eb{gand}|
|000014a0| 20 28 78 2c 20 79 29 24 | 20 72 65 73 70 65 63 74 | (x, y)$| respect|
|000014b0| 69 76 65 6c 79 2e 20 4e | 6f 74 65 20 74 68 61 74 |ively. N|ote that|
|000014c0| 20 74 6f 20 61 76 6f 69 | 64 20 63 6f 6e 66 75 73 | to avoi|d confus|
|000014d0| 69 6f 6e 20 77 69 74 68 | 20 74 68 65 0a 66 61 63 |ion with| the.fac|
|000014e0| 74 6f 72 69 61 6c 20 66 | 75 6e 63 74 69 6f 6e 2c |torial f|unction,|
|000014f0| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 24 21 24 | there i|s no $!$|
|00001500| 20 28 5c 72 65 66 7b 6e | 6f 74 7d 29 20 6f 70 65 | (\ref{n|ot}) ope|
|00001510| 72 61 74 6f 72 2c 20 62 | 75 74 20 74 68 69 73 20 |rator, b|ut this |
|00001520| 63 61 6e 20 65 61 73 69 | 6c 79 20 62 65 20 63 69 |can easi|ly be ci|
|00001530| 72 63 75 6d 76 65 6e 74 | 65 64 2e 0a 0a 49 6e 20 |rcumvent|ed...In |
|00001540| 6c 69 62 72 61 72 79 20 | 6d 6f 64 65 2c 20 69 74 |library |mode, it|
|00001550| 20 69 73 20 69 6e 20 66 | 61 63 74 20 75 73 75 61 | is in f|act usua|
|00001560| 6c 6c 79 20 70 72 65 66 | 65 72 61 62 6c 65 20 74 |lly pref|erable t|
|00001570| 6f 20 75 73 65 20 74 68 | 65 20 74 77 6f 20 62 61 |o use th|e two ba|
|00001580| 73 69 63 20 0a 66 75 6e | 63 74 69 6f 6e 73 20 77 |sic .fun|ctions w|
|00001590| 68 69 63 68 20 61 72 65 | 20 24 5c 74 65 62 7b 67 |hich are| $\teb{g|
|000015a0| 63 6d 70 7d 20 28 20 78 | 2c 20 79 20 29 24 20 77 |cmp} ( x|, y )$ w|
|000015b0| 68 69 63 68 20 67 69 76 | 65 73 0a 74 68 65 20 73 |hich giv|es.the s|
|000015c0| 69 67 6e 20 28 31 2c 20 | 30 2c 20 6f 72 20 2d 31 |ign (1, |0, or -1|
|000015d0| 29 20 6f 66 20 24 78 2d | 79 24 2c 20 77 68 65 72 |) of $x-|y$, wher|
|000015e0| 65 20 24 78 24 20 61 6e | 64 20 24 79 24 20 6d 75 |e $x$ an|d $y$ mu|
|000015f0| 73 74 20 62 65 20 69 6e | 20 24 5c 42 62 62 20 52 |st be in| $\Bbb R|
|00001600| 24 2c 0a 61 6e 64 20 24 | 5c 74 65 62 7b 67 65 67 |$,.and $|\teb{geg|
|00001610| 61 6c 7d 20 28 20 78 2c | 20 79 20 29 24 20 77 68 |al} ( x,| y )$ wh|
|00001620| 69 63 68 20 63 61 6e 20 | 62 65 20 61 70 70 6c 69 |ich can |be appli|
|00001630| 65 64 20 74 6f 20 61 6e | 79 20 74 77 6f 20 50 41 |ed to an|y two PA|
|00001640| 52 49 20 6f 62 6a 65 63 | 74 73 0a 24 78 24 20 61 |RI objec|ts.$x$ a|
|00001650| 6e 64 20 24 79 24 20 61 | 6e 64 20 67 69 76 65 73 |nd $y$ a|nd gives|
|00001660| 20 31 20 28 69 2e 65 2e | 20 74 72 75 65 29 20 69 | 1 (i.e.| true) i|
|00001670| 66 20 74 68 65 79 20 61 | 72 65 20 65 71 75 61 6c |f they a|re equal|
|00001680| 20 28 62 75 74 20 6e 6f | 74 20 6e 65 63 65 73 73 | (but no|t necess|
|00001690| 61 72 69 6c 79 0a 69 64 | 65 6e 74 69 63 61 6c 29 |arily.id|entical)|
|000016a0| 2c 20 30 20 28 69 2e 65 | 2e 20 66 61 6c 73 65 29 |, 0 (i.e|. false)|
|000016b0| 20 6f 74 68 65 72 77 69 | 73 65 2e 20 50 61 72 74 | otherwi|se. Part|
|000016c0| 69 63 75 6c 61 72 20 63 | 61 73 65 73 20 6f 66 20 |icular c|ases of |
|000016d0| 67 65 67 61 6c 20 77 68 | 69 63 68 0a 73 68 6f 75 |gegal wh|ich.shou|
|000016e0| 6c 64 20 62 65 20 75 73 | 65 64 20 61 72 65 20 24 |ld be us|ed are $|
|000016f0| 5c 74 65 62 7b 67 63 6d | 70 30 7d 20 28 20 78 20 |\teb{gcm|p0} ( x |
|00001700| 29 24 20 28 24 78 3d 30 | 24 20 3f 29 2c 20 24 5c |)$ ($x=0|$ ?), $\|
|00001710| 74 65 62 7b 67 63 6d 70 | 31 7d 20 28 20 78 20 29 |teb{gcmp|1} ( x )|
|00001720| 24 0a 28 24 78 3d 31 24 | 20 3f 29 2c 20 61 6e 64 |$.($x=1$| ?), and|
|00001730| 20 5c 73 72 65 66 7b 67 | 63 6d 70 5c 73 74 72 69 | \sref{g|cmp\stri|
|00001740| 6e 67 5c 5f 31 7d 20 7b | 5c 62 66 20 67 63 6d 70 |ng\_1} {|\bf gcmp|
|00001750| 5c 5f 31 7d 20 24 28 20 | 78 20 29 24 20 28 24 78 |\_1} $( |x )$ ($x|
|00001760| 3d 2d 31 24 20 3f 29 2e | 0a 0a 4e 6f 74 65 20 74 |=-1$ ?).|..Note t|
|00001770| 68 61 74 20 24 5c 74 65 | 62 7b 67 63 6d 70 30 7d |hat $\te|b{gcmp0}|
|00001780| 28 78 29 24 20 74 65 73 | 74 73 20 77 68 65 74 68 |(x)$ tes|ts wheth|
|00001790| 65 72 20 24 78 24 20 69 | 73 20 65 71 75 61 6c 20 |er $x$ i|s equal |
|000017a0| 74 6f 20 7a 65 72 6f 2c | 20 65 76 65 6e 20 69 66 |to zero,| even if|
|000017b0| 0a 24 78 24 20 69 73 20 | 6e 6f 74 20 61 6e 20 65 |.$x$ is |not an e|
|000017c0| 78 61 63 74 20 6f 62 6a | 65 63 74 2e 20 54 6f 20 |xact obj|ect. To |
|000017d0| 74 65 73 74 20 77 68 65 | 74 68 65 72 20 24 78 24 |test whe|ther $x$|
|000017e0| 20 69 73 20 61 6e 20 65 | 78 61 63 74 20 6f 62 6a | is an e|xact obj|
|000017f0| 65 63 74 20 77 68 69 63 | 68 0a 69 73 20 65 71 75 |ect whic|h.is equ|
|00001800| 61 6c 20 74 6f 20 7a 65 | 72 6f 2c 20 6f 6e 65 20 |al to ze|ro, one |
|00001810| 6d 75 73 74 20 75 73 65 | 20 24 5c 74 65 62 7b 69 |must use| $\teb{i|
|00001820| 73 65 78 61 63 74 7a 65 | 72 6f 7d 24 2e 0a 5c 73 |sexactze|ro}$..\s|
|00001830| 6d 61 6c 6c 73 6b 69 70 | 0a 47 50 20 61 63 63 65 |mallskip|.GP acce|
|00001840| 70 74 73 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |pts the |followin|
|00001850| 67 20 73 79 6e 6f 6e 79 | 6d 73 20 66 6f 72 20 73 |g synony|ms for s|
|00001860| 6f 6d 65 20 6f 66 20 74 | 68 65 20 61 62 6f 76 65 |ome of t|he above|
|00001870| 20 66 75 6e 63 74 69 6f | 6e 73 3a 0a 73 69 6e 63 | functio|ns:.sinc|
|00001880| 65 20 74 68 65 72 65 20 | 69 73 20 6e 6f 20 62 69 |e there |is no bi|
|00001890| 74 77 69 73 65 20 7b 5c | 74 74 20 61 6e 64 7d 20 |twise {\|tt and} |
|000018a0| 6f 72 20 62 69 74 77 69 | 73 65 20 7b 5c 74 74 20 |or bitwi|se {\tt |
|000018b0| 6f 72 7d 2c 20 24 7c 24 | 20 61 6e 64 20 24 5c 26 |or}, $|$| and $\&|
|000018c0| 24 20 61 72 65 20 61 63 | 63 65 70 74 65 64 20 61 |$ are ac|cepted a|
|000018d0| 73 5c 73 72 65 66 7b 62 | 69 74 77 69 73 65 20 61 |s\sref{b|itwise a|
|000018e0| 6e 64 7d 20 5c 73 72 65 | 66 7b 62 69 74 77 69 73 |nd} \sre|f{bitwis|
|000018f0| 65 20 6f 72 7d 0a 73 79 | 6e 6f 6e 79 6d 73 20 6f |e or}.sy|nonyms o|
|00001900| 66 20 24 7c 5c 2c 7c 24 | 20 61 6e 64 20 24 5c 26 |f $|\,|$| and $\&|
|00001910| 5c 26 24 20 72 65 73 70 | 65 63 74 69 76 65 6c 79 |\&$ resp|ectively|
|00001920| 2e 20 41 6c 73 6f 2c 20 | 24 3c 3e 24 20 69 73 20 |. Also, |$<>$ is |
|00001930| 61 63 63 65 70 74 65 64 | 20 61 73 20 61 0a 73 79 |accepted| as a.sy|
|00001940| 6e 6f 6e 79 6d 20 66 6f | 72 20 24 21 3d 24 2e 20 |nonym fo|r $!=$. |
|00001950| 4f 6e 20 74 68 65 20 6f | 74 68 65 72 20 68 61 6e |On the o|ther han|
|00001960| 64 2c 20 24 3d 24 20 69 | 73 20 64 65 66 69 6e 69 |d, $=$ i|s defini|
|00001970| 74 65 6c 79 20 7b 5c 73 | 6c 20 6e 6f 74 7d 20 61 |tely {\s|l not} a|
|00001980| 0a 73 79 6e 6f 6d 79 6d | 20 66 6f 72 20 24 3d 3d |.synomym| for $==|
|00001990| 24 20 73 69 6e 63 65 20 | 69 74 20 69 73 20 74 68 |$ since |it is th|
|000019a0| 65 20 61 73 73 69 67 6e | 6d 65 6e 74 20 73 74 61 |e assign|ment sta|
|000019b0| 74 65 6d 65 6e 74 2e 0a | 0a 5c 73 75 62 73 65 63 |tement..|.\subsec|
|000019c0| 7b 73 69 67 6e 7d 24 28 | 20 78 20 29 24 3a 20 5c |{sign}$(| x )$: \|
|000019d0| 72 65 66 7b 73 69 67 6e | 7d 20 6f 66 20 24 78 24 |ref{sign|} of $x$|
|000019e0| 2c 20 77 68 69 63 68 20 | 6d 75 73 74 20 62 65 20 |, which |must be |
|000019f0| 6f 66 20 74 79 70 65 0a | 69 6e 74 65 67 65 72 2c |of type.|integer,|
|00001a00| 20 72 65 61 6c 20 6f 72 | 20 66 72 61 63 74 69 6f | real or| fractio|
|00001a10| 6e 2e 20 54 68 65 20 72 | 65 73 75 6c 74 20 28 30 |n. The r|esult (0|
|00001a20| 2c 20 31 20 6f 72 20 2d | 31 29 20 69 73 20 61 20 |, 1 or -|1) is a |
|00001a30| 43 2d 69 6e 74 65 67 65 | 72 2e 0a 0a 54 68 65 20 |C-intege|r...The |
|00001a40| 6c 69 62 72 61 72 79 20 | 73 79 6e 74 61 78 20 69 |library |syntax i|
|00001a50| 73 20 24 5c 74 65 62 7b | 67 73 69 67 6e 65 7d 20 |s $\teb{|gsigne} |
|00001a60| 28 20 78 20 29 24 2e 0a | 0a 5c 73 75 62 73 65 63 |( x )$..|.\subsec|
|00001a70| 7b 5c 72 65 66 7b 6d 61 | 78 7d 7d 24 28 20 78 2c |{\ref{ma|x}}$( x,|
|00001a80| 20 79 20 29 24 20 61 6e | 64 20 7b 5c 62 66 20 5c | y )$ an|d {\bf \|
|00001a90| 72 65 66 7b 6d 69 6e 7d | 7d 24 28 20 78 2c 20 79 |ref{min}|}$( x, y|
|00001aa0| 20 29 24 20 63 72 65 61 | 74 65 20 74 68 65 0a 6d | )$ crea|te the.m|
|00001ab0| 61 78 69 6d 75 6d 20 61 | 6e 64 20 6d 69 6e 69 6d |aximum a|nd minim|
|00001ac0| 75 6d 20 6f 66 20 24 78 | 24 20 61 6e 64 20 24 79 |um of $x|$ and $y|
|00001ad0| 24 20 77 68 65 6e 20 74 | 68 65 79 20 63 61 6e 20 |$ when t|hey can |
|00001ae0| 62 65 20 63 6f 6d 70 61 | 72 65 64 2e 0a 0a 54 68 |be compa|red...Th|
|00001af0| 65 20 6c 69 62 72 61 72 | 79 20 73 79 6e 74 61 78 |e librar|y syntax|
|00001b00| 20 69 73 20 24 5c 74 65 | 62 7b 67 6d 61 78 7d 20 | is $\te|b{gmax} |
|00001b10| 28 20 78 2c 20 79 20 29 | 24 20 61 6e 64 20 24 5c |( x, y )|$ and $\|
|00001b20| 74 65 62 7b 67 6d 69 6e | 7d 20 28 20 78 2c 20 79 |teb{gmin|} ( x, y|
|00001b30| 20 29 24 2e 0a 0a 5c 73 | 75 62 73 65 63 74 69 74 | )$...\s|ubsectit|
|00001b40| 6c 65 7b 49 6d 70 6f 72 | 74 61 6e 74 20 72 65 6d |le{Impor|tant rem|
|00001b50| 61 72 6b 2e 7d 20 49 6e | 20 61 6c 6c 20 74 68 65 |ark.} In| all the|
|00001b60| 20 61 62 6f 76 65 20 6c | 69 62 72 61 72 79 20 73 | above l|ibrary s|
|00001b70| 79 6e 74 61 78 65 73 2c | 20 77 65 20 68 61 76 65 |yntaxes,| we have|
|00001b80| 0a 67 69 76 65 6e 20 6f | 6e 6c 79 20 74 68 65 20 |.given o|nly the |
|00001b90| 62 61 73 69 63 20 6e 61 | 6d 65 73 20 6f 66 20 74 |basic na|mes of t|
|00001ba0| 68 65 20 66 75 6e 63 74 | 69 6f 6e 73 2e 20 46 6f |he funct|ions. Fo|
|00001bb0| 72 20 65 78 61 6d 70 6c | 65 20 24 7b 5c 74 74 20 |r exampl|e ${\tt |
|00001bc0| 67 61 64 64 7d 20 28 20 | 78 2c 20 79 0a 29 24 0a |gadd} ( |x, y.)$.|
|00001bd0| 61 73 73 75 6d 65 73 20 | 74 68 61 74 20 24 78 24 |assumes |that $x$|
|00001be0| 20 61 6e 64 20 24 79 24 | 20 61 72 65 20 50 41 52 | and $y$| are PAR|
|00001bf0| 49 20 6f 62 6a 65 63 74 | 73 20 28 74 68 65 20 47 |I object|s (the G|
|00001c00| 45 4e 20 74 79 70 65 29 | 20 61 6e 64 20 7b 5c 73 |EN type)| and {\s|
|00001c10| 6c 20 63 72 65 61 74 65 | 73 7d 0a 74 68 65 20 72 |l create|s}.the r|
|00001c20| 65 73 75 6c 74 20 24 78 | 2b 79 24 20 6f 6e 20 74 |esult $x|+y$ on t|
|00001c30| 68 65 20 50 41 52 49 20 | 73 74 61 63 6b 2e 20 46 |he PARI |stack. F|
|00001c40| 72 6f 6d 20 6d 6f 73 74 | 20 6f 66 20 74 68 65 73 |rom most| of thes|
|00001c50| 65 20 62 61 73 69 63 20 | 6e 61 6d 65 73 2c 20 74 |e basic |names, t|
|00001c60| 68 65 20 6e 61 6d 65 73 | 0a 61 6e 64 0a 65 66 66 |he names|.and.eff|
|00001c70| 65 63 74 73 20 6f 66 20 | 6f 74 68 65 72 20 66 75 |ects of |other fu|
|00001c80| 6e 63 74 69 6f 6e 73 20 | 63 61 6e 20 62 65 20 6f |nctions |can be o|
|00001c90| 62 74 61 69 6e 65 64 20 | 69 6e 20 74 68 65 20 66 |btained |in the f|
|00001ca0| 6f 6c 6c 6f 77 69 6e 67 | 20 77 61 79 2e 20 57 65 |ollowing| way. We|
|00001cb0| 20 67 69 76 65 0a 74 68 | 65 20 65 78 61 6d 70 6c | give.th|e exampl|
|00001cc0| 65 20 66 6f 72 20 67 61 | 64 64 2c 20 62 75 74 20 |e for ga|dd, but |
|00001cd0| 74 68 65 20 73 61 6d 65 | 20 69 73 20 74 72 75 65 |the same| is true|
|00001ce0| 20 66 6f 72 20 61 6c 6c | 20 74 68 65 20 6f 74 68 | for all| the oth|
|00001cf0| 65 72 20 66 75 6e 63 74 | 69 6f 6e 73 0a 61 62 6f |er funct|ions.abo|
|00001d00| 76 65 2c 20 61 6e 64 20 | 61 20 66 65 77 20 6d 6f |ve, and |a few mo|
|00001d10| 72 65 20 74 68 61 74 20 | 77 65 20 68 61 76 65 20 |re that |we have |
|00001d20| 6e 6f 74 20 67 69 76 65 | 6e 3a 0a 0a 24 5c 74 65 |not give|n:..$\te|
|00001d30| 62 7b 67 61 64 64 67 73 | 7d 20 28 20 78 2c 20 79 |b{gaddgs|} ( x, y|
|00001d40| 20 29 24 3a 20 68 65 72 | 65 20 24 78 24 20 69 73 | )$: her|e $x$ is|
|00001d50| 20 61 20 47 45 4e 2c 20 | 24 79 24 20 69 73 20 61 | a GEN, |$y$ is a|
|00001d60| 6e 20 6f 72 64 69 6e 61 | 72 79 20 33 32 2d 62 69 |n ordina|ry 32-bi|
|00001d70| 74 0a 69 6e 74 65 67 65 | 72 2e 0a 0a 24 5c 74 65 |t.intege|r...$\te|
|00001d80| 62 7b 67 61 64 64 73 67 | 7d 20 28 20 78 2c 20 79 |b{gaddsg|} ( x, y|
|00001d90| 20 29 24 3a 20 68 65 72 | 65 20 24 78 24 20 69 73 | )$: her|e $x$ is|
|00001da0| 20 61 6e 20 6f 72 64 69 | 6e 61 72 79 20 33 32 2d | an ordi|nary 32-|
|00001db0| 62 69 74 20 69 6e 74 65 | 67 65 72 2c 20 24 79 24 |bit inte|ger, $y$|
|00001dc0| 20 69 73 20 61 0a 47 45 | 4e 2e 0a 0a 24 5c 74 65 | is a.GE|N...$\te|
|00001dd0| 62 7b 67 61 64 64 7a 7d | 20 28 20 78 2c 20 79 2c |b{gaddz}| ( x, y,|
|00001de0| 20 7a 20 29 2c 5c 20 5c | 74 65 62 7b 67 61 64 64 | z ),\ \|teb{gadd|
|00001df0| 67 73 7a 7d 20 28 20 78 | 2c 20 79 2c 20 7a 20 29 |gsz} ( x|, y, z )|
|00001e00| 2c 5c 20 5c 74 65 62 7b | 67 61 64 64 73 67 7a 7d |,\ \teb{|gaddsgz}|
|00001e10| 20 28 20 78 2c 20 79 2c | 20 7a 0a 29 24 3a 20 68 | ( x, y,| z.)$: h|
|00001e20| 65 72 65 20 24 7a 24 20 | 69 73 20 61 0a 70 72 65 |ere $z$ |is a.pre|
|00001e30| 65 78 69 73 74 69 6e 67 | 20 47 45 4e 20 61 6e 64 |existing| GEN and|
|00001e40| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 74 | the res|ult of t|
|00001e50| 68 65 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |he corre|sponding|
|00001e60| 20 6f 70 65 72 61 74 69 | 6f 6e 20 69 73 20 70 75 | operati|on is pu|
|00001e70| 74 20 69 6e 20 24 7a 24 | 2e 0a 54 68 65 20 73 69 |t in $z$|..The si|
|00001e80| 7a 65 20 6f 66 20 74 68 | 65 20 50 41 52 49 20 73 |ze of th|e PARI s|
|00001e90| 74 61 63 6b 20 64 6f 65 | 73 20 6e 6f 74 20 63 68 |tack doe|s not ch|
|00001ea0| 61 6e 67 65 2e 0a 0a 41 | 73 20 73 69 6d 70 6c 69 |ange...A|s simpli|
|00001eb0| 66 69 63 61 74 69 6f 6e | 20 74 6f 20 70 72 6f 67 |fication| to prog|
|00001ec0| 72 61 6d 6d 69 6e 67 2c | 20 66 6f 72 20 6d 61 6e |ramming,| for man|
|00001ed0| 79 20 66 75 6e 63 74 69 | 6f 6e 73 20 62 65 67 69 |y functi|ons begi|
|00001ee0| 6e 6e 69 6e 67 20 77 69 | 74 68 20 61 20 7b 5c 62 |nning wi|th a {\b|
|00001ef0| 66 0a 67 7d 2c 20 73 75 | 63 68 0a 61 73 20 67 61 |f.g}, su|ch.as ga|
|00001f00| 64 64 2c 20 6f 6e 65 20 | 63 61 6e 20 72 65 70 6c |dd, one |can repl|
|00001f10| 61 63 65 20 74 68 65 20 | 7b 5c 62 66 20 67 7d 20 |ace the |{\bf g} |
|00001f20| 62 79 20 61 6e 20 7b 5c | 62 66 20 6c 7d 20 74 6f |by an {\|bf l} to|
|00001f30| 20 6f 62 74 61 69 6e 20 | 61 20 7b 5c 62 66 20 6c | obtain |a {\bf l|
|00001f40| 6f 6e 67 7d 0a 72 65 73 | 75 6c 74 20 69 6e 73 74 |ong}.res|ult inst|
|00001f50| 65 61 64 0a 6f 66 20 61 | 20 47 45 4e 20 28 69 2e |ead.of a| GEN (i.|
|00001f60| 65 2e 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 6c 6f |e. point|er to lo|
|00001f70| 6e 67 29 20 72 65 73 75 | 6c 74 2e 20 46 6f 72 20 |ng) resu|lt. For |
|00001f80| 69 6e 73 74 61 6e 63 65 | 20 24 5c 74 65 62 7b 6c |instance| $\teb{l|
|00001f90| 61 64 64 7d 20 28 20 78 | 2c 20 79 20 29 24 20 69 |add} ( x|, y )$ i|
|00001fa0| 73 0a 69 64 65 6e 74 69 | 63 61 6c 20 77 69 74 68 |s.identi|cal with|
|00001fb0| 20 24 28 7b 5c 74 74 20 | 28 6c 6f 6e 67 29 67 61 | $({\tt |(long)ga|
|00001fc0| 64 64 7d 20 28 20 78 2c | 20 79 20 29 20 29 24 2e |dd} ( x,| y ) )$.|
|00001fd0| 20 54 68 65 73 65 20 6d | 61 63 72 6f 73 20 61 72 | These m|acros ar|
|00001fe0| 65 20 77 72 69 74 74 65 | 6e 20 69 6e 0a 74 68 65 |e writte|n in.the|
|00001ff0| 20 66 69 6c 65 73 20 6c | 69 73 74 65 64 20 69 6e | files l|isted in|
|00002000| 20 7b 5c 74 74 20 5c 72 | 65 66 7b 67 65 6e 63 6f | {\tt \r|ef{genco|
|00002010| 6d 2e 68 7d 7d 2e 0a 0a | 5c 73 65 63 74 69 6f 6e |m.h}}...|\section|
|00002020| 7b 43 6f 6e 76 65 72 73 | 69 6f 6e 73 20 61 6e 64 |{Convers|ions and|
|00002030| 20 73 69 6d 69 6c 61 72 | 20 65 6c 65 6d 65 6e 74 | similar| element|
|00002040| 61 72 79 20 66 75 6e 63 | 74 69 6f 6e 73 7d 0a 0a |ary func|tions}..|
|00002050| 4d 61 6e 79 20 6f 66 20 | 74 68 65 73 65 20 63 6f |Many of |these co|
|00002060| 6e 76 65 72 73 69 6f 6e | 20 66 75 6e 63 74 69 6f |nversion| functio|
|00002070| 6e 73 20 61 72 65 20 72 | 6f 75 6e 64 69 6e 67 20 |ns are r|ounding |
|00002080| 6f 72 20 74 72 75 6e 63 | 61 74 69 6e 67 20 6f 70 |or trunc|ating op|
|00002090| 65 72 61 74 69 6f 6e 73 | 2e 0a 49 6e 20 74 68 69 |erations|..In thi|
|000020a0| 73 20 63 61 73 65 2c 20 | 69 66 20 74 68 65 20 61 |s case, |if the a|
|000020b0| 72 67 75 6d 65 6e 74 20 | 69 73 20 61 20 72 61 74 |rgument |is a rat|
|000020c0| 69 6f 6e 61 6c 20 66 75 | 6e 63 74 69 6f 6e 2c 20 |ional fu|nction, |
|000020d0| 74 68 65 20 72 65 73 75 | 6c 74 20 69 73 20 74 68 |the resu|lt is th|
|000020e0| 65 0a 65 75 63 6c 69 64 | 65 61 6e 20 71 75 6f 74 |e.euclid|ean quot|
|000020f0| 69 65 6e 74 20 6f 66 20 | 74 68 65 20 6e 75 6d 65 |ient of |the nume|
|00002100| 72 61 74 6f 72 20 62 79 | 20 74 68 65 20 64 65 6e |rator by| the den|
|00002110| 6f 6d 69 6e 61 74 6f 72 | 2c 20 61 6e 64 20 69 66 |ominator|, and if|
|00002120| 20 74 68 65 20 61 72 67 | 75 6d 65 6e 74 0a 69 73 | the arg|ument.is|
|00002130| 20 61 20 76 65 63 74 6f | 72 20 6f 72 20 61 20 6d | a vecto|r or a m|
|00002140| 61 74 72 69 78 2c 20 74 | 68 65 20 6f 70 65 72 61 |atrix, t|he opera|
|00002150| 74 69 6f 6e 20 69 73 20 | 64 6f 6e 65 20 63 6f 6d |tion is |done com|
|00002160| 70 6f 6e 65 6e 74 77 69 | 73 65 2e 20 54 68 69 73 |ponentwi|se. This|
|00002170| 20 77 69 6c 6c 20 6e 6f | 74 0a 62 65 20 72 65 73 | will no|t.be res|
|00002180| 74 61 74 65 64 20 66 6f | 72 20 65 76 65 72 79 20 |tated fo|r every |
|00002190| 66 75 6e 63 74 69 6f 6e | 2e 0a 0a 5c 73 75 62 73 |function|...\subs|
|000021a0| 65 63 72 65 66 7b 62 69 | 6e 61 72 79 7d 24 28 78 |ecref{bi|nary}$(x|
|000021b0| 29 24 3a 20 6f 75 74 70 | 75 74 73 20 74 68 65 20 |)$: outp|uts the |
|000021c0| 76 65 63 74 6f 72 20 6f | 66 20 74 68 65 20 62 69 |vector o|f the bi|
|000021d0| 6e 61 72 79 20 64 69 67 | 69 74 73 20 6f 66 20 24 |nary dig|its of $|
|000021e0| 7c 78 7c 24 2c 20 77 68 | 65 72 65 0a 24 7c 78 7c ||x|$, wh|ere.$|x||
|000021f0| 3c 32 5e 7b 33 32 7d 24 | 2e 0a 0a 54 68 65 20 6c |<2^{32}$|...The l|
|00002200| 69 62 72 61 72 79 20 73 | 79 6e 74 61 78 20 69 73 |ibrary s|yntax is|
|00002210| 20 24 5c 74 65 62 7b 62 | 69 6e 61 69 72 65 7d 28 | $\teb{b|inaire}(|
|00002220| 78 29 24 2e 0a 0a 5c 73 | 75 62 73 65 63 72 65 66 |x)$...\s|ubsecref|
|00002230| 7b 62 69 74 74 65 73 74 | 7d 24 28 78 2c 6e 29 24 |{bittest|}$(x,n)$|
|00002240| 3a 20 6f 75 74 70 75 74 | 73 20 74 68 65 20 24 6e |: output|s the $n|
|00002250| 5e 7b 5c 74 65 78 74 7b | 74 68 7d 7d 24 20 62 69 |^{\text{|th}}$ bi|
|00002260| 74 20 6f 66 20 24 7c 78 | 7c 24 20 73 74 61 72 74 |t of $|x||$ start|
|00002270| 69 6e 67 0a 66 72 6f 6d | 20 74 68 65 20 72 69 67 |ing.from| the rig|
|00002280| 68 74 20 28 69 2e 65 2e | 20 74 68 65 20 63 6f 65 |ht (i.e.| the coe|
|00002290| 66 66 69 63 69 65 6e 74 | 20 6f 66 20 24 32 5e 6e |fficient| of $2^n|
|000022a0| 24 20 69 6e 20 74 68 65 | 20 62 69 6e 61 72 79 20 |$ in the| binary |
|000022b0| 65 78 70 61 6e 73 69 6f | 6e 20 6f 66 20 24 78 24 |expansio|n of $x$|
|000022c0| 2e 0a 54 68 65 20 72 65 | 73 75 6c 74 20 69 73 20 |..The re|sult is |
|000022d0| 30 20 6f 72 20 31 2e 0a | 0a 54 68 65 20 6c 69 62 |0 or 1..|.The lib|
|000022e0| 72 61 72 79 20 73 79 6e | 74 61 78 20 69 73 20 24 |rary syn|tax is $|
|000022f0| 5c 74 65 62 7b 62 69 74 | 74 65 73 74 7d 28 78 2c |\teb{bit|test}(x,|
|00002300| 6e 29 24 20 77 68 65 72 | 65 20 24 6e 24 20 61 73 |n)$ wher|e $n$ as|
|00002310| 20 77 65 6c 6c 20 61 73 | 20 74 68 65 20 72 65 73 | well as| the res|
|00002320| 75 6c 74 0a 61 72 65 20 | 43 2d 69 6e 74 65 67 65 |ult.are |C-intege|
|00002330| 72 73 2e 0a 0a 5c 73 75 | 62 73 65 63 7b 5c 72 65 |rs...\su|bsec{\re|
|00002340| 66 7b 63 65 69 6c 7d 7d | 24 28 20 78 20 29 24 3a |f{ceil}}|$( x )$:|
|00002350| 20 63 65 69 6c 69 6e 67 | 20 6f 66 20 24 78 24 2e | ceiling| of $x$.|
|00002360| 20 57 68 65 6e 20 24 78 | 24 20 69 73 20 69 6e 20 | When $x|$ is in |
|00002370| 24 5c 42 62 62 20 52 24 | 2c 0a 74 68 65 20 72 65 |$\Bbb R$|,.the re|
|00002380| 73 75 6c 74 20 69 73 20 | 74 68 65 20 73 6d 61 6c |sult is |the smal|
|00002390| 6c 65 73 74 20 69 6e 74 | 65 67 65 72 20 67 72 65 |lest int|eger gre|
|000023a0| 61 74 65 72 20 74 68 61 | 6e 20 6f 72 20 65 71 75 |ater tha|n or equ|
|000023b0| 61 6c 20 74 6f 20 24 78 | 24 2e 0a 0a 54 68 65 20 |al to $x|$...The |
|000023c0| 6c 69 62 72 61 72 79 20 | 73 79 6e 74 61 78 20 69 |library |syntax i|
|000023d0| 73 20 24 5c 74 65 62 7b | 67 63 65 69 6c 7d 20 28 |s $\teb{|gceil} (|
|000023e0| 20 78 20 29 24 2e 0a 0a | 5c 73 75 62 73 65 63 7b | x )$...|\subsec{|
|000023f0| 5c 72 65 66 7b 63 68 61 | 6e 67 65 76 61 72 7d 7d |\ref{cha|ngevar}}|
|00002400| 24 28 78 2c 79 29 24 3a | 20 63 68 61 6e 67 65 20 |$(x,y)$:| change |
|00002410| 74 68 65 20 76 61 72 69 | 61 62 6c 65 73 20 69 6e |the vari|ables in|
|00002420| 20 74 68 65 20 6f 62 6a | 65 63 74 20 24 78 24 0a | the obj|ect $x$.|
|00002430| 61 63 63 6f 72 64 69 6e | 67 20 74 6f 20 74 68 65 |accordin|g to the|
|00002440| 20 70 65 72 6d 75 74 61 | 74 69 6f 6e 20 73 70 65 | permuta|tion spe|
|00002450| 63 69 66 69 65 64 20 62 | 79 20 74 68 65 20 76 65 |cified b|y the ve|
|00002460| 63 74 6f 72 20 24 79 24 | 2e 0a 46 6f 72 20 65 78 |ctor $y$|..For ex|
|00002470| 61 6d 70 6c 65 2c 20 61 | 73 73 75 6d 65 20 74 68 |ample, a|ssume th|
|00002480| 61 74 20 74 68 65 20 76 | 61 72 69 61 62 6c 65 73 |at the v|ariables|
|00002490| 20 68 61 76 65 20 62 65 | 65 6e 20 69 6e 74 72 6f | have be|en intro|
|000024a0| 64 75 63 65 64 20 69 6e | 20 74 68 65 0a 6f 72 64 |duced in| the.ord|
|000024b0| 65 72 20 7b 5c 74 74 20 | 78 7d 2c 20 7b 5c 74 74 |er {\tt |x}, {\tt|
|000024c0| 20 61 7d 2c 20 7b 5c 74 | 74 20 62 7d 2c 20 7b 5c | a}, {\t|t b}, {\|
|000024d0| 74 74 20 63 7d 2e 20 54 | 68 65 6e 2c 0a 69 66 20 |tt c}. T|hen,.if |
|000024e0| 24 79 24 20 69 73 20 74 | 68 65 20 76 65 63 74 6f |$y$ is t|he vecto|
|000024f0| 72 20 7b 5c 74 74 20 5b | 78 2c 63 2c 61 2c 62 5d |r {\tt [|x,c,a,b]|
|00002500| 7d 2c 20 74 68 65 20 76 | 61 72 69 61 62 6c 65 20 |}, the v|ariable |
|00002510| 7b 5c 74 74 20 61 7d 20 | 77 69 6c 6c 20 62 65 0a |{\tt a} |will be.|
|00002520| 72 65 70 6c 61 63 65 64 | 20 62 79 20 7b 5c 74 74 |replaced| by {\tt|
|00002530| 20 63 7d 2c 20 7b 5c 74 | 74 20 62 7d 20 62 79 20 | c}, {\t|t b} by |
|00002540| 7b 5c 74 74 20 61 7d 2c | 20 61 6e 64 20 7b 5c 74 |{\tt a},| and {\t|
|00002550| 74 20 61 7d 20 62 79 20 | 7b 5c 74 74 20 62 7d 2c |t a} by |{\tt b},|
|00002560| 20 7b 5c 74 74 20 78 7d | 0a 62 65 69 6e 67 20 75 | {\tt x}|.being u|
|00002570| 6e 63 68 61 6e 67 65 64 | 2e 20 4e 6f 74 65 20 74 |nchanged|. Note t|
|00002580| 68 61 74 20 74 68 65 20 | 70 65 72 6d 75 74 61 74 |hat the |permutat|
|00002590| 69 6f 6e 20 6d 75 73 74 | 20 62 65 20 63 6f 6d 70 |ion must| be comp|
|000025a0| 6c 65 74 65 6c 79 0a 73 | 70 65 63 69 66 69 65 64 |letely.s|pecified|
|000025b0| 2c 20 65 2e 67 2e 20 7b | 5c 74 74 20 5b 63 2c 61 |, e.g. {|\tt [c,a|
|000025c0| 2c 62 5d 7d 20 77 6f 75 | 6c 64 20 6e 6f 74 20 77 |,b]} wou|ld not w|
|000025d0| 6f 72 6b 2c 20 73 69 6e | 63 65 20 74 68 69 73 20 |ork, sin|ce this |
|000025e0| 77 6f 75 6c 64 20 72 65 | 70 6c 61 63 65 0a 7b 5c |would re|place.{\|
|000025f0| 74 74 20 78 7d 20 62 79 | 20 7b 5c 74 74 20 63 7d |tt x} by| {\tt c}|
|00002600| 2c 20 61 6e 64 20 6c 65 | 61 76 65 20 7b 5c 74 74 |, and le|ave {\tt|
|00002610| 20 61 7d 20 61 6e 64 20 | 7b 5c 74 74 20 62 7d 20 | a} and |{\tt b} |
|00002620| 75 6e 63 68 61 6e 67 65 | 64 2e 0a 0a 54 68 65 20 |unchange|d...The |
|00002630| 6c 69 62 72 61 72 79 20 | 73 79 6e 74 61 78 20 69 |library |syntax i|
|00002640| 73 20 24 5c 74 65 62 7b | 63 68 61 6e 67 65 76 61 |s $\teb{|changeva|
|00002650| 72 7d 28 78 2c 79 29 24 | 2e 0a 0a 5c 73 75 62 73 |r}(x,y)$|...\subs|
|00002660| 65 63 7b 5c 72 65 66 7b | 63 6f 6d 70 6f 6e 65 6e |ec{\ref{|componen|
|00002670| 74 73 7d 20 6f 66 20 61 | 20 50 41 52 49 20 6f 62 |ts} of a| PARI ob|
|00002680| 6a 65 63 74 7d 3a 20 0a | 0a 54 68 65 72 65 20 61 |ject}: .|.There a|
|00002690| 72 65 20 65 73 73 65 6e | 74 69 61 6c 6c 79 20 74 |re essen|tially t|
|000026a0| 68 72 65 65 20 77 61 79 | 73 20 74 6f 20 65 78 74 |hree way|s to ext|
|000026b0| 72 61 63 74 20 74 68 65 | 20 63 6f 6d 70 6f 6e 65 |ract the| compone|
|000026c0| 6e 74 73 20 66 72 6f 6d | 20 61 20 50 41 52 49 20 |nts from| a PARI |
|000026d0| 6f 62 6a 65 63 74 2e 0a | 0a 54 68 65 20 66 69 72 |object..|.The fir|
|000026e0| 73 74 20 61 6e 64 20 6d | 6f 73 74 20 67 65 6e 65 |st and m|ost gene|
|000026f0| 72 61 6c 2c 20 69 73 20 | 74 68 65 20 66 75 6e 63 |ral, is |the func|
|00002700| 74 69 6f 6e 20 24 5c 74 | 65 62 7b 63 6f 6d 70 6f |tion $\t|eb{compo|
|00002710| 7d 28 78 2c 6e 29 24 20 | 77 68 69 63 68 20 65 78 |}(x,n)$ |which ex|
|00002720| 74 72 61 63 74 73 0a 74 | 68 65 20 24 6e 5e 7b 5c |tracts.t|he $n^{\|
|00002730| 74 65 78 74 7b 74 68 7d | 7d 24 2d 63 6f 6d 70 6f |text{th}|}$-compo|
|00002740| 6e 65 6e 74 20 6f 66 20 | 24 78 24 2e 20 54 68 69 |nent of |$x$. Thi|
|00002750| 73 20 69 73 20 74 6f 20 | 62 65 20 75 6e 64 65 72 |s is to |be under|
|00002760| 73 74 6f 6f 64 0a 61 73 | 20 66 6f 6c 6c 6f 77 73 |stood.as| follows|
|00002770| 3a 20 65 76 65 72 79 20 | 50 41 52 49 20 74 79 70 |: every |PARI typ|
|00002780| 65 20 68 61 73 20 6f 6e | 65 20 6f 72 20 74 77 6f |e has on|e or two|
|00002790| 20 69 6e 69 74 69 61 6c | 20 5c 72 65 66 7b 63 6f | initial| \ref{co|
|000027a0| 64 65 20 77 6f 72 64 73 | 7d 2e 20 54 68 65 20 63 |de words|}. The c|
|000027b0| 6f 6d 70 6f 6e 65 6e 74 | 73 0a 61 72 65 20 63 6f |omponent|s.are co|
|000027c0| 75 6e 74 65 64 2c 0a 73 | 74 61 72 74 69 6e 67 20 |unted,.s|tarting |
|000027d0| 61 74 20 31 2c 20 61 66 | 74 65 72 20 74 68 65 73 |at 1, af|ter thes|
|000027e0| 65 20 63 6f 64 65 20 77 | 6f 72 64 73 2e 20 49 6e |e code w|ords. In|
|000027f0| 20 70 61 72 74 69 63 75 | 6c 61 72 20 69 66 20 24 | particu|lar if $|
|00002800| 78 24 20 69 73 20 61 20 | 76 65 63 74 6f 72 2c 20 |x$ is a |vector, |
|00002810| 74 68 69 73 0a 69 73 20 | 69 6e 64 65 65 64 0a 74 |this.is |indeed.t|
|00002820| 68 65 20 24 6e 5e 7b 5c | 74 65 78 74 7b 74 68 7d |he $n^{\|text{th}|
|00002830| 7d 24 2d 63 6f 6d 70 6f | 6e 65 6e 74 20 6f 66 20 |}$-compo|nent of |
|00002840| 24 78 24 2c 20 69 66 20 | 24 78 24 20 69 73 20 61 |$x$, if |$x$ is a|
|00002850| 20 6d 61 74 72 69 78 2c | 20 74 68 65 20 24 6e 5e | matrix,| the $n^|
|00002860| 7b 5c 74 65 78 74 7b 74 | 68 7d 7d 24 0a 63 6f 6c |{\text{t|h}}$.col|
|00002870| 75 6d 6e 2c 0a 69 66 20 | 24 78 24 20 69 73 20 61 |umn,.if |$x$ is a|
|00002880| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 2c 20 74 68 65 | polynom|ial, the|
|00002890| 20 24 6e 5e 7b 5c 74 65 | 78 74 7b 74 68 7d 7d 24 | $n^{\te|xt{th}}$|
|000028a0| 20 63 6f 65 66 66 69 63 | 69 65 6e 74 20 28 69 2e | coeffic|ient (i.|
|000028b0| 65 2e 20 6f 66 20 64 65 | 67 72 65 65 0a 24 6e 2d |e. of de|gree.$n-|
|000028c0| 31 24 29 2c 0a 61 6e 64 | 20 66 6f 72 20 70 6f 77 |1$),.and| for pow|
|000028d0| 65 72 20 73 65 72 69 65 | 73 2c 20 74 68 65 20 24 |er serie|s, the $|
|000028e0| 6e 5e 7b 5c 74 65 78 74 | 7b 74 68 7d 7d 24 20 73 |n^{\text|{th}}$ s|
|000028f0| 69 67 6e 69 66 69 63 61 | 6e 74 20 63 6f 65 66 66 |ignifica|nt coeff|
|00002900| 69 63 69 65 6e 74 2e 20 | 54 68 65 20 75 73 65 0a |icient. |The use.|
|00002910| 6f 66 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 20 |of the f|unction |
|00002920| 7b 5c 74 74 20 63 6f 6d | 70 6f 7d 20 69 6d 70 6c |{\tt com|po} impl|
|00002930| 69 65 73 20 74 68 65 20 | 6b 6e 6f 77 6c 65 64 67 |ies the |knowledg|
|00002940| 65 20 6f 66 20 74 68 65 | 20 73 74 72 75 63 74 75 |e of the| structu|
|00002950| 72 65 20 6f 66 20 74 68 | 65 0a 64 69 66 66 65 72 |re of th|e.differ|
|00002960| 65 6e 74 20 50 41 52 49 | 20 74 79 70 65 73 2c 20 |ent PARI| types, |
|00002970| 77 68 69 63 68 20 63 61 | 6e 20 62 65 20 72 65 63 |which ca|n be rec|
|00002980| 61 6c 6c 65 64 20 62 79 | 20 74 79 70 69 6e 67 20 |alled by| typing |
|00002990| 24 5c 62 61 63 6b 73 6c | 61 73 68 24 74 20 75 6e |$\backsl|ash$t un|
|000029a0| 64 65 72 20 47 50 2e 0a | 0a 54 68 65 20 6c 69 62 |der GP..|.The lib|
|000029b0| 72 61 72 79 20 73 79 6e | 74 61 78 20 69 73 20 24 |rary syn|tax is $|
|000029c0| 5c 74 65 62 7b 63 6f 6d | 70 6f 7d 20 28 20 78 2c |\teb{com|po} ( x,|
|000029d0| 20 6e 20 29 24 2c 20 77 | 68 65 72 65 20 24 6e 24 | n )$, w|here $n$|
|000029e0| 20 69 73 20 61 20 33 32 | 2d 62 69 74 20 43 2d 69 | is a 32|-bit C-i|
|000029f0| 6e 74 65 67 65 72 2e 0a | 0a 54 68 65 20 74 77 6f |nteger..|.The two|
|00002a00| 20 6f 74 68 65 72 20 6d | 65 74 68 6f 64 73 20 61 | other m|ethods a|
|00002a10| 72 65 20 6d 6f 72 65 20 | 6e 61 74 75 72 61 6c 20 |re more |natural |
|00002a20| 62 75 74 20 6d 6f 72 65 | 20 72 65 73 74 72 69 63 |but more| restric|
|00002a30| 74 65 64 2e 20 46 69 72 | 73 74 2c 20 74 68 65 0a |ted. Fir|st, the.|
|00002a40| 66 75 6e 63 74 69 6f 6e | 20 24 5c 74 65 62 7b 63 |function| $\teb{c|
|00002a50| 6f 65 66 66 7d 28 78 2c | 6e 29 24 20 67 69 76 65 |oeff}(x,|n)$ give|
|00002a60| 73 20 74 68 65 20 63 6f | 65 66 66 69 63 69 65 6e |s the co|efficien|
|00002a70| 74 20 6f 66 20 64 65 67 | 72 65 65 20 24 6e 24 20 |t of deg|ree $n$ |
|00002a80| 6f 66 20 74 68 65 0a 70 | 6f 6c 79 6e 6f 6d 69 61 |of the.p|olynomia|
|00002a90| 6c 20 6f 72 20 70 6f 77 | 65 72 20 73 65 72 69 65 |l or pow|er serie|
|00002aa0| 73 20 24 78 24 2c 20 77 | 69 74 68 20 72 65 73 70 |s $x$, w|ith resp|
|00002ab0| 65 63 74 20 74 6f 20 74 | 68 65 20 6d 61 69 6e 20 |ect to t|he main |
|00002ac0| 76 61 72 69 61 62 6c 65 | 20 6f 66 20 24 78 24 0a |variable| of $x$.|
|00002ad0| 28 74 6f 20 73 65 65 20 | 74 68 65 20 6f 72 64 65 |(to see |the orde|
|00002ae0| 72 20 6f 66 20 74 68 65 | 20 76 61 72 69 61 62 6c |r of the| variabl|
|00002af0| 65 73 20 6f 72 20 74 6f | 20 63 68 61 6e 67 65 20 |es or to| change |
|00002b00| 69 74 2c 20 75 73 65 20 | 74 68 65 20 66 75 6e 63 |it, use |the func|
|00002b10| 74 69 6f 6e 20 0a 7b 5c | 74 74 20 72 65 6f 72 64 |tion .{\|tt reord|
|00002b20| 65 72 7d 2c 20 73 65 65 | 20 33 2e 39 2e 34 2e 36 |er}, see| 3.9.4.6|
|00002b30| 29 2e 20 49 6e 20 70 61 | 72 74 69 63 75 6c 61 72 |). In pa|rticular|
|00002b40| 20 69 66 20 24 6e 24 20 | 69 73 20 6c 65 73 73 20 | if $n$ |is less |
|00002b50| 74 68 61 6e 20 74 68 65 | 20 76 61 6c 75 61 74 69 |than the| valuati|
|00002b60| 6f 6e 20 6f 66 20 24 78 | 24 20 6f 72 0a 69 6e 20 |on of $x|$ or.in |
|00002b70| 74 68 65 20 63 61 73 65 | 20 6f 66 20 61 20 70 6f |the case| of a po|
|00002b80| 6c 79 6e 6f 6d 69 61 6c | 2c 20 67 72 65 61 74 65 |lynomial|, greate|
|00002b90| 72 20 74 68 61 6e 20 74 | 68 65 20 64 65 67 72 65 |r than t|he degre|
|00002ba0| 65 2c 20 74 68 65 20 72 | 65 73 75 6c 74 20 69 73 |e, the r|esult is|
|00002bb0| 20 7a 65 72 6f 0a 28 63 | 6f 6e 74 72 61 72 79 20 | zero.(c|ontrary |
|00002bc0| 74 6f 20 7b 5c 74 74 20 | 63 6f 6d 70 6f 7d 20 77 |to {\tt |compo} w|
|00002bd0| 68 69 63 68 20 77 6f 75 | 6c 64 20 73 65 6e 64 20 |hich wou|ld send |
|00002be0| 61 6e 20 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |an error| message|
|00002bf0| 29 2e 20 49 66 20 24 78 | 24 20 69 73 20 61 20 70 |). If $x|$ is a p|
|00002c00| 6f 77 65 72 0a 73 65 72 | 69 65 73 20 61 6e 64 20 |ower.ser|ies and |
|00002c10| 24 6e 24 20 69 73 20 67 | 72 65 61 74 65 72 20 74 |$n$ is g|reater t|
|00002c20| 68 61 6e 20 74 68 65 20 | 6c 61 72 67 65 73 74 20 |han the |largest |
|00002c30| 73 69 67 6e 69 66 69 63 | 61 6e 74 20 64 65 67 72 |signific|ant degr|
|00002c40| 65 65 2c 20 74 68 65 6e | 20 61 6e 20 65 72 72 6f |ee, then| an erro|
|00002c50| 72 0a 6d 65 73 73 61 67 | 65 20 69 73 20 69 73 73 |r.messag|e is iss|
|00002c60| 75 65 64 2e 0a 0a 46 6f | 72 20 67 72 65 61 74 65 |ued...Fo|r greate|
|00002c70| 72 20 66 6c 65 78 69 62 | 69 6c 69 74 79 2c 20 76 |r flexib|ility, v|
|00002c80| 65 63 74 6f 72 20 6f 72 | 20 6d 61 74 72 69 78 20 |ector or| matrix |
|00002c90| 74 79 70 65 73 20 61 72 | 65 20 61 6c 73 6f 20 61 |types ar|e also a|
|00002ca0| 63 63 65 70 74 65 64 20 | 66 6f 72 20 24 78 24 2c |ccepted |for $x$,|
|00002cb0| 20 61 6e 64 0a 74 68 65 | 20 6d 65 61 6e 69 6e 67 | and.the| meaning|
|00002cc0| 20 69 73 20 74 68 65 6e | 20 69 64 65 6e 74 69 63 | is then| identic|
|00002cd0| 61 6c 20 77 69 74 68 20 | 74 68 61 74 20 6f 66 20 |al with |that of |
|00002ce0| 7b 5c 74 74 20 63 6f 6d | 70 6f 7d 2e 0a 0a 46 69 |{\tt com|po}...Fi|
|00002cf0| 6e 61 6c 6c 79 20 6e 6f | 74 65 20 74 68 61 74 20 |nally no|te that |
|00002d00| 61 20 73 63 61 6c 61 72 | 20 74 79 70 65 20 69 73 |a scalar| type is|
|00002d10| 20 63 6f 6e 73 69 64 65 | 72 65 64 20 62 79 20 7b | conside|red by {|
|00002d20| 5c 74 74 20 63 6f 65 66 | 66 7d 20 61 73 20 61 20 |\tt coef|f} as a |
|00002d30| 70 6f 6c 79 6e 6f 6d 69 | 61 6c 0a 6f 66 20 64 65 |polynomi|al.of de|
|00002d40| 67 72 65 65 20 7a 65 72 | 6f 2e 0a 0a 54 68 65 20 |gree zer|o...The |
|00002d50| 6c 69 62 72 61 72 79 20 | 73 79 6e 74 61 78 20 69 |library |syntax i|
|00002d60| 73 20 24 5c 74 65 62 7b | 74 72 75 65 63 6f 65 66 |s $\teb{|truecoef|
|00002d70| 66 7d 20 28 78 2c 6e 29 | 24 2e 0a 0a 54 68 65 20 |f} (x,n)|$...The |
|00002d80| 74 68 69 72 64 20 6d 65 | 74 68 6f 64 20 69 73 20 |third me|thod is |
|00002d90| 73 70 65 63 69 66 69 63 | 20 74 6f 20 76 65 63 74 |specific| to vect|
|00002da0| 6f 72 73 20 6f 72 20 6d | 61 74 72 69 63 65 73 20 |ors or m|atrices |
|00002db0| 75 6e 64 65 72 20 47 50 | 2e 20 49 66 20 24 78 24 |under GP|. If $x$|
|00002dc0| 20 69 73 20 61 0a 28 72 | 6f 77 20 6f 72 20 63 6f | is a.(r|ow or co|
|00002dd0| 6c 75 6d 6e 29 20 76 65 | 63 74 6f 72 2c 20 74 68 |lumn) ve|ctor, th|
|00002de0| 65 6e 20 7b 5c 74 74 20 | 5c 72 65 66 7b 78 5b 6e |en {\tt |\ref{x[n|
|00002df0| 5d 7d 7d 20 72 65 70 72 | 65 73 65 6e 74 73 20 74 |]}} repr|esents t|
|00002e00| 68 65 20 24 6e 5e 7b 5c | 74 65 78 74 7b 74 68 7d |he $n^{\|text{th}|
|00002e10| 7d 24 0a 63 6f 6d 70 6f | 6e 65 6e 74 20 6f 66 20 |}$.compo|nent of |
|00002e20| 24 78 24 2c 20 69 2e 65 | 2e 20 7b 5c 74 74 20 63 |$x$, i.e|. {\tt c|
|00002e30| 6f 6d 70 6f 28 78 2c 6e | 29 7d 2e 20 49 74 20 69 |ompo(x,n|)}. It i|
|00002e40| 73 20 6d 6f 72 65 20 6e | 61 74 75 72 61 6c 20 61 |s more n|atural a|
|00002e50| 6e 64 20 73 68 6f 72 74 | 65 72 20 74 6f 0a 77 72 |nd short|er to.wr|
|00002e60| 69 74 65 2e 20 49 66 20 | 24 78 24 20 69 73 20 61 |ite. If |$x$ is a|
|00002e70| 20 6d 61 74 72 69 78 2c | 20 7b 5c 74 74 20 5c 72 | matrix,| {\tt \r|
|00002e80| 65 66 7b 78 5b 6d 2c 6e | 5d 7d 7d 20 72 65 70 72 |ef{x[m,n|]}} repr|
|00002e90| 65 73 65 6e 74 73 20 74 | 68 65 20 63 6f 65 66 66 |esents t|he coeff|
|00002ea0| 69 63 69 65 6e 74 20 6f | 66 0a 72 6f 77 20 7b 5c |icient o|f.row {\|
|00002eb0| 74 74 20 6d 7d 20 61 6e | 64 20 63 6f 6c 75 6d 6e |tt m} an|d column|
|00002ec0| 20 7b 5c 74 74 20 6e 7d | 20 6f 66 20 74 68 65 20 | {\tt n}| of the |
|00002ed0| 6d 61 74 72 69 78 2e 0a | 0a 46 69 6e 61 6c 6c 79 |matrix..|.Finally|
|00002ee0| 20 6e 6f 74 65 20 74 68 | 61 74 20 69 6e 20 6c 69 | note th|at in li|
|00002ef0| 62 72 61 72 79 20 6d 6f | 64 65 2c 20 74 68 65 20 |brary mo|de, the |
|00002f00| 6d 61 63 72 6f 20 7b 5c | 74 74 20 63 6f 65 66 66 |macro {\|tt coeff|
|00002f10| 28 78 2c 6d 2c 6e 29 7d | 20 65 78 69 73 74 73 20 |(x,m,n)}| exists |
|00002f20| 77 69 74 68 0a 65 78 61 | 63 74 6c 79 20 74 68 65 |with.exa|ctly the|
|00002f30| 20 6d 65 61 6e 69 6e 67 | 20 6f 66 20 7b 5c 74 74 | meaning| of {\tt|
|00002f40| 20 78 5b 6d 2c 6e 5d 7d | 20 75 6e 64 65 72 20 47 | x[m,n]}| under G|
|00002f50| 50 20 77 68 65 6e 20 24 | 78 24 20 69 73 20 61 20 |P when $|x$ is a |
|00002f60| 6d 61 74 72 69 78 2e 20 | 54 68 69 73 20 6d 61 63 |matrix. |This mac|
|00002f70| 72 6f 0a 73 68 6f 75 6c | 64 20 6e 6f 74 20 62 65 |ro.shoul|d not be|
|00002f80| 20 63 6f 6e 66 75 73 65 | 64 20 77 69 74 68 20 74 | confuse|d with t|
|00002f90| 68 65 20 74 77 6f 2d 76 | 61 72 69 61 62 6c 65 20 |he two-v|ariable |
|00002fa0| 6d 61 63 72 6f 20 7b 5c | 74 74 20 63 6f 65 66 66 |macro {\|tt coeff|
|00002fb0| 7d 20 75 73 65 64 20 70 | 72 69 6d 61 72 69 6c 79 |} used p|rimarily|
|00002fc0| 0a 66 6f 72 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 73 |.for pol|ynomials|
|00002fd0| 20 61 6e 64 20 70 6f 77 | 65 72 20 73 65 72 69 65 | and pow|er serie|
|00002fe0| 73 20 75 6e 64 65 72 20 | 47 50 2e 5c 73 72 65 66 |s under |GP.\sref|
|00002ff0| 7b 63 6f 65 66 66 20 28 | 69 6e 20 6c 69 62 72 61 |{coeff (|in libra|
|00003000| 72 79 20 6d 6f 64 65 29 | 7d 0a 0a 5c 73 75 62 73 |ry mode)|}..\subs|
|00003010| 65 63 72 65 66 7b 63 6f | 6e 6a 7d 24 28 20 78 20 |ecref{co|nj}$( x |
|00003020| 29 24 20 6f 72 20 24 78 | 5c 5f 24 3a 20 63 6f 6e |)$ or $x|\_$: con|
|00003030| 6a 75 67 61 74 65 20 6f | 66 20 24 78 24 2e 20 54 |jugate o|f $x$. T|
|00003040| 68 65 20 6d 65 61 6e 69 | 6e 67 20 6f 66 20 74 68 |he meani|ng of th|
|00003050| 69 73 0a 69 73 20 63 6c | 65 61 72 2c 0a 65 78 63 |is.is cl|ear,.exc|
|00003060| 65 70 74 20 74 68 61 74 | 20 66 6f 72 20 72 65 61 |ept that| for rea|
|00003070| 6c 20 71 75 61 64 72 61 | 74 69 63 20 6e 75 6d 62 |l quadra|tic numb|
|00003080| 65 72 73 2c 20 69 74 20 | 6d 65 61 6e 73 20 63 6f |ers, it |means co|
|00003090| 6e 6a 75 67 61 74 69 6f | 6e 20 69 6e 20 74 68 65 |njugatio|n in the|
|000030a0| 20 72 65 61 6c 0a 71 75 | 61 64 72 61 74 69 63 20 | real.qu|adratic |
|000030b0| 66 69 65 6c 64 2e 20 54 | 68 69 73 20 66 75 6e 63 |field. T|his func|
|000030c0| 74 69 6f 6e 20 68 61 73 | 20 6e 6f 20 65 66 66 65 |tion has| no effe|
|000030d0| 63 74 20 6f 6e 20 69 6e | 74 65 67 65 72 73 2c 20 |ct on in|tegers, |
|000030e0| 72 65 61 6c 73 2c 20 69 | 6e 74 65 67 65 72 6d 6f |reals, i|ntegermo|
|000030f0| 64 73 2c 0a 66 72 61 63 | 74 69 6f 6e 73 20 6f 72 |ds,.frac|tions or|
|00003100| 20 24 70 24 2d 61 64 69 | 63 73 2e 20 54 68 65 20 | $p$-adi|cs. The |
|00003110| 6f 6e 6c 79 20 66 6f 72 | 62 69 64 64 65 6e 20 74 |only for|bidden t|
|00003120| 79 70 65 20 69 73 20 70 | 6f 6c 79 6d 6f 64 2e 0a |ype is p|olymod..|
|00003130| 0a 54 68 65 20 6c 69 62 | 72 61 72 79 20 73 79 6e |.The lib|rary syn|
|00003140| 74 61 78 20 69 73 20 24 | 5c 74 65 62 7b 67 63 6f |tax is $|\teb{gco|
|00003150| 6e 6a 7d 20 28 20 78 20 | 29 24 2e 0a 0a 5c 73 75 |nj} ( x |)$...\su|
|00003160| 62 73 65 63 72 65 66 7b | 63 76 74 6f 69 7d 24 28 |bsecref{|cvtoi}$(|
|00003170| 20 78 20 29 24 3a 20 49 | 66 20 24 78 24 20 69 73 | x )$: I|f $x$ is|
|00003180| 20 69 6e 20 24 5c 42 62 | 62 20 52 24 2c 20 74 72 | in $\Bb|b R$, tr|
|00003190| 75 6e 63 61 74 65 73 20 | 24 78 24 20 74 6f 20 61 |uncates |$x$ to a|
|000031a0| 6e 0a 69 6e 74 65 67 65 | 72 2e 0a 49 66 20 74 68 |n.intege|r..If th|
|000031b0| 65 20 72 65 73 75 6c 74 | 20 69 73 20 6e 6f 74 20 |e result| is not |
|000031c0| 73 69 67 6e 69 66 69 63 | 61 6e 74 20 62 65 63 61 |signific|ant beca|
|000031d0| 75 73 65 20 74 68 65 20 | 65 78 70 6f 6e 65 6e 74 |use the |exponent|
|000031e0| 20 6f 66 20 24 78 24 20 | 69 73 20 74 6f 6f 20 6c | of $x$ |is too l|
|000031f0| 61 72 67 65 0a 63 6f 6d | 70 61 72 65 64 20 74 6f |arge.com|pared to|
|00003200| 20 69 74 73 20 70 72 65 | 63 69 73 69 6f 6e 2c 20 | its pre|cision, |
|00003210| 6e 6f 20 65 72 72 6f 72 | 20 6f 63 63 75 72 73 2c |no error| occurs,|
|00003220| 20 62 75 74 20 74 68 65 | 20 6e 75 6d 62 65 72 20 | but the| number |
|00003230| 6f 66 20 6c 6f 73 74 0a | 73 69 67 6e 69 66 69 63 |of lost.|signific|
|00003240| 61 6e 74 0a 62 69 74 73 | 20 69 73 20 70 75 74 20 |ant.bits| is put |
|00003250| 61 74 20 74 68 65 20 61 | 64 64 72 65 73 73 20 73 |at the a|ddress s|
|00003260| 70 65 63 69 66 69 65 64 | 20 69 6e 20 61 20 73 65 |pecified| in a se|
|00003270| 63 6f 6e 64 20 61 72 67 | 75 6d 65 6e 74 2e 20 54 |cond arg|ument. T|
|00003280| 68 69 73 20 69 73 20 74 | 72 61 6e 73 70 61 72 65 |his is t|ranspare|
|00003290| 6e 74 0a 75 6e 64 65 72 | 20 47 50 2c 20 62 75 74 |nt.under| GP, but|
|000032a0| 20 74 68 69 73 20 73 65 | 63 6f 6e 64 20 61 72 67 | this se|cond arg|
|000032b0| 75 6d 65 6e 74 20 6d 75 | 73 74 20 62 65 20 67 69 |ument mu|st be gi|
|000032c0| 76 65 6e 20 69 6e 20 6c | 69 62 72 61 72 79 20 6d |ven in l|ibrary m|
|000032d0| 6f 64 65 2e 20 49 66 20 | 6e 6f 0a 64 69 67 69 74 |ode. If |no.digit|
|000032e0| 73 0a 61 72 65 20 6c 6f | 73 74 2c 20 74 68 69 73 |s.are lo|st, this|
|000032f0| 20 73 65 63 6f 6e 64 20 | 61 72 67 75 6d 65 6e 74 | second |argument|
|00003300| 20 63 6f 6e 74 61 69 6e | 73 20 74 68 65 20 6e 65 | contain|s the ne|
|00003310| 67 61 74 69 76 65 20 6f | 66 20 74 68 65 20 6e 75 |gative o|f the nu|
|00003320| 6d 62 65 72 20 6f 66 0a | 73 69 67 6e 69 66 69 63 |mber of.|signific|
|00003330| 61 6e 74 20 62 69 74 73 | 20 6f 66 20 74 68 65 20 |ant bits| of the |
|00003340| 66 72 61 63 74 69 6f 6e | 61 6c 20 70 61 72 74 2e |fraction|al part.|
|00003350| 0a 0a 54 68 65 20 6c 69 | 62 72 61 72 79 20 73 79 |..The li|brary sy|
|00003360| 6e 74 61 78 20 69 73 20 | 24 5c 74 65 62 7b 67 63 |ntax is |$\teb{gc|
|00003370| 76 74 6f 69 7d 20 28 20 | 78 2c 20 5c 26 20 65 20 |vtoi} ( |x, \& e |
|00003380| 29 24 20 77 68 65 72 65 | 20 24 65 24 20 69 73 20 |)$ where| $e$ is |
|00003390| 61 20 33 32 2d 62 69 74 | 0a 43 2d 69 6e 74 65 67 |a 32-bit|.C-integ|
|000033a0| 65 72 2e 0a 0a 5c 73 75 | 62 73 65 63 72 65 66 7b |er...\su|bsecref{|
|000033b0| 64 65 6e 6f 6d 7d 24 28 | 20 78 20 29 24 3a 20 6c |denom}$(| x )$: l|
|000033c0| 6f 77 65 73 74 20 64 65 | 6e 6f 6d 69 6e 61 74 6f |owest de|nominato|
|000033d0| 72 20 6f 66 20 24 78 24 | 2e 20 54 68 65 20 6d 65 |r of $x$|. The me|
|000033e0| 61 6e 69 6e 67 20 6f 66 | 0a 74 68 69 73 20 69 73 |aning of|.this is|
|000033f0| 20 63 6c 65 61 72 20 77 | 68 65 6e 20 24 78 24 20 | clear w|hen $x$ |
|00003400| 69 73 20 61 20 72 61 74 | 69 6f 6e 61 6c 20 6e 75 |is a rat|ional nu|
|00003410| 6d 62 65 72 20 6f 72 20 | 66 75 6e 63 74 69 6f 6e |mber or |function|
|00003420| 2e 0a 57 68 65 6e 20 24 | 78 24 20 69 73 20 61 6e |..When $|x$ is an|
|00003430| 20 69 6e 74 65 67 65 72 | 20 6f 72 20 61 20 70 6f | integer| or a po|
|00003440| 6c 79 6e 6f 6d 69 61 6c | 2c 20 74 68 65 20 72 65 |lynomial|, the re|
|00003450| 73 75 6c 74 20 69 73 20 | 65 71 75 61 6c 20 74 6f |sult is |equal to|
|00003460| 20 31 2e 20 57 68 65 6e | 20 24 78 24 20 69 73 20 | 1. When| $x$ is |
|00003470| 0a 61 20 76 65 63 74 6f | 72 20 6f 72 20 61 20 6d |.a vecto|r or a m|
|00003480| 61 74 72 69 78 2c 20 74 | 68 65 20 6c 6f 77 65 73 |atrix, t|he lowes|
|00003490| 74 20 63 6f 6d 6d 6f 6e | 20 64 65 6e 6f 6d 69 6e |t common| denomin|
|000034a0| 61 74 6f 72 20 6f 66 20 | 74 68 65 20 63 6f 6d 70 |ator of |the comp|
|000034b0| 6f 6e 65 6e 74 73 20 6f | 66 20 24 78 24 0a 69 73 |onents o|f $x$.is|
|000034c0| 20 63 6f 6d 70 75 74 65 | 64 2e 20 41 6c 6c 20 6f | compute|d. All o|
|000034d0| 74 68 65 72 20 74 79 70 | 65 73 20 61 72 65 20 66 |ther typ|es are f|
|000034e0| 6f 72 62 69 64 64 65 6e | 2e 0a 0a 54 68 65 20 6c |orbidden|...The l|
|000034f0| 69 62 72 61 72 79 20 73 | 79 6e 74 61 78 20 69 73 |ibrary s|yntax is|
|00003500| 20 24 5c 74 65 62 7b 64 | 65 6e 6f 6d 7d 28 78 29 | $\teb{d|enom}(x)|
|00003510| 24 2e 0a 0a 5c 73 75 62 | 73 65 63 72 65 66 7b 66 |$...\sub|secref{f|
|00003520| 6c 6f 6f 72 7d 24 28 20 | 78 20 29 24 3a 20 66 6c |loor}$( |x )$: fl|
|00003530| 6f 6f 72 20 6f 66 20 24 | 78 24 2e 20 57 68 65 6e |oor of $|x$. When|
|00003540| 20 24 78 24 20 69 73 20 | 69 6e 20 24 5c 42 62 62 | $x$ is |in $\Bbb|
|00003550| 20 52 24 2c 0a 74 68 65 | 20 72 65 73 75 6c 74 20 | R$,.the| result |
|00003560| 69 73 20 74 68 65 20 6c | 61 72 67 65 73 74 20 69 |is the l|argest i|
|00003570| 6e 74 65 67 65 72 20 73 | 6d 61 6c 6c 65 72 20 74 |nteger s|maller t|
|00003580| 68 61 6e 20 6f 72 20 65 | 71 75 61 6c 20 74 6f 20 |han or e|qual to |
|00003590| 24 78 24 2e 0a 0a 54 68 | 65 20 6c 69 62 72 61 72 |$x$...Th|e librar|
|000035a0| 79 20 73 79 6e 74 61 78 | 20 69 73 20 24 5c 74 65 |y syntax| is $\te|
|000035b0| 62 7b 67 66 6c 6f 6f 72 | 7d 20 28 20 78 20 29 24 |b{gfloor|} ( x )$|
|000035c0| 2e 0a 0a 5c 73 75 62 73 | 65 63 72 65 66 7b 66 72 |...\subs|ecref{fr|
|000035d0| 61 63 7d 24 28 20 78 20 | 29 24 3a 20 66 72 61 63 |ac}$( x |)$: frac|
|000035e0| 74 69 6f 6e 61 6c 20 70 | 61 72 74 20 6f 66 20 24 |tional p|art of $|
|000035f0| 78 24 2e 20 49 64 65 6e | 74 69 63 61 6c 20 74 6f |x$. Iden|tical to|
|00003600| 0a 24 78 2d 5c 74 65 78 | 74 7b 66 6c 6f 6f 72 7d |.$x-\tex|t{floor}|
|00003610| 20 28 20 78 20 29 24 2e | 20 49 66 20 24 78 24 20 | ( x )$.| If $x$ |
|00003620| 69 73 20 72 65 61 6c 2c | 20 74 68 65 20 72 65 73 |is real,| the res|
|00003630| 75 6c 74 20 69 73 20 69 | 6e 20 24 5b 30 2c 31 5b |ult is i|n $[0,1[|
|00003640| 24 2e 0a 0a 54 68 65 20 | 6c 69 62 72 61 72 79 20 |$...The |library |
|00003650| 73 79 6e 74 61 78 20 69 | 73 20 24 5c 74 65 62 7b |syntax i|s $\teb{|
|00003660| 67 66 72 61 63 7d 20 28 | 20 78 20 29 24 2e 0a 0a |gfrac} (| x )$...|
|00003670| 5c 73 75 62 73 65 63 72 | 65 66 7b 69 6d 61 67 7d |\subsecr|ef{imag}|
|00003680| 24 28 20 78 20 29 24 3a | 20 69 6d 61 67 69 6e 61 |$( x )$:| imagina|
|00003690| 72 79 20 70 61 72 74 20 | 6f 66 20 24 78 24 2e 20 |ry part |of $x$. |
|000036a0| 57 68 65 6e 0a 24 78 24 | 20 69 73 20 61 20 71 75 |When.$x$| is a qu|
|000036b0| 61 64 72 61 74 69 63 20 | 6e 75 6d 62 65 72 2c 20 |adratic |number, |
|000036c0| 74 68 69 73 20 69 73 20 | 74 68 65 20 63 6f 65 66 |this is |the coef|
|000036d0| 66 69 63 69 65 6e 74 20 | 6f 66 20 24 5c 6f 6d 65 |ficient |of $\ome|
|000036e0| 67 61 24 20 69 6e 0a 74 | 68 65 20 60 60 63 61 6e |ga$ in.t|he ``can|
|000036f0| 6f 6e 69 63 61 6c 27 27 | 20 69 6e 74 65 67 72 61 |onical''| integra|
|00003700| 6c 20 62 61 73 69 73 20 | 24 28 20 31 2c 20 5c 6f |l basis |$( 1, \o|
|00003710| 6d 65 67 61 20 29 24 2e | 0a 0a 54 68 65 20 6c 69 |mega )$.|..The li|
|00003720| 62 72 61 72 79 20 73 79 | 6e 74 61 78 20 69 73 20 |brary sy|ntax is |
|00003730| 24 5c 74 65 62 7b 67 69 | 6d 61 67 7d 20 28 20 78 |$\teb{gi|mag} ( x|
|00003740| 20 29 24 2e 0a 0a 5c 73 | 75 62 73 65 63 72 65 66 | )$...\s|ubsecref|
|00003750| 7b 6c 65 6e 67 74 68 7d | 24 28 78 29 24 3a 20 6e |{length}|$(x)$: n|
|00003760| 75 6d 62 65 72 20 6f 66 | 20 6e 6f 6e 2d 63 6f 64 |umber of| non-cod|
|00003770| 65 20 77 6f 72 64 73 20 | 69 6e 20 24 78 24 20 72 |e words |in $x$ r|
|00003780| 65 61 6c 6c 79 20 75 73 | 65 64 0a 28 69 2e 65 2e |eally us|ed.(i.e.|
|00003790| 20 74 68 65 20 65 66 66 | 65 63 74 69 76 65 20 6c | the eff|ective l|
|000037a0| 65 6e 67 74 68 20 66 6f | 72 20 69 6e 74 65 67 65 |ength fo|r intege|
|000037b0| 72 73 20 61 6e 64 20 70 | 6f 6c 79 6e 6f 6d 69 61 |rs and p|olynomia|
|000037c0| 6c 73 29 2e 20 49 6e 20 | 70 61 72 74 69 63 75 6c |ls). In |particul|
|000037d0| 61 72 2c 0a 74 68 65 20 | 64 65 67 72 65 65 20 6f |ar,.the |degree o|
|000037e0| 66 20 61 20 70 6f 6c 79 | 6e 6f 6d 69 61 6c 20 69 |f a poly|nomial i|
|000037f0| 73 20 65 71 75 61 6c 20 | 74 6f 20 69 74 73 20 6c |s equal |to its l|
|00003800| 65 6e 67 74 68 20 6d 69 | 6e 75 73 20 31 2e 0a 0a |ength mi|nus 1...|
|00003810| 54 68 65 20 6c 69 62 72 | 61 72 79 20 73 79 6e 74 |The libr|ary synt|
|00003820| 61 78 20 69 73 20 24 5c | 74 65 62 7b 67 6c 65 6e |ax is $\|teb{glen|
|00003830| 67 74 68 7d 28 78 29 24 | 2e 0a 0a 5c 73 75 62 73 |gth}(x)$|...\subs|
|00003840| 65 63 72 65 66 7b 6c 69 | 66 74 7d 24 28 78 29 24 |ecref{li|ft}$(x)$|
|00003850| 3a 20 6c 69 66 74 73 20 | 61 6e 20 65 6c 65 6d 65 |: lifts |an eleme|
|00003860| 6e 74 20 24 78 3d 61 20 | 5c 62 6d 6f 64 20 6e 24 |nt $x=a |\bmod n$|
|00003870| 20 6f 66 20 24 5c 42 62 | 62 20 5a 2f 6e 5c 42 62 | of $\Bb|b Z/n\Bb|
|00003880| 62 20 5a 24 20 74 6f 0a | 24 61 24 20 69 6e 20 24 |b Z$ to.|$a$ in $|
|00003890| 5c 42 62 62 20 5a 24 2c | 20 61 6e 64 20 73 69 6d |\Bbb Z$,| and sim|
|000038a0| 69 6c 61 72 6c 79 20 6c | 69 66 74 73 20 61 20 70 |ilarly l|ifts a p|
|000038b0| 6f 6c 79 6d 6f 64 20 74 | 6f 20 61 20 70 6f 6c 79 |olymod t|o a poly|
|000038c0| 6e 6f 6d 69 61 6c 2e 20 | 49 66 20 24 78 24 20 69 |nomial. |If $x$ i|
|000038d0| 73 0a 6f 66 20 74 79 70 | 65 20 66 72 61 63 74 69 |s.of typ|e fracti|
|000038e0| 6f 6e 2c 20 63 6f 6d 70 | 6c 65 78 2c 20 71 75 61 |on, comp|lex, qua|
|000038f0| 64 72 61 74 69 63 2c 20 | 70 6f 6c 79 6e 6f 6d 69 |dratic, |polynomi|
|00003900| 61 6c 2c 20 70 6f 77 65 | 72 20 73 65 72 69 65 73 |al, powe|r series|
|00003910| 2c 20 72 61 74 69 6f 6e | 61 6c 0a 66 75 6e 63 74 |, ration|al.funct|
|00003920| 69 6f 6e 2c 20 76 65 63 | 74 6f 72 20 6f 72 20 6d |ion, vec|tor or m|
|00003930| 61 74 72 69 78 2c 20 74 | 68 65 20 6c 69 66 74 20 |atrix, t|he lift |
|00003940| 69 73 20 64 6f 6e 65 20 | 66 6f 72 20 65 61 63 68 |is done |for each|
|00003950| 20 63 6f 65 66 66 69 63 | 69 65 6e 74 2e 0a 46 6f | coeffic|ient..Fo|
|00003960| 72 62 69 64 64 65 6e 20 | 74 79 70 65 73 20 66 6f |rbidden |types fo|
|00003970| 72 20 24 78 24 20 61 72 | 65 20 72 65 61 6c 73 20 |r $x$ ar|e reals |
|00003980| 61 6e 64 20 24 70 24 2d | 61 64 69 63 73 2e 20 4e |and $p$-|adics. N|
|00003990| 6f 74 65 20 74 68 61 74 | 20 74 68 65 20 6d 61 69 |ote that| the mai|
|000039a0| 6e 20 76 61 72 69 61 62 | 6c 65 0a 6f 66 20 74 68 |n variab|le.of th|
|000039b0| 65 20 6c 69 66 74 20 6f | 66 20 61 20 70 6f 6c 79 |e lift o|f a poly|
|000039c0| 6d 6f 64 20 77 69 6c 6c | 20 62 65 20 76 61 72 69 |mod will| be vari|
|000039d0| 61 62 6c 65 20 6e 75 6d | 62 65 72 20 30 20 28 69 |able num|ber 0 (i|
|000039e0| 2e 65 2e 20 27 58 27 29 | 20 69 66 20 74 68 65 20 |.e. 'X')| if the |
|000039f0| 72 75 6c 65 73 0a 63 6f | 6e 63 65 72 6e 69 6e 67 |rules.co|ncerning|
|00003a00| 20 74 68 65 20 63 72 65 | 61 74 69 6f 6e 20 6f 66 | the cre|ation of|
|00003a10| 20 70 6f 6c 79 6d 6f 64 | 73 20 65 78 70 6c 61 69 | polymod|s explai|
|00003a20| 6e 65 64 20 69 6e 20 63 | 68 61 70 74 65 72 20 32 |ned in c|hapter 2|
|00003a30| 20 61 72 65 20 6f 62 73 | 65 72 76 65 64 2e 0a 0a | are obs|erved...|
|00003a40| 54 68 65 20 6c 69 62 72 | 61 72 79 20 73 79 6e 74 |The libr|ary synt|
|00003a50| 61 78 20 69 73 20 24 5c | 74 65 62 7b 6c 69 66 74 |ax is $\|teb{lift|
|00003a60| 7d 28 78 29 24 2e 0a 0a | 5c 73 75 62 73 65 63 72 |}(x)$...|\subsecr|
|00003a70| 65 66 7b 6d 6f 64 7d 24 | 28 20 78 2c 20 79 20 29 |ef{mod}$|( x, y )|
|00003a80| 24 3a 20 63 72 65 61 74 | 65 73 20 74 68 65 20 50 |$: creat|es the P|
|00003a90| 41 52 49 20 6f 62 6a 65 | 63 74 20 24 28 20 78 20 |ARI obje|ct $( x |
|00003aa0| 5c 6d 6f 64 20 79 20 29 | 24 2c 0a 69 2e 65 2e 20 |\mod y )|$,.i.e. |
|00003ab0| 61 6e 20 69 6e 74 65 67 | 65 72 6d 6f 64 20 6f 72 |an integ|ermod or|
|00003ac0| 20 61 20 70 6f 6c 79 6d | 6f 64 2e 20 24 79 24 20 | a polym|od. $y$ |
|00003ad0| 6d 75 73 74 20 62 65 20 | 61 6e 20 69 6e 74 65 67 |must be |an integ|
|00003ae0| 65 72 20 6f 72 0a 61 20 | 70 6f 6c 79 6e 6f 6d 69 |er or.a |polynomi|
|00003af0| 61 6c 2e 20 49 66 20 24 | 79 24 20 69 73 20 61 6e |al. If $|y$ is an|
|00003b00| 20 69 6e 74 65 67 65 72 | 2c 20 24 78 24 20 6d 75 | integer|, $x$ mu|
|00003b10| 73 74 20 62 65 20 61 6e | 20 69 6e 74 65 67 65 72 |st be an| integer|
|00003b20| 2e 20 49 66 20 24 79 24 | 20 69 73 20 61 0a 70 6f |. If $y$| is a.po|
|00003b30| 6c 79 6e 6f 6d 69 61 6c | 2c 20 24 78 24 20 6d 75 |lynomial|, $x$ mu|
|00003b40| 73 74 20 62 65 20 61 20 | 73 63 61 6c 61 72 20 6f |st be a |scalar o|
|00003b50| 72 20 61 20 70 6f 6c 79 | 6e 6f 6d 69 61 6c 2e 20 |r a poly|nomial. |
|00003b60| 54 68 65 20 72 65 73 75 | 6c 74 20 69 73 20 70 75 |The resu|lt is pu|
|00003b70| 74 20 6f 6e 0a 74 68 65 | 20 50 41 52 49 20 73 74 |t on.the| PARI st|
|00003b80| 61 63 6b 2e 0a 0a 54 68 | 69 73 20 66 75 6e 63 74 |ack...Th|is funct|
|00003b90| 69 6f 6e 20 69 73 20 6e | 6f 74 20 74 68 65 20 73 |ion is n|ot the s|
|00003ba0| 61 6d 65 20 61 73 20 24 | 78 5c 25 20 79 24 2c 20 |ame as $|x\% y$, |
|00003bb0| 74 68 65 20 72 65 73 75 | 6c 74 20 6f 66 20 77 68 |the resu|lt of wh|
|00003bc0| 69 63 68 20 69 73 20 61 | 6e 0a 69 6e 74 65 67 65 |ich is a|n.intege|
|00003bd0| 72 20 6f 72 20 61 20 70 | 6f 6c 79 6e 6f 6d 69 61 |r or a p|olynomia|
|00003be0| 6c 2e 0a 0a 54 68 65 20 | 6c 69 62 72 61 72 79 20 |l...The |library |
|00003bf0| 73 79 6e 74 61 78 20 69 | 73 20 24 5c 74 65 62 7b |syntax i|s $\teb{|
|00003c00| 67 6d 6f 64 75 6c 63 70 | 7d 20 28 20 78 2c 20 79 |gmodulcp|} ( x, y|
|00003c10| 20 29 24 2e 20 0a 0a 5c | 73 75 62 73 65 63 72 65 | )$. ..\|subsecre|
|00003c20| 66 7b 6d 6f 64 70 7d 24 | 28 78 2c 79 29 24 3a 20 |f{modp}$|(x,y)$: |
|00003c30| 73 61 6d 65 20 65 66 66 | 65 63 74 20 61 73 20 7b |same eff|ect as {|
|00003c40| 5c 74 74 20 6d 6f 64 7d | 2c 20 65 78 63 65 70 74 |\tt mod}|, except|
|00003c50| 20 74 68 61 74 20 74 68 | 65 20 63 72 65 61 74 65 | that th|e create|
|00003c60| 64 0a 72 65 73 75 6c 74 | 20 69 73 20 70 75 74 20 |d.result| is put |
|00003c70| 6f 6e 20 74 68 65 20 68 | 65 61 70 20 61 6e 64 20 |on the h|eap and |
|00003c80| 6e 6f 74 20 6f 6e 20 74 | 68 65 20 73 74 61 63 6b |not on t|he stack|
|00003c90| 2c 20 61 6e 64 20 68 65 | 6e 63 65 20 62 65 63 6f |, and he|nce beco|
|00003ca0| 6d 65 73 20 61 20 70 65 | 72 6d 61 6e 65 6e 74 0a |mes a pe|rmanent.|
|00003cb0| 63 6f 70 79 20 77 68 69 | 63 68 20 63 61 6e 6e 6f |copy whi|ch canno|
|00003cc0| 74 20 62 65 20 65 72 61 | 73 65 64 20 6c 61 74 65 |t be era|sed late|
|00003cd0| 72 20 62 79 20 67 61 72 | 62 61 67 65 20 63 6f 6c |r by gar|bage col|
|00003ce0| 6c 65 63 74 69 6e 67 20 | 28 73 65 65 20 34 2e 32 |lecting |(see 4.2|
|00003cf0| 2e 34 29 2e 20 49 6e 20 | 0a 70 61 72 74 69 63 75 |.4). In |.particu|
|00003d00| 6c 61 72 2c 20 63 61 72 | 65 20 73 68 6f 75 6c 64 |lar, car|e should|
|00003d10| 20 62 65 20 74 61 6b 65 | 6e 20 74 6f 20 61 76 6f | be take|n to avo|
|00003d20| 69 64 20 63 72 65 61 74 | 69 6e 67 20 74 6f 6f 20 |id creat|ing too |
|00003d30| 6d 61 6e 79 20 73 75 63 | 68 20 6f 62 6a 65 63 74 |many suc|h object|
|00003d40| 73 2c 0a 73 69 6e 63 65 | 20 74 68 65 20 68 65 61 |s,.since| the hea|
|00003d50| 70 20 69 73 20 76 65 72 | 79 20 73 6d 61 6c 6c 20 |p is ver|y small |
|00003d60| 28 74 79 70 69 63 61 6c | 6c 79 20 61 20 66 65 77 |(typical|ly a few|
|00003d70| 20 74 68 6f 75 73 61 6e | 64 20 6f 62 6a 65 63 74 | thousan|d object|
|00003d80| 73 20 61 74 20 6d 6f 73 | 74 29 2e 0a 0a 54 68 65 |s at mos|t)...The|
|00003d90| 20 6c 69 62 72 61 72 79 | 20 73 79 6e 74 61 78 20 | library| syntax |
|00003da0| 69 73 20 24 5c 74 65 62 | 7b 67 6d 6f 64 75 6c 6f |is $\teb|{gmodulo|
|00003db0| 7d 28 78 2c 79 29 24 2e | 0a 0a 5c 73 75 62 73 65 |}(x,y)$.|..\subse|
|00003dc0| 63 72 65 66 7b 6e 6f 72 | 6d 7d 24 28 20 78 20 29 |cref{nor|m}$( x )|
|00003dd0| 24 3a 20 61 6c 67 65 62 | 72 61 69 63 20 6e 6f 72 |$: algeb|raic nor|
|00003de0| 6d 20 6f 66 20 24 78 24 | 2c 20 69 2e 65 2e 20 74 |m of $x$|, i.e. t|
|00003df0| 68 65 20 70 72 6f 64 75 | 63 74 20 6f 66 20 24 78 |he produ|ct of $x|
|00003e00| 24 0a 77 69 74 68 20 69 | 74 73 20 63 6f 6e 6a 75 |$.with i|ts conju|
|00003e10| 67 61 74 65 20 28 6e 6f | 20 73 71 75 61 72 65 20 |gate (no| square |
|00003e20| 72 6f 6f 74 73 20 61 72 | 65 20 74 61 6b 65 6e 29 |roots ar|e taken)|
|00003e30| 2c 20 6f 72 20 63 6f 6e | 6a 75 67 61 74 65 73 20 |, or con|jugates |
|00003e40| 66 6f 72 20 70 6f 6c 79 | 6d 6f 64 73 2e 0a 46 6f |for poly|mods..Fo|
|00003e50| 72 20 76 65 63 74 6f 72 | 73 20 61 6e 64 20 6d 61 |r vector|s and ma|
|00003e60| 74 72 69 63 65 73 2c 20 | 74 68 65 20 6e 6f 72 6d |trices, |the norm|
|00003e70| 20 69 73 20 74 61 6b 65 | 6e 20 63 6f 6d 70 6f 6e | is take|n compon|
|00003e80| 65 6e 74 77 69 73 65 20 | 61 6e 64 20 68 65 6e 63 |entwise |and henc|
|00003e90| 65 20 69 73 0a 6e 6f 74 | 20 74 68 65 20 24 4c 5e |e is.not| the $L^|
|00003ea0| 32 24 2d 6e 6f 72 6d 20 | 28 73 65 65 20 33 2e 32 |2$-norm |(see 3.2|
|00003eb0| 2e 31 35 29 2e 20 4e 6f | 74 65 20 74 68 61 74 20 |.15). No|te that |
|00003ec0| 74 68 65 20 6e 6f 72 6d | 20 6f 66 20 61 6e 20 65 |the norm| of an e|
|00003ed0| 6c 65 6d 65 6e 74 20 6f | 66 0a 24 5c 42 62 62 20 |lement o|f.$\Bbb |
|00003ee0| 52 24 20 69 73 20 69 74 | 73 20 73 71 75 61 72 65 |R$ is it|s square|
|00003ef0| 2c 20 73 6f 20 61 73 20 | 74 6f 20 62 65 20 63 6f |, so as |to be co|
|00003f00| 6d 70 61 74 69 62 6c 65 | 20 77 69 74 68 20 74 68 |mpatible| with th|
|00003f10| 65 20 63 6f 6d 70 6c 65 | 78 20 6e 6f 72 6d 2e 0a |e comple|x norm..|
|00003f20| 0a 54 68 65 20 6c 69 62 | 72 61 72 79 20 73 79 6e |.The lib|rary syn|
|00003f30| 74 61 78 20 69 73 20 24 | 5c 74 65 62 7b 67 6e 6f |tax is $|\teb{gno|
|00003f40| 72 6d 7d 20 28 20 78 20 | 29 24 2e 0a 0a 5c 73 75 |rm} ( x |)$...\su|
|00003f50| 62 73 65 63 72 65 66 7b | 6e 6f 72 6d 6c 32 7d 24 |bsecref{|norml2}$|
|00003f60| 28 20 78 20 29 24 3a 20 | 73 71 75 61 72 65 20 6f |( x )$: |square o|
|00003f70| 66 20 74 68 65 20 24 4c | 5e 32 24 2d 6e 6f 72 6d |f the $L|^2$-norm|
|00003f80| 20 6f 66 20 24 78 24 2e | 20 24 78 24 20 6d 75 73 | of $x$.| $x$ mus|
|00003f90| 74 0a 62 65 20 61 20 28 | 72 6f 77 20 6f 72 20 63 |t.be a (|row or c|
|00003fa0| 6f 6c 75 6d 6e 29 20 76 | 65 63 74 6f 72 2e 0a 0a |olumn) v|ector...|
|00003fb0| 54 68 65 20 6c 69 62 72 | 61 72 79 20 73 79 6e 74 |The libr|ary synt|
|00003fc0| 61 78 20 69 73 20 24 5c | 74 65 62 7b 67 6e 6f 72 |ax is $\|teb{gnor|
|00003fd0| 6d 6c 32 7d 20 28 20 78 | 20 29 24 2e 0a 0a 5c 73 |ml2} ( x| )$...\s|
|00003fe0| 75 62 73 65 63 72 65 66 | 7b 6e 75 6d 65 72 7d 24 |ubsecref|{numer}$|
|00003ff0| 28 78 29 24 3a 20 6e 75 | 6d 65 72 61 74 6f 72 20 |(x)$: nu|merator |
|00004000| 6f 66 20 24 78 24 2e 20 | 57 68 65 6e 20 24 78 24 |of $x$. |When $x$|
|00004010| 20 69 73 20 61 20 72 61 | 74 69 6f 6e 61 6c 20 6e | is a ra|tional n|
|00004020| 75 6d 62 65 72 0a 6f 72 | 20 66 75 6e 63 74 69 6f |umber.or| functio|
|00004030| 6e 2c 20 74 68 65 20 6d | 65 61 6e 69 6e 67 20 69 |n, the m|eaning i|
|00004040| 73 20 63 6c 65 61 72 2e | 20 57 68 65 6e 20 24 78 |s clear.| When $x|
|00004050| 24 20 69 73 20 61 6e 20 | 69 6e 74 65 67 65 72 20 |$ is an |integer |
|00004060| 6f 72 20 61 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 20 |or a pol|ynomial |
|00004070| 74 68 65 0a 72 65 73 75 | 6c 74 20 69 73 20 24 78 |the.resu|lt is $x|
|00004080| 24 20 69 74 73 65 6c 66 | 2e 20 57 68 65 6e 20 24 |$ itself|. When $|
|00004090| 78 24 20 69 73 20 61 20 | 76 65 63 74 6f 72 20 6f |x$ is a |vector o|
|000040a0| 72 20 61 20 6d 61 74 72 | 69 78 2c 20 74 68 65 6e |r a matr|ix, then|
|000040b0| 20 7b 5c 74 74 20 6e 75 | 6d 65 72 28 78 29 7d 20 | {\tt nu|mer(x)} |
|000040c0| 69 73 0a 64 65 66 69 6e | 65 64 20 74 6f 20 62 65 |is.defin|ed to be|
|000040d0| 20 7b 5c 74 74 20 64 65 | 6e 6f 6d 28 78 29 2a 78 | {\tt de|nom(x)*x|
|000040e0| 7d 2e 20 41 6c 6c 20 6f | 74 68 65 72 20 74 79 70 |}. All o|ther typ|
|000040f0| 65 73 20 61 72 65 20 66 | 6f 72 62 69 64 64 65 6e |es are f|orbidden|
|00004100| 2e 0a 0a 54 68 65 20 6c | 69 62 72 61 72 79 20 73 |...The l|ibrary s|
|00004110| 79 6e 74 61 78 20 69 73 | 20 24 5c 74 65 62 7b 6e |yntax is| $\teb{n|
|00004120| 75 6d 65 72 7d 28 78 29 | 24 2e 0a 0a 5c 73 75 62 |umer}(x)|$...\sub|
|00004130| 73 65 63 72 65 66 7b 70 | 6f 6c 79 7d 24 28 78 2c |secref{p|oly}$(x,|
|00004140| 76 29 24 3a 20 74 72 61 | 6e 73 66 6f 72 6d 20 74 |v)$: tra|nsform t|
|00004150| 68 65 20 6f 62 6a 65 63 | 74 20 24 78 24 20 69 6e |he objec|t $x$ in|
|00004160| 74 6f 20 61 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 20 |to a pol|ynomial |
|00004170| 77 69 74 68 20 6d 61 69 | 6e 0a 76 61 72 69 61 62 |with mai|n.variab|
|00004180| 6c 65 20 24 76 24 2e 20 | 49 66 20 24 78 24 20 69 |le $v$. |If $x$ i|
|00004190| 73 20 61 20 73 63 61 6c | 61 72 2c 20 74 68 69 73 |s a scal|ar, this|
|000041a0| 20 67 69 76 65 73 20 61 | 20 63 6f 6e 73 74 61 6e | gives a| constan|
|000041b0| 74 20 70 6f 6c 79 6e 6f | 6d 69 61 6c 2e 20 49 66 |t polyno|mial. If|
|000041c0| 20 24 78 24 20 69 73 0a | 61 20 70 6f 77 65 72 20 | $x$ is.|a power |
|000041d0| 73 65 72 69 65 73 2c 20 | 74 68 65 20 65 66 66 65 |series, |the effe|
|000041e0| 63 74 20 69 73 20 69 64 | 65 6e 74 69 63 61 6c 20 |ct is id|entical |
|000041f0| 74 6f 20 7b 5c 74 74 20 | 74 72 75 6e 63 7d 20 28 |to {\tt |trunc} (|
|00004200| 73 65 65 20 33 2e 32 2e | 32 35 29 2c 20 69 2e 65 |see 3.2.|25), i.e|
|00004210| 2e 20 69 74 0a 63 68 6f | 70 73 20 6f 66 66 20 74 |. it.cho|ps off t|
|00004220| 68 65 20 24 4f 28 58 5e | 6b 29 24 2e 20 49 66 20 |he $O(X^|k)$. If |
|00004230| 24 78 24 20 69 73 20 61 | 20 76 65 63 74 6f 72 2c |$x$ is a| vector,|
|00004240| 20 74 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 63 | this fu|nction c|
|00004250| 72 65 61 74 65 73 20 74 | 68 65 20 70 6f 6c 79 6e |reates t|he polyn|
|00004260| 6f 6d 69 61 6c 0a 77 68 | 6f 73 65 20 63 6f 65 66 |omial.wh|ose coef|
|00004270| 66 69 63 69 65 6e 74 73 | 20 61 72 65 20 67 69 76 |ficients| are giv|
|00004280| 65 6e 20 69 6e 20 24 78 | 24 2c 20 77 69 74 68 20 |en in $x|$, with |
|00004290| 24 78 5b 31 5d 24 20 62 | 65 69 6e 67 20 74 68 65 |$x[1]$ b|eing the|
|000042a0| 20 6c 65 61 64 69 6e 67 | 20 63 6f 65 66 66 69 63 | leading| coeffic|
|000042b0| 69 65 6e 74 0a 28 77 68 | 69 63 68 20 63 61 6e 20 |ient.(wh|ich can |
|000042c0| 62 65 20 7a 65 72 6f 29 | 2e 0a 0a 57 61 72 6e 69 |be zero)|...Warni|
|000042d0| 6e 67 3a 20 74 68 69 73 | 20 69 73 20 7b 5c 73 6c |ng: this| is {\sl|
|000042e0| 20 6e 6f 74 7d 20 61 20 | 73 75 62 73 74 69 74 75 | not} a |substitu|
|000042f0| 74 69 6f 6e 20 66 75 6e | 63 74 69 6f 6e 2e 20 49 |tion fun|ction. I|
|00004300| 74 20 69 73 20 69 6e 74 | 65 6e 64 65 64 20 74 6f |t is int|ended to|
|00004310| 20 62 65 20 71 75 69 63 | 6b 20 61 6e 64 0a 64 69 | be quic|k and.di|
|00004320| 72 74 79 2e 20 53 6f 20 | 69 66 20 79 6f 75 20 74 |rty. So |if you t|
|00004330| 72 79 20 7b 5c 74 74 20 | 70 6f 6c 79 28 61 2c 79 |ry {\tt |poly(a,y|
|00004340| 29 7d 20 6f 6e 20 74 68 | 65 20 70 6f 6c 79 6e 6f |)} on th|e polyno|
|00004350| 6d 69 61 6c 20 7b 5c 74 | 74 20 61 3d 78 2b 79 7d |mial {\t|t a=x+y}|
|00004360| 2c 20 79 6f 75 20 77 69 | 6c 6c 20 67 65 74 0a 7b |, you wi|ll get.{|
|00004370| 5c 74 74 20 79 2b 79 7d | 2c 20 77 68 69 63 68 20 |\tt y+y}|, which |
|00004380| 69 73 20 6e 6f 74 20 61 | 20 76 61 6c 69 64 20 50 |is not a| valid P|
|00004390| 41 52 49 2f 47 50 20 6f | 62 6a 65 63 74 2e 0a 0a |ARI/GP o|bject...|
|000043a0| 54 68 65 20 6c 69 62 72 | 61 72 79 20 73 79 6e 74 |The libr|ary synt|
|000043b0| 61 78 20 69 73 20 24 5c | 74 65 62 7b 67 74 6f 70 |ax is $\|teb{gtop|
|000043c0| 6f 6c 79 7d 28 78 2c 76 | 29 24 2c 20 77 68 65 72 |oly}(x,v|)$, wher|
|000043d0| 65 20 24 76 24 20 69 73 | 20 61 20 76 61 72 69 61 |e $v$ is| a varia|
|000043e0| 62 6c 65 20 6e 75 6d 62 | 65 72 2e 0a 0a 5c 73 75 |ble numb|er...\su|
|000043f0| 62 73 65 63 72 65 66 7b | 70 72 65 63 7d 24 28 20 |bsecref{|prec}$( |
|00004400| 78 2c 20 6e 20 29 24 3a | 20 24 78 24 20 62 65 69 |x, n )$:| $x$ bei|
|00004410| 6e 67 20 61 20 50 41 52 | 49 20 6f 62 6a 65 63 74 |ng a PAR|I object|
|00004420| 20 61 6e 64 20 24 6e 24 | 20 61 20 33 32 2d 62 69 | and $n$| a 32-bi|
|00004430| 74 0a 43 2d 69 6e 74 65 | 67 65 72 2c 20 63 72 65 |t.C-inte|ger, cre|
|00004440| 61 74 65 73 20 61 20 6e | 65 77 20 6f 62 6a 65 63 |ates a n|ew objec|
|00004450| 74 20 65 71 75 61 6c 20 | 74 6f 20 24 78 24 20 62 |t equal |to $x$ b|
|00004460| 75 74 20 77 69 74 68 20 | 61 20 6e 65 77 20 70 72 |ut with |a new pr|
|00004470| 65 63 69 73 69 6f 6e 20 | 24 6e 24 2e 0a 54 68 69 |ecision |$n$..Thi|
|00004480| 73 20 69 73 20 74 6f 20 | 62 65 20 75 6e 64 65 72 |s is to |be under|
|00004490| 73 74 6f 6f 64 20 61 73 | 20 66 6f 6c 6c 6f 77 73 |stood as| follows|
|000044a0| 3a 0a 0a 46 6f 72 20 65 | 78 61 63 74 20 74 79 70 |:..For e|xact typ|
|000044b0| 65 73 2c 20 6e 6f 20 63 | 68 61 6e 67 65 2e 20 46 |es, no c|hange. F|
|000044c0| 6f 72 20 24 78 24 20 61 | 20 76 65 63 74 6f 72 20 |or $x$ a| vector |
|000044d0| 6f 72 20 61 20 6d 61 74 | 72 69 78 2c 20 74 68 65 |or a mat|rix, the|
|000044e0| 20 6f 70 65 72 61 74 69 | 6f 6e 0a 69 73 20 64 6f | operati|on.is do|
|000044f0| 6e 65 20 63 6f 6d 70 6f | 6e 65 6e 74 77 69 73 65 |ne compo|nentwise|
|00004500| 2e 0a 0a 46 6f 72 20 72 | 65 61 6c 20 24 78 24 2c |...For r|eal $x$,|
|00004510| 20 24 6e 24 20 69 73 20 | 74 68 65 20 6e 75 6d 62 | $n$ is |the numb|
|00004520| 65 72 20 6f 66 20 64 65 | 73 69 72 65 64 20 73 69 |er of de|sired si|
|00004530| 67 6e 69 66 69 63 61 6e | 74 20 7b 5c 73 6c 20 64 |gnifican|t {\sl d|
|00004540| 65 63 69 6d 61 6c 7d 20 | 64 69 67 69 74 73 2e 0a |ecimal} |digits..|
|00004550| 49 66 20 24 6e 24 20 69 | 73 20 73 6d 61 6c 6c 65 |If $n$ i|s smalle|
|00004560| 72 20 74 68 61 6e 20 74 | 68 65 20 70 72 65 63 69 |r than t|he preci|
|00004570| 73 69 6f 6e 20 6f 66 20 | 24 78 24 2c 20 24 78 24 |sion of |$x$, $x$|
|00004580| 20 69 73 20 74 72 75 6e | 63 61 74 65 64 2c 20 6f | is trun|cated, o|
|00004590| 74 68 65 72 77 69 73 65 | 0a 24 78 24 20 69 73 20 |therwise|.$x$ is |
|000045a0| 65 78 74 65 6e 64 65 64 | 20 77 69 74 68 20 7a 65 |extended| with ze|
|000045b0| 72 6f 73 2e 0a 0a 46 6f | 72 20 24 78 24 20 61 20 |ros...Fo|r $x$ a |
|000045c0| 24 70 24 2d 61 64 69 63 | 20 6f 72 20 61 20 70 6f |$p$-adic| or a po|
|000045d0| 77 65 72 20 73 65 72 69 | 65 73 2c 20 24 6e 24 20 |wer seri|es, $n$ |
|000045e0| 69 73 20 74 68 65 20 64 | 65 73 69 72 65 64 20 6e |is the d|esired n|
|000045f0| 75 6d 62 65 72 20 6f 66 | 0a 73 69 67 6e 69 66 69 |umber of|.signifi|
|00004600| 63 61 6e 74 20 24 70 24 | 2d 61 64 69 63 20 6f 72 |cant $p$|-adic or|
|00004610| 20 24 58 24 2d 61 64 69 | 63 20 64 69 67 69 74 73 | $X$-adi|c digits|
|00004620| 2c 20 77 68 65 72 65 20 | 24 58 24 20 69 73 20 74 |, where |$X$ is t|
|00004630| 68 65 20 6d 61 69 6e 20 | 76 61 72 69 61 62 6c 65 |he main |variable|
|00004640| 20 6f 66 20 24 78 24 2e | 0a 0a 4e 6f 74 65 20 74 | of $x$.|..Note t|
|00004650| 68 61 74 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |hat the |function|
|00004660| 20 7b 5c 74 74 20 70 72 | 65 63 7d 20 6e 65 76 65 | {\tt pr|ec} neve|
|00004670| 72 20 63 68 61 6e 67 65 | 73 20 74 68 65 20 74 79 |r change|s the ty|
|00004680| 70 65 20 6f 66 20 74 68 | 65 20 72 65 73 75 6c 74 |pe of th|e result|
|00004690| 2e 20 49 6e 0a 70 61 72 | 74 69 63 75 6c 61 72 0a |. In.par|ticular.|
|000046a0| 69 74 20 69 73 20 6e 6f | 74 20 70 6f 73 73 69 62 |it is no|t possib|
|000046b0| 6c 65 20 74 6f 20 75 73 | 65 20 7b 5c 74 74 20 70 |le to us|e {\tt p|
|000046c0| 72 65 63 7d 20 74 6f 20 | 6f 62 74 61 69 6e 20 61 |rec} to |obtain a|
|000046d0| 20 70 6f 6c 79 6e 6f 6d | 69 61 6c 20 66 72 6f 6d | polynom|ial from|
|000046e0| 20 61 20 70 6f 77 65 72 | 20 73 65 72 69 65 73 2e | a power| series.|
|000046f0| 0a 46 6f 72 20 74 68 61 | 74 2c 20 73 65 65 20 7b |.For tha|t, see {|
|00004700| 5c 74 74 20 74 72 75 6e | 63 7d 20 28 33 2e 32 2e |\tt trun|c} (3.2.|
|00004710| 32 35 20 62 65 6c 6f 77 | 29 2e 0a 0a 54 68 65 20 |25 below|)...The |
|00004720| 6c 69 62 72 61 72 79 20 | 73 79 6e 74 61 78 20 69 |library |syntax i|
|00004730| 73 20 24 5c 74 65 62 7b | 67 70 72 65 63 7d 20 28 |s $\teb{|gprec} (|
|00004740| 20 78 2c 20 6e 20 29 24 | 2c 20 77 68 65 72 65 20 | x, n )$|, where |
|00004750| 24 6e 24 20 69 73 20 61 | 20 43 2d 69 6e 74 65 67 |$n$ is a| C-integ|
|00004760| 65 72 2e 0a 0a 5c 73 75 | 62 73 65 63 72 65 66 7b |er...\su|bsecref{|
|00004770| 71 75 61 64 67 65 6e 7d | 24 28 78 29 24 3a 20 63 |quadgen}|$(x)$: c|
|00004780| 72 65 61 74 65 73 20 74 | 68 65 20 71 75 61 64 72 |reates t|he quadr|
|00004790| 61 74 69 63 20 6e 75 6d | 62 65 72 20 5c 73 72 65 |atic num|ber \sre|
|000047a0| 66 7b 6f 6d 65 67 61 7d | 0a 24 5c 6f 6d 65 67 61 |f{omega}|.$\omega|
|000047b0| 3d 28 61 2b 5c 73 71 72 | 74 7b 78 7d 29 2f 32 24 |=(a+\sqr|t{x})/2$|
|000047c0| 20 77 68 65 72 65 20 24 | 61 3d 30 24 20 69 66 20 | where $|a=0$ if |
|000047d0| 24 78 5c 65 71 75 69 76 | 30 5c 6d 6f 64 34 24 2c |$x\equiv|0\mod4$,|
|000047e0| 20 0a 24 61 3d 31 24 20 | 69 66 20 24 78 5c 65 71 | .$a=1$ |if $x\eq|
|000047f0| 75 69 76 31 5c 6d 6f 64 | 34 24 2c 20 73 6f 20 74 |uiv1\mod|4$, so t|
|00004800| 68 61 74 20 24 28 31 2c | 5c 6f 6d 65 67 61 29 24 |hat $(1,|\omega)$|
|00004810| 20 69 73 20 61 6e 20 69 | 6e 74 65 67 72 61 6c 20 | is an i|ntegral |
|00004820| 62 61 73 69 73 20 66 6f | 72 0a 74 68 65 20 71 75 |basis fo|r.the qu|
|00004830| 61 64 72 61 74 69 63 20 | 6f 72 64 65 72 20 6f 66 |adratic |order of|
|00004840| 20 64 69 73 63 72 69 6d | 69 6e 61 6e 74 20 24 78 | discrim|inant $x|
|00004850| 24 2e 20 24 78 24 20 6d | 75 73 74 20 62 65 20 61 |$. $x$ m|ust be a|
|00004860| 6e 20 69 6e 74 65 67 65 | 72 20 63 6f 6e 67 72 75 |n intege|r congru|
|00004870| 65 6e 74 20 74 6f 20 0a | 30 20 6f 72 20 31 20 6d |ent to .|0 or 1 m|
|00004880| 6f 64 75 6c 6f 20 34 2e | 0a 0a 54 68 65 20 6c 69 |odulo 4.|..The li|
|00004890| 62 72 61 72 79 20 73 79 | 6e 74 61 78 20 69 73 20 |brary sy|ntax is |
|000048a0| 24 5c 74 65 62 7b 71 75 | 61 64 67 65 6e 7d 28 78 |$\teb{qu|adgen}(x|
|000048b0| 29 24 2e 0a 0a 5c 73 75 | 62 73 65 63 72 65 66 7b |)$...\su|bsecref{|
|000048c0| 71 75 61 64 70 6f 6c 79 | 7d 24 28 20 78 20 29 24 |quadpoly|}$( x )$|
|000048d0| 3a 20 63 72 65 61 74 65 | 73 20 74 68 65 20 60 60 |: create|s the ``|
|000048e0| 63 61 6e 6f 6e 69 63 61 | 6c 27 27 20 71 75 61 64 |canonica|l'' quad|
|000048f0| 72 61 74 69 63 0a 70 6f | 6c 79 6e 6f 6d 69 61 6c |ratic.po|lynomial|
|00004900| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 74 | corresp|onding t|
|00004910| 6f 20 74 68 65 20 64 69 | 73 63 72 69 6d 69 6e 61 |o the di|scrimina|
|00004920| 6e 74 20 24 78 24 2c 20 | 69 2e 65 2e 20 74 68 65 |nt $x$, |i.e. the|
|00004930| 20 6d 69 6e 69 6d 61 6c | 20 70 6f 6c 79 6e 6f 6d | minimal| polynom|
|00004940| 69 61 6c 0a 6f 66 20 7b | 5c 74 74 20 71 75 61 64 |ial.of {|\tt quad|
|00004950| 67 65 6e 28 78 29 7d 2e | 20 24 78 24 20 6d 75 73 |gen(x)}.| $x$ mus|
|00004960| 74 20 62 65 20 61 6e 20 | 69 6e 74 65 67 65 72 20 |t be an |integer |
|00004970| 63 6f 6e 67 72 75 65 6e | 74 20 74 6f 20 30 20 6f |congruen|t to 0 o|
|00004980| 72 20 31 20 6d 6f 64 75 | 6c 6f 20 34 2e 0a 0a 54 |r 1 modu|lo 4...T|
|00004990| 68 65 20 6c 69 62 72 61 | 72 79 20 73 79 6e 74 61 |he libra|ry synta|
|000049a0| 78 20 69 73 20 24 5c 74 | 65 62 7b 71 75 61 64 64 |x is $\t|eb{quadd|
|000049b0| 69 73 63 7d 20 28 20 78 | 20 29 24 2e 0a 0a 5c 73 |isc} ( x| )$...\s|
|000049c0| 75 62 73 65 63 72 65 66 | 7b 72 65 61 6c 7d 24 28 |ubsecref|{real}$(|
|000049d0| 20 78 20 29 24 3a 20 72 | 65 61 6c 20 70 61 72 74 | x )$: r|eal part|
|000049e0| 20 6f 66 20 24 78 24 2e | 20 49 6e 20 74 68 65 20 | of $x$.| In the |
|000049f0| 63 61 73 65 20 77 68 65 | 72 65 0a 24 78 24 20 69 |case whe|re.$x$ i|
|00004a00| 73 20 61 20 71 75 61 64 | 72 61 74 69 63 20 6e 75 |s a quad|ratic nu|
|00004a10| 6d 62 65 72 2c 20 74 68 | 69 73 20 69 73 20 74 68 |mber, th|is is th|
|00004a20| 65 20 63 6f 65 66 66 69 | 63 69 65 6e 74 20 6f 66 |e coeffi|cient of|
|00004a30| 20 24 31 24 20 69 6e 0a | 74 68 65 20 60 60 63 61 | $1$ in.|the ``ca|
|00004a40| 6e 6f 6e 69 63 61 6c 27 | 27 20 69 6e 74 65 67 72 |nonical'|' integr|
|00004a50| 61 6c 20 62 61 73 69 73 | 20 24 28 20 31 2c 20 5c |al basis| $( 1, \|
|00004a60| 6f 6d 65 67 61 20 29 24 | 2e 0a 0a 54 68 65 20 6c |omega )$|...The l|
|00004a70| 69 62 72 61 72 79 20 73 | 79 6e 74 61 78 20 69 73 |ibrary s|yntax is|
|00004a80| 20 24 5c 74 65 62 7b 67 | 72 65 61 6c 7d 20 28 20 | $\teb{g|real} ( |
|00004a90| 78 20 29 24 2e 0a 0a 5c | 73 75 62 73 65 63 72 65 |x )$...\|subsecre|
|00004aa0| 66 7b 72 6e 64 74 6f 69 | 7d 24 28 20 78 20 29 24 |f{rndtoi|}$( x )$|
|00004ab0| 3a 20 73 61 6d 65 20 61 | 73 20 7b 5c 74 74 20 63 |: same a|s {\tt c|
|00004ac0| 76 74 6f 69 7d 20 28 73 | 65 65 20 33 2e 32 2e 35 |vtoi} (s|ee 3.2.5|
|00004ad0| 29 20 65 78 63 65 70 74 | 0a 74 68 61 74 20 74 72 |) except|.that tr|
|00004ae0| 75 6e 63 61 74 69 6f 6e | 20 69 73 20 72 65 70 6c |uncation| is repl|
|00004af0| 61 63 65 64 20 62 79 20 | 72 6f 75 6e 64 69 6e 67 |aced by |rounding|
|00004b00| 20 28 73 65 65 20 33 2e | 32 2e 32 33 29 2e 0a 0a | (see 3.|2.23)...|
|00004b10| 54 68 65 20 6c 69 62 72 | 61 72 79 20 73 79 6e 74 |The libr|ary synt|
|00004b20| 61 78 20 69 73 20 24 5c | 74 65 62 7b 67 72 6e 64 |ax is $\|teb{grnd|
|00004b30| 74 6f 69 7d 20 28 20 78 | 2c 20 5c 26 20 65 20 29 |toi} ( x|, \& e )|
|00004b40| 24 2e 0a 0a 5c 73 75 62 | 73 65 63 72 65 66 7b 72 |$...\sub|secref{r|
|00004b50| 6f 75 6e 64 7d 24 28 20 | 78 20 29 24 3a 20 49 66 |ound}$( |x )$: If|
|00004b60| 20 24 78 24 20 69 73 20 | 69 6e 20 24 5c 42 62 62 | $x$ is |in $\Bbb|
|00004b70| 20 52 24 2c 20 72 6f 75 | 6e 64 73 20 24 78 24 0a | R$, rou|nds $x$.|
|00004b80| 74 6f 20 74 68 65 20 6e | 65 61 72 65 73 74 20 69 |to the n|earest i|
|00004b90| 6e 74 65 67 65 72 2e 20 | 49 66 20 74 68 65 20 65 |nteger. |If the e|
|00004ba0| 78 70 6f 6e 65 6e 74 20 | 6f 66 20 24 78 24 20 69 |xponent |of $x$ i|
|00004bb0| 73 20 74 6f 6f 20 6c 61 | 72 67 65 20 63 6f 6d 70 |s too la|rge comp|
|00004bc0| 61 72 65 64 0a 74 6f 20 | 69 74 73 20 70 72 65 63 |ared.to |its prec|
|00004bd0| 69 73 69 6f 6e 2c 20 74 | 68 65 20 72 65 73 75 6c |ision, t|he resul|
|00004be0| 74 20 69 73 20 75 6e 64 | 65 66 69 6e 65 64 20 61 |t is und|efined a|
|00004bf0| 6e 64 20 61 6e 20 65 72 | 72 6f 72 20 6d 65 73 73 |nd an er|ror mess|
|00004c00| 61 67 65 20 6f 63 63 75 | 72 73 2e 0a 55 73 65 20 |age occu|rs..Use |
|00004c10| 7b 5c 74 74 20 72 6e 64 | 74 6f 69 7d 20 28 33 2e |{\tt rnd|toi} (3.|
|00004c20| 32 2e 32 32 29 20 74 6f | 20 73 75 70 70 72 65 73 |2.22) to| suppres|
|00004c30| 73 20 74 68 69 73 20 65 | 72 72 6f 72 20 68 61 6e |s this e|rror han|
|00004c40| 64 6c 69 6e 67 2e 0a 0a | 49 6d 70 6f 72 74 61 6e |dling...|Importan|
|00004c50| 74 20 72 65 6d 61 72 6b | 3a 20 6e 6f 74 65 20 74 |t remark|: note t|
|00004c60| 68 61 74 2c 20 63 6f 6e | 74 72 61 72 79 20 74 6f |hat, con|trary to|
|00004c70| 20 74 68 65 20 6f 74 68 | 65 72 20 74 72 75 6e 63 | the oth|er trunc|
|00004c80| 61 74 69 6f 6e 20 66 75 | 6e 63 74 69 6f 6e 73 0a |ation fu|nctions.|
|00004c90| 28 65 78 63 65 70 74 20 | 7b 5c 74 74 20 72 6e 64 |(except |{\tt rnd|
|00004ca0| 74 6f 69 7d 20 77 68 69 | 63 68 20 69 73 20 65 73 |toi} whi|ch is es|
|00004cb0| 73 65 6e 74 69 61 6c 6c | 79 20 74 68 65 20 73 61 |sentiall|y the sa|
|00004cc0| 6d 65 29 2c 20 74 68 69 | 73 20 66 75 6e 63 74 69 |me), thi|s functi|
|00004cd0| 6f 6e 20 6f 70 65 72 61 | 74 65 73 0a 6f 6e 20 65 |on opera|tes.on e|
|00004ce0| 76 65 72 79 20 63 6f 65 | 66 66 69 63 69 65 6e 74 |very coe|fficient|
|00004cf0| 20 61 74 20 65 76 65 72 | 79 20 6c 65 76 65 6c 20 | at ever|y level |
|00004d00| 6f 66 20 61 20 50 41 52 | 49 20 6f 62 6a 65 63 74 |of a PAR|I object|
|00004d10| 2e 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 0a 24 24 |. For ex|ample.$$|
|00004d20| 5c 74 65 78 74 7b 74 72 | 75 6e 63 7d 5c 6c 65 66 |\text{tr|unc}\lef|
|00004d30| 74 28 5c 64 66 72 61 63 | 7b 32 2e 34 2a 58 5e 32 |t(\dfrac|{2.4*X^2|
|00004d40| 2d 31 2e 37 7d 7b 31 2e | 32 2a 58 7d 5c 72 69 67 |-1.7}{1.|2*X}\rig|
|00004d50| 68 74 29 3d 32 2e 30 2a | 58 2c 24 24 20 77 68 69 |ht)=2.0*|X,$$ whi|
|00004d60| 6c 65 0a 24 24 5c 74 65 | 78 74 7b 72 6f 75 6e 64 |le.$$\te|xt{round|
|00004d70| 7d 5c 6c 65 66 74 28 5c | 64 66 72 61 63 7b 32 2e |}\left(\|dfrac{2.|
|00004d80| 34 2a 58 5e 32 2d 31 2e | 37 7d 7b 31 2e 32 2a 58 |4*X^2-1.|7}{1.2*X|
|00004d90| 7d 5c 72 69 67 68 74 29 | 3d 5c 64 66 72 61 63 7b |}\right)|=\dfrac{|
|00004da0| 32 2a 58 5e 32 2d 32 7d | 7b 58 7d 2e 24 24 0a 41 |2*X^2-2}|{X}.$$.A|
|00004db0| 6e 20 69 6d 70 6f 72 74 | 61 6e 74 20 75 73 65 20 |n import|ant use |
|00004dc0| 6f 66 20 7b 5c 74 74 20 | 72 6f 75 6e 64 7d 20 69 |of {\tt |round} i|
|00004dd0| 73 20 74 6f 20 67 65 74 | 20 65 78 61 63 74 20 72 |s to get| exact r|
|00004de0| 65 73 75 6c 74 73 20 61 | 66 74 65 72 20 61 20 6c |esults a|fter a l|
|00004df0| 6f 6e 67 0a 61 70 70 72 | 6f 78 69 6d 61 74 65 20 |ong.appr|oximate |
|00004e00| 63 6f 6d 70 75 74 61 74 | 69 6f 6e 2c 20 77 68 65 |computat|ion, whe|
|00004e10| 6e 20 74 68 65 6f 72 79 | 20 74 65 6c 6c 73 20 79 |n theory| tells y|
|00004e20| 6f 75 20 74 68 61 74 20 | 74 68 65 20 63 6f 65 66 |ou that |the coef|
|00004e30| 66 69 63 69 65 6e 74 73 | 0a 6d 75 73 74 20 62 65 |ficients|.must be|
|00004e40| 20 69 6e 74 65 67 65 72 | 73 2e 0a 0a 54 68 65 20 | integer|s...The |
|00004e50| 6c 69 62 72 61 72 79 20 | 73 79 6e 74 61 78 20 69 |library |syntax i|
|00004e60| 73 20 24 5c 74 65 62 7b | 67 72 6f 75 6e 64 7d 20 |s $\teb{|ground} |
|00004e70| 28 20 78 20 29 24 2e 0a | 0a 5c 73 75 62 73 65 63 |( x )$..|.\subsec|
|00004e80| 72 65 66 7b 73 65 72 69 | 65 73 7d 24 28 78 2c 76 |ref{seri|es}$(x,v|
|00004e90| 29 24 3a 20 74 72 61 6e | 73 66 6f 72 6d 20 74 68 |)$: tran|sform th|
|00004ea0| 65 20 6f 62 6a 65 63 74 | 20 24 78 24 20 69 6e 74 |e object| $x$ int|
|00004eb0| 6f 20 61 20 70 6f 77 65 | 72 20 73 65 72 69 65 73 |o a powe|r series|
|00004ec0| 20 77 69 74 68 0a 6d 61 | 69 6e 20 76 61 72 69 61 | with.ma|in varia|
|00004ed0| 62 6c 65 20 24 76 24 2e | 20 49 66 20 24 78 24 20 |ble $v$.| If $x$ |
|00004ee0| 69 73 20 61 20 73 63 61 | 6c 61 72 2c 20 74 68 69 |is a sca|lar, thi|
|00004ef0| 73 20 67 69 76 65 73 20 | 61 20 63 6f 6e 73 74 61 |s gives |a consta|
|00004f00| 6e 74 20 70 6f 77 65 72 | 20 73 65 72 69 65 73 0a |nt power| series.|
|00004f10| 77 69 74 68 20 70 72 65 | 63 69 73 69 6f 6e 20 67 |with pre|cision g|
|00004f20| 69 76 65 6e 20 62 79 20 | 74 68 65 20 67 6c 6f 62 |iven by |the glob|
|00004f30| 61 6c 20 76 61 72 69 61 | 62 6c 65 20 7b 5c 74 74 |al varia|ble {\tt|
|00004f40| 20 70 72 65 63 64 6c 7d | 20 28 74 72 61 6e 73 70 | precdl}| (transp|
|00004f50| 61 72 65 6e 74 20 75 6e | 64 65 72 20 47 50 29 2e |arent un|der GP).|
|00004f60| 0a 49 66 20 24 78 24 20 | 69 73 20 61 20 70 6f 6c |.If $x$ |is a pol|
|00004f70| 79 6e 6f 6d 69 61 6c 2c | 20 74 68 65 20 70 72 65 |ynomial,| the pre|
|00004f80| 63 69 73 69 6f 6e 20 69 | 73 20 74 68 65 20 67 72 |cision i|s the gr|
|00004f90| 65 61 74 65 73 74 20 6f | 66 20 7b 5c 74 74 20 70 |eatest o|f {\tt p|
|00004fa0| 72 65 63 64 6c 7d 20 61 | 6e 64 20 74 68 65 0a 64 |recdl} a|nd the.d|
|00004fb0| 65 67 72 65 65 20 6f 66 | 20 74 68 65 20 70 6f 6c |egree of| the pol|
|00004fc0| 79 6e 6f 6d 69 61 6c 2e | 20 49 66 20 24 78 24 20 |ynomial.| If $x$ |
|00004fd0| 69 73 20 61 20 76 65 63 | 74 6f 72 2c 20 74 68 65 |is a vec|tor, the|
|00004fe0| 20 70 72 65 63 69 73 69 | 6f 6e 20 69 73 20 73 69 | precisi|on is si|
|00004ff0| 6d 69 6c 61 72 6c 79 20 | 67 69 76 65 6e 2c 0a 61 |milarly |given,.a|
|00005000| 6e 64 20 74 68 65 20 63 | 6f 65 66 66 69 63 69 65 |nd the c|oefficie|
|00005010| 6e 74 73 20 6f 66 20 74 | 68 65 20 76 65 63 74 6f |nts of t|he vecto|
|00005020| 72 20 61 72 65 20 75 6e | 64 65 72 73 74 6f 6f 64 |r are un|derstood|
|00005030| 20 74 6f 20 62 65 20 74 | 68 65 20 63 6f 65 66 66 | to be t|he coeff|
|00005040| 69 63 69 65 6e 74 73 20 | 6f 66 0a 74 68 65 20 70 |icients |of.the p|
|00005050| 6f 77 65 72 20 73 65 72 | 69 65 73 20 73 74 61 72 |ower ser|ies star|
|00005060| 74 69 6e 67 20 66 72 6f | 6d 20 74 68 65 20 63 6f |ting fro|m the co|
|00005070| 6e 73 74 61 6e 74 20 74 | 65 72 6d 20 28 69 2e 65 |nstant t|erm (i.e|
|00005080| 2e 20 74 68 65 20 72 65 | 76 65 72 73 65 20 6f 66 |. the re|verse of|
|00005090| 20 74 68 65 0a 66 75 6e | 63 74 69 6f 6e 20 7b 5c | the.fun|ction {\|
|000050a0| 74 74 20 70 6f 6c 79 7d | 2c 20 73 65 65 20 33 2e |tt poly}|, see 3.|
|000050b0| 32 2e 31 37 20 61 62 6f | 76 65 29 2e 0a 0a 54 68 |2.17 abo|ve)...Th|
|000050c0| 65 20 77 61 72 6e 69 6e | 67 20 67 69 76 65 6e 20 |e warnin|g given |
|000050d0| 66 6f 72 20 7b 5c 74 74 | 20 70 6f 6c 79 7d 20 61 |for {\tt| poly} a|
|000050e0| 70 70 6c 69 65 73 20 68 | 65 72 65 3a 20 74 68 69 |pplies h|ere: thi|
|000050f0| 73 20 69 73 20 6e 6f 74 | 20 61 20 73 75 62 73 74 |s is not| a subst|
|00005100| 69 74 75 74 69 6f 6e 0a | 66 75 6e 63 74 69 6f 6e |itution.|function|
|00005110| 2e 0a 0a 54 68 65 20 6c | 69 62 72 61 72 79 20 73 |...The l|ibrary s|
|00005120| 79 6e 74 61 78 20 69 73 | 20 24 5c 74 65 62 7b 67 |yntax is| $\teb{g|
|00005130| 74 6f 73 65 72 7d 28 78 | 2c 76 29 24 2c 20 77 68 |toser}(x|,v)$, wh|
|00005140| 65 72 65 20 24 76 24 20 | 69 73 20 61 20 76 61 72 |ere $v$ |is a var|
|00005150| 69 61 62 6c 65 20 6e 75 | 6d 62 65 72 2e 0a 0a 5c |iable nu|mber...\|
|00005160| 73 75 62 73 65 63 72 65 | 66 7b 73 65 74 70 72 65 |subsecre|f{setpre|
|00005170| 63 69 73 69 6f 6e 7d 24 | 28 6e 29 24 3a 20 73 65 |cision}$|(n)$: se|
|00005180| 74 73 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 64 |ts the c|urrent d|
|00005190| 65 66 61 75 6c 74 20 70 | 72 65 63 69 73 69 6f 6e |efault p|recision|
|000051a0| 20 65 71 75 61 6c 20 74 | 6f 20 24 6e 24 0a 64 65 | equal t|o $n$.de|
|000051b0| 63 69 6d 61 6c 20 64 69 | 67 69 74 73 20 69 66 20 |cimal di|gits if |
|000051c0| 24 6e 3e 30 24 2e 20 49 | 6e 20 61 6e 79 20 63 61 |$n>0$. I|n any ca|
|000051d0| 73 65 2c 20 69 74 20 72 | 65 74 75 72 6e 73 20 74 |se, it r|eturns t|
|000051e0| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 74 68 65 20 |he value| of the |
|000051f0| 63 75 72 72 65 6e 74 0a | 64 65 66 61 75 6c 74 20 |current.|default |
|00005200| 70 72 65 63 69 73 69 6f | 6e 2e 20 41 70 61 72 74 |precisio|n. Apart|
|00005210| 20 66 72 6f 6d 20 74 68 | 65 20 66 61 63 74 20 74 | from th|e fact t|
|00005220| 68 61 74 20 69 74 20 72 | 65 74 75 72 6e 73 20 61 |hat it r|eturns a|
|00005230| 20 76 61 6c 75 65 2c 20 | 74 68 69 73 20 69 73 0a | value, |this is.|
|00005240| 69 64 65 6e 74 69 63 61 | 6c 20 74 6f 20 74 68 65 |identica|l to the|
|00005250| 20 24 5c 62 61 63 6b 73 | 6c 61 73 68 24 70 72 65 | $\backs|lash$pre|
|00005260| 63 69 73 69 6f 6e 3d 24 | 6e 24 20 63 6f 6d 6d 61 |cision=$|n$ comma|
|00005270| 6e 64 2c 20 77 69 74 68 | 20 74 68 65 20 64 69 66 |nd, with| the dif|
|00005280| 66 65 72 65 6e 63 65 20 | 74 68 61 74 0a 69 74 20 |ference |that.it |
|00005290| 63 61 6e 20 62 65 20 75 | 73 65 64 20 69 6e 73 69 |can be u|sed insi|
|000052a0| 64 65 20 61 6e 79 20 47 | 50 20 65 78 70 72 65 73 |de any G|P expres|
|000052b0| 73 69 6f 6e 20 6f 72 20 | 70 72 6f 67 72 61 6d 2e |sion or |program.|
|000052c0| 0a 0a 54 68 65 20 6c 69 | 62 72 61 72 79 20 73 79 |..The li|brary sy|
|000052d0| 6e 74 61 78 20 69 73 20 | 24 5c 74 65 62 7b 73 65 |ntax is |$\teb{se|
|000052e0| 74 70 72 65 63 72 7d 28 | 6e 29 24 2c 20 77 68 65 |tprecr}(|n)$, whe|
|000052f0| 72 65 20 24 6e 24 20 69 | 73 20 61 20 43 2d 69 6e |re $n$ i|s a C-in|
|00005300| 74 65 67 65 72 2c 20 61 | 73 0a 69 73 20 74 68 65 |teger, a|s.is the|
|00005310| 20 72 65 74 75 72 6e 65 | 64 20 76 61 6c 75 65 2e | returne|d value.|
|00005320| 0a 0a 5c 73 75 62 73 65 | 63 72 65 66 7b 73 65 74 |..\subse|cref{set|
|00005330| 73 65 72 69 65 73 6c 65 | 6e 67 74 68 7d 24 28 6e |seriesle|ngth}$(n|
|00005340| 29 24 3a 20 73 65 74 73 | 20 74 68 65 20 63 75 72 |)$: sets| the cur|
|00005350| 72 65 6e 74 20 64 65 66 | 61 75 6c 74 20 73 65 72 |rent def|ault ser|
|00005360| 69 65 73 20 6c 65 6e 67 | 74 68 20 65 71 75 61 6c |ies leng|th equal|
|00005370| 0a 74 6f 20 24 6e 24 20 | 69 66 20 24 6e 3e 30 24 |.to $n$ |if $n>0$|
|00005380| 2e 20 49 6e 20 61 6e 79 | 20 63 61 73 65 2c 20 69 |. In any| case, i|
|00005390| 74 20 72 65 74 75 72 6e | 73 20 74 68 65 20 76 61 |t return|s the va|
|000053a0| 6c 75 65 20 6f 66 20 74 | 68 65 20 63 75 72 72 65 |lue of t|he curre|
|000053b0| 6e 74 0a 64 65 66 61 75 | 6c 74 20 6c 65 6e 67 74 |nt.defau|lt lengt|
|000053c0| 68 2e 20 41 70 61 72 74 | 20 66 72 6f 6d 20 74 68 |h. Apart| from th|
|000053d0| 65 20 66 61 63 74 20 74 | 68 61 74 20 69 74 20 72 |e fact t|hat it r|
|000053e0| 65 74 75 72 6e 73 20 61 | 20 76 61 6c 75 65 2c 20 |eturns a| value, |
|000053f0| 74 68 69 73 20 69 73 0a | 69 64 65 6e 74 69 63 61 |this is.|identica|
|00005400| 6c 20 74 6f 20 74 68 65 | 20 24 5c 62 61 63 6b 73 |l to the| $\backs|
|00005410| 6c 61 73 68 24 73 65 72 | 69 65 73 6c 65 6e 67 74 |lash$ser|ieslengt|
|00005420| 68 3d 24 6e 24 20 63 6f | 6d 6d 61 6e 64 2c 20 77 |h=$n$ co|mmand, w|
|00005430| 69 74 68 20 74 68 65 20 | 64 69 66 66 65 72 65 6e |ith the |differen|
|00005440| 63 65 20 74 68 61 74 0a | 69 74 20 63 61 6e 20 62 |ce that.|it can b|
|00005450| 65 20 75 73 65 64 20 69 | 6e 73 69 64 65 20 61 6e |e used i|nside an|
|00005460| 79 20 47 50 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |y GP exp|ression |
|00005470| 6f 72 20 70 72 6f 67 72 | 61 6d 2e 0a 0a 54 68 65 |or progr|am...The|
|00005480| 20 6c 69 62 72 61 72 79 | 20 73 79 6e 74 61 78 20 | library| syntax |
|00005490| 69 73 20 24 5c 74 65 62 | 7b 73 65 74 73 65 72 69 |is $\teb|{setseri|
|000054a0| 65 73 6c 65 6e 67 74 68 | 7d 28 6e 29 24 2c 20 77 |eslength|}(n)$, w|
|000054b0| 68 65 72 65 20 24 6e 24 | 20 69 73 20 61 20 43 2d |here $n$| is a C-|
|000054c0| 69 6e 74 65 67 65 72 2c | 20 61 73 0a 69 73 20 74 |integer,| as.is t|
|000054d0| 68 65 20 72 65 74 75 72 | 6e 65 64 20 76 61 6c 75 |he retur|ned valu|
|000054e0| 65 2e 0a 0a 5c 73 75 62 | 73 65 63 72 65 66 7b 74 |e...\sub|secref{t|
|000054f0| 72 75 6e 63 7d 24 28 20 | 78 20 29 24 3a 20 74 72 |runc}$( |x )$: tr|
|00005500| 75 6e 63 61 74 69 6f 6e | 20 6f 66 20 24 78 24 2e |uncation| of $x$.|
|00005510| 20 57 68 65 6e 20 24 78 | 24 20 69 73 20 69 6e 20 | When $x|$ is in |
|00005520| 24 5c 42 62 62 20 52 24 | 2c 0a 74 68 69 73 20 6d |$\Bbb R$|,.this m|
|00005530| 65 61 6e 73 20 74 68 61 | 74 20 74 68 65 20 70 61 |eans tha|t the pa|
|00005540| 72 74 20 61 66 74 65 72 | 20 74 68 65 20 64 65 63 |rt after| the dec|
|00005550| 69 6d 61 6c 20 70 6f 69 | 6e 74 20 69 73 20 63 68 |imal poi|nt is ch|
|00005560| 6f 70 70 65 64 20 61 77 | 61 79 2e 20 49 66 20 74 |opped aw|ay. If t|
|00005570| 68 65 0a 72 65 73 75 6c | 74 20 69 73 20 6e 6f 74 |he.resul|t is not|
|00005580| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 20 62 65 63 | signifi|cant bec|
|00005590| 61 75 73 65 20 74 68 65 | 20 65 78 70 6f 6e 65 6e |ause the| exponen|
|000055a0| 74 20 69 73 20 74 6f 6f | 20 6c 61 72 67 65 20 63 |t is too| large c|
|000055b0| 6f 6d 70 61 72 65 64 0a | 74 6f 20 74 68 65 20 70 |ompared.|to the p|
|000055c0| 72 65 63 69 73 69 6f 6e | 2c 20 61 6e 20 65 72 72 |recision|, an err|
|000055d0| 6f 72 20 6f 63 63 75 72 | 73 2e 20 55 73 65 20 7b |or occur|s. Use {|
|000055e0| 5c 74 74 20 63 76 74 6f | 69 7d 20 28 33 2e 32 2e |\tt cvto|i} (3.2.|
|000055f0| 35 29 20 74 6f 20 73 75 | 70 70 72 65 73 73 20 74 |5) to su|ppress t|
|00005600| 68 69 73 20 65 72 72 6f | 72 0a 68 61 6e 64 6c 69 |his erro|r.handli|
|00005610| 6e 67 2e 0a 0a 4e 6f 74 | 65 20 61 20 76 65 72 79 |ng...Not|e a very|
|00005620| 20 73 70 65 63 69 61 6c | 20 75 73 65 20 6f 66 20 | special| use of |
|00005630| 7b 5c 74 74 20 74 72 75 | 6e 63 7d 3a 20 77 68 65 |{\tt tru|nc}: whe|
|00005640| 6e 20 61 70 70 6c 69 65 | 64 20 74 6f 20 61 20 70 |n applie|d to a p|
|00005650| 6f 77 65 72 20 73 65 72 | 69 65 73 2c 20 69 74 0a |ower ser|ies, it.|
|00005660| 74 72 61 6e 73 66 6f 72 | 6d 73 20 69 74 20 69 6e |transfor|ms it in|
|00005670| 74 6f 20 61 20 70 6f 6c | 79 6e 6f 6d 69 61 6c 20 |to a pol|ynomial |
|00005680| 6f 72 20 61 20 72 61 74 | 69 6f 6e 61 6c 20 66 75 |or a rat|ional fu|
|00005690| 6e 63 74 69 6f 6e 20 77 | 69 74 68 20 64 65 6e 6f |nction w|ith deno|
|000056a0| 6d 69 6e 61 74 6f 72 0a | 61 20 70 6f 77 65 72 20 |minator.|a power |
|000056b0| 6f 66 20 24 58 24 2c 20 | 62 79 20 63 68 6f 70 70 |of $X$, |by chopp|
|000056c0| 69 6e 67 20 61 77 61 79 | 20 74 68 65 20 24 4f 28 |ing away| the $O(|
|000056d0| 58 5e 6b 29 24 2e 20 53 | 69 6d 69 6c 61 72 6c 79 |X^k)$. S|imilarly|
|000056e0| 2c 20 77 68 65 6e 20 61 | 70 70 6c 69 65 64 20 74 |, when a|pplied t|
|000056f0| 6f 0a 61 20 24 70 24 2d | 61 64 69 63 20 6e 75 6d |o.a $p$-|adic num|
|00005700| 62 65 72 2c 20 69 74 20 | 74 72 61 6e 73 66 6f 72 |ber, it |transfor|
|00005710| 6d 73 20 69 74 20 69 6e | 74 6f 20 61 6e 20 69 6e |ms it in|to an in|
|00005720| 74 65 67 65 72 20 6f 72 | 20 61 20 72 61 74 69 6f |teger or| a ratio|
|00005730| 6e 61 6c 20 6e 75 6d 62 | 65 72 0a 62 79 20 63 68 |nal numb|er.by ch|
|00005740| 6f 70 70 69 6e 67 20 61 | 77 61 79 20 74 68 65 20 |opping a|way the |
|00005750| 24 4f 28 70 5e 6b 29 24 | 2e 0a 0a 54 68 65 20 6c |$O(p^k)$|...The l|
|00005760| 69 62 72 61 72 79 20 73 | 79 6e 74 61 78 20 69 73 |ibrary s|yntax is|
|00005770| 20 24 5c 74 65 62 7b 67 | 74 72 75 6e 63 7d 20 28 | $\teb{g|trunc} (|
|00005780| 20 78 20 29 24 2e 0a 0a | 5c 73 75 62 73 65 63 72 | x )$...|\subsecr|
|00005790| 65 66 7b 74 79 70 65 7d | 24 28 78 29 24 3a 20 69 |ef{type}|$(x)$: i|
|000057a0| 6e 74 65 72 6e 61 6c 20 | 74 79 70 65 20 6e 75 6d |nternal |type num|
|000057b0| 62 65 72 20 28 66 72 6f | 6d 20 31 20 74 6f 20 31 |ber (fro|m 1 to 1|
|000057c0| 39 29 20 6f 66 20 74 68 | 65 20 70 61 72 69 20 6f |9) of th|e pari o|
|000057d0| 62 6a 65 63 74 0a 24 78 | 24 2e 20 54 68 69 73 20 |bject.$x|$. This |
|000057e0| 69 73 20 75 73 65 66 75 | 6c 20 6f 6e 6c 79 20 75 |is usefu|l only u|
|000057f0| 6e 64 65 72 20 47 50 2e | 0a 0a 54 68 65 20 6c 69 |nder GP.|..The li|
|00005800| 62 72 61 72 79 20 73 79 | 6e 74 61 78 20 69 73 20 |brary sy|ntax is |
|00005810| 24 5c 74 65 62 7b 67 74 | 79 70 65 7d 28 78 29 24 |$\teb{gt|ype}(x)$|
|00005820| 2c 20 62 75 74 20 6e 65 | 65 64 20 6e 6f 74 20 62 |, but ne|ed not b|
|00005830| 65 20 75 73 65 64 20 73 | 69 6e 63 65 20 74 68 65 |e used s|ince the|
|00005840| 0a 69 6e 74 65 72 6e 61 | 6c 20 66 75 6e 63 74 69 |.interna|l functi|
|00005850| 6f 6e 20 7b 5c 74 74 20 | 74 79 70 7d 20 69 73 20 |on {\tt |typ} is |
|00005860| 61 76 61 69 6c 61 62 6c | 65 2e 20 4e 6f 74 65 20 |availabl|e. Note |
|00005870| 74 68 61 74 20 7b 5c 74 | 74 20 67 74 79 70 65 7d |that {\t|t gtype}|
|00005880| 20 67 69 76 65 73 20 61 | 0a 47 45 4e 20 77 68 69 | gives a|.GEN whi|
|00005890| 6c 65 20 7b 5c 74 74 20 | 74 79 70 7d 20 67 69 76 |le {\tt |typ} giv|
|000058a0| 65 73 20 61 20 43 2d 69 | 6e 74 65 67 65 72 2e 0a |es a C-i|nteger..|
|000058b0| 0a 5c 73 75 62 73 65 63 | 72 65 66 7b 76 61 6c 75 |.\subsec|ref{valu|
|000058c0| 61 74 69 6f 6e 7d 24 28 | 78 2c 70 29 24 3a 20 43 |ation}$(|x,p)$: C|
|000058d0| 6f 6d 70 75 74 65 73 20 | 74 68 65 20 68 69 67 68 |omputes |the high|
|000058e0| 65 73 74 20 65 78 70 6f | 6e 65 6e 74 20 6f 66 20 |est expo|nent of |
|000058f0| 24 70 24 0a 64 69 76 69 | 64 69 6e 67 20 24 78 24 |$p$.divi|ding $x$|
|00005900| 2e 20 49 66 20 24 70 24 | 20 69 73 20 6f 66 20 74 |. If $p$| is of t|
|00005910| 79 70 65 20 69 6e 74 65 | 67 65 72 2c 20 24 78 24 |ype inte|ger, $x$|
|00005920| 20 6d 75 73 74 20 62 65 | 20 61 6e 20 69 6e 74 65 | must be| an inte|
|00005930| 67 65 72 2c 0a 61 6e 20 | 69 6e 74 65 67 65 72 6d |ger,.an |integerm|
|00005940| 6f 64 20 77 68 6f 73 65 | 20 6d 6f 64 75 6c 75 73 |od whose| modulus|
|00005950| 20 69 73 20 64 69 76 69 | 62 6c 65 20 62 79 20 24 | is divi|ble by $|
|00005960| 70 24 2c 20 61 20 66 72 | 61 63 74 69 6f 6e 2c 20 |p$, a fr|action, |
|00005970| 61 0a 24 71 24 2d 61 64 | 69 63 20 6e 75 6d 62 65 |a.$q$-ad|ic numbe|
|00005980| 72 20 77 69 74 68 20 24 | 71 3d 70 24 2c 20 6f 72 |r with $|q=p$, or|
|00005990| 20 61 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 20 6f 72 | a polyn|omial or|
|000059a0| 20 70 6f 77 65 72 20 73 | 65 72 69 65 73 20 0a 69 | power s|eries .i|
|000059b0| 6e 20 77 68 69 63 68 20 | 63 61 73 65 20 74 68 65 |n which |case the|
|000059c0| 20 76 61 6c 75 61 74 69 | 6f 6e 20 69 73 20 74 68 | valuati|on is th|
|000059d0| 65 20 6d 69 6e 69 6d 75 | 6d 20 6f 66 20 74 68 65 |e minimu|m of the|
|000059e0| 20 76 61 6c 75 61 74 69 | 6f 6e 20 6f 66 20 74 68 | valuati|on of th|
|000059f0| 65 20 63 6f 65 66 66 69 | 63 69 65 6e 74 73 2e 0a |e coeffi|cients..|
|00005a00| 0a 49 66 20 24 70 24 20 | 69 73 20 6f 66 20 74 79 |.If $p$ |is of ty|
|00005a10| 70 65 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 2c 20 24 |pe polyn|omial, $|
|00005a20| 78 24 20 6d 75 73 74 0a | 62 65 20 6f 66 20 74 79 |x$ must.|be of ty|
|00005a30| 70 65 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 20 6f 72 |pe polyn|omial or|
|00005a40| 20 72 61 74 69 6f 6e 61 | 6c 20 66 75 6e 63 74 69 | rationa|l functi|
|00005a50| 6f 6e 2c 20 61 6e 64 20 | 61 6c 73 6f 20 61 20 70 |on, and |also a p|
|00005a60| 6f 77 65 72 20 73 65 72 | 69 65 73 0a 69 66 20 24 |ower ser|ies.if $|
|00005a70| 78 24 20 69 73 20 61 20 | 6d 6f 6e 6f 6d 69 61 6c |x$ is a |monomial|
|00005a80| 2e 20 49 66 20 24 78 3d | 30 24 2c 20 61 6e 20 65 |. If $x=|0$, an e|
|00005a90| 72 72 6f 72 20 69 73 20 | 69 73 73 75 65 64 20 65 |rror is |issued e|
|00005aa0| 78 63 65 70 74 20 69 6e | 20 63 61 73 65 20 6f 66 |xcept in| case of|
|00005ab0| 0a 24 70 24 2d 61 64 69 | 63 20 6e 75 6d 62 65 72 |.$p$-adi|c number|
|00005ac0| 73 20 61 6e 64 20 70 6f | 77 65 72 20 73 65 72 69 |s and po|wer seri|
|00005ad0| 65 73 2c 20 69 6e 20 77 | 68 69 63 68 20 63 61 73 |es, in w|hich cas|
|00005ae0| 65 20 74 68 65 20 72 65 | 73 75 6c 74 20 69 73 20 |e the re|sult is |
|00005af0| 74 68 65 0a 65 78 70 6f | 6e 65 6e 74 20 6f 66 20 |the.expo|nent of |
|00005b00| 74 68 65 20 7a 65 72 6f | 2e 20 46 69 6e 61 6c 6c |the zero|. Finall|
|00005b10| 79 2c 20 74 68 65 20 76 | 61 6c 75 61 74 69 6f 6e |y, the v|aluation|
|00005b20| 20 6f 66 20 61 20 76 65 | 63 74 6f 72 2c 0a 63 6f | of a ve|ctor,.co|
|00005b30| 6d 70 6c 65 78 20 6f 72 | 20 71 75 61 64 72 61 74 |mplex or| quadrat|
|00005b40| 69 63 20 6e 75 6d 62 65 | 72 20 69 73 20 74 68 65 |ic numbe|r is the|
|00005b50| 20 6d 69 6e 69 6d 75 6d | 20 6f 66 20 74 68 65 20 | minimum| of the |
|00005b60| 63 6f 6d 70 6f 6e 65 6e | 74 0a 76 61 6c 75 61 74 |componen|t.valuat|
|00005b70| 69 6f 6e 73 2e 20 41 6e | 79 20 6f 74 68 65 72 20 |ions. An|y other |
|00005b80| 74 79 70 65 20 63 6f 6d | 62 69 6e 61 74 69 6f 6e |type com|bination|
|00005b90| 73 20 67 69 76 65 73 20 | 61 6e 20 65 72 72 6f 72 |s gives |an error|
|00005ba0| 2e 0a 0a 54 68 65 20 6c | 69 62 72 61 72 79 20 73 |...The l|ibrary s|
|00005bb0| 79 6e 74 61 78 20 69 73 | 20 24 5c 74 65 62 7b 67 |yntax is| $\teb{g|
|00005bc0| 67 76 61 6c 7d 28 78 29 | 24 2e 0a 0a 5c 73 75 62 |gval}(x)|$...\sub|
|00005bd0| 73 65 63 72 65 66 7b 76 | 65 63 7d 24 28 78 29 24 |secref{v|ec}$(x)$|
|00005be0| 3a 20 74 72 61 6e 73 66 | 6f 72 6d 20 74 68 65 20 |: transf|orm the |
|00005bf0| 6f 62 6a 65 63 74 20 24 | 78 24 20 69 6e 74 6f 20 |object $|x$ into |
|00005c00| 61 20 76 65 63 74 6f 72 | 2e 20 54 68 65 20 76 65 |a vector|. The ve|
|00005c10| 63 74 6f 72 20 77 69 6c | 6c 0a 62 65 20 77 69 74 |ctor wil|l.be wit|
|00005c20| 68 20 6f 6e 65 20 63 6f | 6d 70 6f 6e 65 6e 74 20 |h one co|mponent |
|00005c30| 6f 6e 6c 79 2c 20 65 78 | 63 65 70 74 20 77 68 65 |only, ex|cept whe|
|00005c40| 6e 20 24 78 24 20 69 73 | 20 61 20 76 65 63 74 6f |n $x$ is| a vecto|
|00005c50| 72 2f 6d 61 74 72 69 78 | 20 6f 72 20 61 20 71 75 |r/matrix| or a qu|
|00005c60| 61 64 72 61 74 69 63 0a | 66 6f 72 6d 20 28 69 6e |adratic.|form (in|
|00005c70| 20 77 68 69 63 68 20 63 | 61 73 65 20 74 68 65 20 | which c|ase the |
|00005c80| 72 65 73 75 6c 74 69 6e | 67 20 76 65 63 74 6f 72 |resultin|g vector|
|00005c90| 20 69 73 20 73 69 6d 70 | 6c 79 20 74 68 65 20 69 | is simp|ly the i|
|00005ca0| 6e 69 74 69 61 6c 20 6f | 62 6a 65 63 74 20 63 6f |nitial o|bject co|
|00005cb0| 6e 73 69 64 65 72 65 64 | 0a 61 73 20 61 20 72 6f |nsidered|.as a ro|
|00005cc0| 77 20 76 65 63 74 6f 72 | 29 2c 20 62 75 74 20 6d |w vector|), but m|
|00005cd0| 6f 72 65 20 69 6d 70 6f | 72 74 61 6e 74 6c 79 20 |ore impo|rtantly |
|00005ce0| 77 68 65 6e 20 24 78 24 | 20 69 73 20 61 20 70 6f |when $x$| is a po|
|00005cf0| 6c 79 6e 6f 6d 69 61 6c | 20 6f 72 20 61 20 70 6f |lynomial| or a po|
|00005d00| 77 65 72 0a 73 65 72 69 | 65 73 2e 20 49 6e 20 74 |wer.seri|es. In t|
|00005d10| 68 65 20 63 61 73 65 20 | 6f 66 20 61 20 70 6f 6c |he case |of a pol|
|00005d20| 79 6e 6f 6d 69 61 6c 2c | 20 74 68 65 20 63 6f 65 |ynomial,| the coe|
|00005d30| 66 66 69 63 69 65 6e 74 | 73 20 6f 66 20 74 68 65 |fficient|s of the|
|00005d40| 20 76 65 63 74 6f 72 20 | 73 74 61 72 74 73 0a 77 | vector |starts.w|
|00005d50| 69 74 68 20 74 68 65 20 | 6c 65 61 64 69 6e 67 20 |ith the |leading |
|00005d60| 63 6f 65 66 66 69 63 69 | 65 6e 74 20 6f 66 20 74 |coeffici|ent of t|
|00005d70| 68 65 20 70 6f 6c 79 6e | 6f 6d 69 61 6c 2c 20 77 |he polyn|omial, w|
|00005d80| 68 69 6c 65 20 66 6f 72 | 20 70 6f 77 65 72 20 73 |hile for| power s|
|00005d90| 65 72 69 65 73 20 6f 6e | 6c 79 0a 74 68 65 20 73 |eries on|ly.the s|
|00005da0| 69 67 6e 69 66 69 63 61 | 6e 74 20 63 6f 65 66 66 |ignifica|nt coeff|
|00005db0| 69 63 69 65 6e 74 73 20 | 61 72 65 20 74 61 6b 65 |icients |are take|
|00005dc0| 6e 20 69 6e 74 6f 20 61 | 63 63 6f 75 6e 74 2c 20 |n into a|ccount, |
|00005dd0| 62 75 74 20 74 68 69 73 | 20 74 69 6d 65 20 62 79 |but this| time by|
|00005de0| 0a 69 6e 63 72 65 61 73 | 69 6e 67 20 6f 72 64 65 |.increas|ing orde|
|00005df0| 72 20 6f 66 20 64 65 67 | 72 65 65 2e 0a 0a 54 68 |r of deg|ree...Th|
|00005e00| 65 20 6c 69 62 72 61 72 | 79 20 73 79 6e 74 61 78 |e librar|y syntax|
|00005e10| 20 69 73 20 24 5c 74 65 | 62 7b 67 74 6f 76 65 63 | is $\te|b{gtovec|
|00005e20| 7d 28 78 29 24 2e 0a 0a | 5c 73 65 63 74 69 6f 6e |}(x)$...|\section|
|00005e30| 7b 54 72 61 6e 73 63 65 | 6e 64 65 6e 74 61 6c 20 |{Transce|ndental |
|00005e40| 66 75 6e 63 74 69 6f 6e | 73 2e 7d 0a 0a 41 73 20 |function|s.}..As |
|00005e50| 61 20 67 65 6e 65 72 61 | 6c 20 72 75 6c 65 2c 20 |a genera|l rule, |
|00005e60| 77 68 69 63 68 20 6f 66 | 20 63 6f 75 72 73 65 20 |which of| course |
|00005e70| 69 6e 20 73 6f 6d 65 20 | 63 61 73 65 73 20 6d 61 |in some |cases ma|
|00005e80| 79 20 68 61 76 65 20 65 | 78 63 65 70 74 69 6f 6e |y have e|xception|
|00005e90| 73 2c 0a 74 72 61 6e 73 | 63 65 6e 64 65 6e 74 61 |s,.trans|cendenta|
|00005ea0| 6c 20 66 75 6e 63 74 69 | 6f 6e 73 20 6f 70 65 72 |l functi|ons oper|
|00005eb0| 61 74 65 20 69 6e 20 74 | 68 65 20 66 6f 6c 6c 6f |ate in t|he follo|
|00005ec0| 77 69 6e 67 20 77 61 79 | 3a 0a 0a 5c 71 75 61 64 |wing way|:..\quad|
|00005ed0| 20 49 66 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 | If the |argument|
|00005ee0| 20 69 73 20 65 69 74 68 | 65 72 20 61 6e 20 69 6e | is eith|er an in|
|00005ef0| 74 65 67 65 72 2c 20 61 | 20 72 65 61 6c 2c 20 61 |teger, a| real, a|
|00005f00| 20 72 61 74 69 6f 6e 61 | 6c 2c 20 61 20 63 6f 6d | rationa|l, a com|
|00005f10| 70 6c 65 78 0a 6f 72 20 | 61 20 71 75 61 64 72 61 |plex.or |a quadra|
|00005f20| 74 69 63 20 6e 75 6d 62 | 65 72 2c 20 69 74 20 69 |tic numb|er, it i|
|00005f30| 73 2c 20 69 66 20 6e 65 | 63 65 73 73 61 72 79 2c |s, if ne|cessary,|
|00005f40| 20 66 69 72 73 74 20 63 | 6f 6e 76 65 72 74 65 64 | first c|onverted|
|00005f50| 20 74 6f 20 61 20 72 65 | 61 6c 0a 28 6f 72 20 63 | to a re|al.(or c|
|00005f60| 6f 6d 70 6c 65 78 29 20 | 6e 75 6d 62 65 72 20 75 |omplex) |number u|
|00005f70| 73 69 6e 67 20 74 68 65 | 20 63 75 72 72 65 6e 74 |sing the| current|
|00005f80| 20 5c 72 65 66 7b 70 72 | 65 63 69 73 69 6f 6e 7d | \ref{pr|ecision}|
|00005f90| 20 68 65 6c 64 20 69 6e | 20 74 68 65 20 76 61 72 | held in| the var|
|00005fa0| 69 61 62 6c 65 0a 7b 5c | 62 66 20 70 72 65 63 7d |iable.{\|bf prec}|
|00005fb0| 2e 20 55 6e 64 65 72 20 | 47 50 20 74 68 69 73 20 |. Under |GP this |
|00005fc0| 69 73 20 74 72 61 6e 73 | 70 61 72 65 6e 74 20 74 |is trans|parent t|
|00005fd0| 6f 20 74 68 65 20 75 73 | 65 72 2c 20 62 75 74 20 |o the us|er, but |
|00005fe0| 77 68 65 6e 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |when pro|gramming|
|00005ff0| 0a 69 6e 20 6c 69 62 72 | 61 72 79 20 6d 6f 64 65 |.in libr|ary mode|
|00006000| 2c 20 63 61 72 65 20 6d | 75 73 74 20 62 65 20 74 |, care m|ust be t|
|00006010| 61 6b 65 6e 20 74 6f 20 | 73 75 70 70 6c 79 20 74 |aken to |supply t|
|00006020| 68 65 20 70 61 72 61 6d | 65 74 65 72 20 7b 5c 74 |he param|eter {\t|
|00006030| 74 20 70 72 65 63 7d 20 | 61 73 20 0a 74 68 65 20 |t prec} |as .the |
|00006040| 6c 61 73 74 20 61 72 67 | 75 6d 65 6e 74 20 6f 66 |last arg|ument of|
|00006050| 20 74 68 65 20 66 75 6e | 63 74 69 6f 6e 20 69 66 | the fun|ction if|
|00006060| 20 74 68 65 20 66 69 72 | 73 74 20 61 72 67 75 6d | the fir|st argum|
|00006070| 65 6e 74 20 69 73 20 61 | 6e 20 65 78 61 63 74 20 |ent is a|n exact |
|00006080| 6f 62 6a 65 63 74 0a 28 | 73 65 65 20 31 2e 32 2e |object.(|see 1.2.|
|00006090| 35 2e 29 2c 20 6f 74 68 | 65 72 77 69 73 65 20 64 |5.), oth|erwise d|
|000060a0| 69 73 61 73 74 65 72 20 | 77 69 6c 6c 20 6f 63 63 |isaster |will occ|
|000060b0| 75 72 2e 0a 0a 54 68 65 | 6e 2c 20 74 68 65 20 66 |ur...The|n, the f|
|000060c0| 75 6e 63 74 69 6f 6e 20 | 69 73 20 63 6f 6d 70 75 |unction |is compu|
|000060d0| 74 65 64 2e 20 4e 6f 74 | 65 20 74 68 61 74 20 65 |ted. Not|e that e|
|000060e0| 76 65 6e 20 69 66 20 74 | 68 65 20 61 72 67 75 6d |ven if t|he argum|
|000060f0| 65 6e 74 20 69 73 20 72 | 65 61 6c 2c 20 74 68 65 |ent is r|eal, the|
|00006100| 0a 72 65 73 75 6c 74 20 | 6d 61 79 20 62 65 20 63 |.result |may be c|
|00006110| 6f 6d 70 6c 65 78 20 28 | 65 2e 67 2e 20 24 5c 74 |omplex (|e.g. $\t|
|00006120| 65 78 74 7b 61 63 6f 73 | 7d 20 28 20 32 2e 30 20 |ext{acos|} ( 2.0 |
|00006130| 29 24 20 6f 72 20 24 5c | 74 65 78 74 7b 61 63 6f |)$ or $\|text{aco|
|00006140| 73 68 7d 20 28 20 30 2e | 30 0a 29 24 29 2e 0a 4e |sh} ( 0.|0.)$)..N|
|00006150| 6f 74 65 20 61 6c 73 6f | 20 74 68 61 74 20 74 68 |ote also| that th|
|00006160| 65 20 70 72 69 6e 63 69 | 70 61 6c 20 62 72 61 6e |e princi|pal bran|
|00006170| 63 68 20 69 73 20 61 6c | 77 61 79 73 20 63 68 6f |ch is al|ways cho|
|00006180| 73 65 6e 2e 0a 0a 5c 71 | 75 61 64 20 49 66 20 74 |sen...\q|uad If t|
|00006190| 68 65 20 61 72 67 75 6d | 65 6e 74 20 69 73 20 61 |he argum|ent is a|
|000061a0| 6e 20 69 6e 74 65 67 65 | 72 6d 6f 64 20 6f 72 20 |n intege|rmod or |
|000061b0| 61 20 24 70 24 2d 61 64 | 69 63 2c 20 61 74 20 70 |a $p$-ad|ic, at p|
|000061c0| 72 65 73 65 6e 74 20 6f | 6e 6c 79 20 61 0a 66 65 |resent o|nly a.fe|
|000061d0| 77 20 66 75 6e 63 74 69 | 6f 6e 73 20 6c 69 6b 65 |w functi|ons like|
|000061e0| 20 7b 5c 74 74 20 73 71 | 72 74 7d 20 28 73 71 75 | {\tt sq|rt} (squ|
|000061f0| 61 72 65 20 72 6f 6f 74 | 29 2c 20 7b 5c 74 74 20 |are root|), {\tt |
|00006200| 73 71 72 7d 20 28 73 71 | 75 61 72 65 29 2c 20 7b |sqr} (sq|uare), {|
|00006210| 5c 74 74 20 6c 6f 67 7d | 2c 0a 7b 5c 74 74 20 65 |\tt log}|,.{\tt e|
|00006220| 78 70 7d 2c 20 70 6f 77 | 65 72 69 6e 67 2c 20 7b |xp}, pow|ering, {|
|00006230| 5c 74 74 20 74 65 69 63 | 68 7d 20 28 54 65 69 63 |\tt teic|h} (Teic|
|00006240| 68 6d 5c 22 75 6c 6c 65 | 72 20 63 68 61 72 61 63 |hm\"ulle|r charac|
|00006250| 74 65 72 29 20 61 6e 64 | 20 7b 5c 74 74 20 61 67 |ter) and| {\tt ag|
|00006260| 6d 7d 0a 28 61 72 69 74 | 68 6d 65 74 69 63 2d 67 |m}.(arit|hmetic-g|
|00006270| 65 6f 6d 65 74 72 69 63 | 20 6d 65 61 6e 29 20 61 |eometric| mean) a|
|00006280| 72 65 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 2e 0a |re imple|mented..|
|00006290| 4e 6f 74 65 20 74 68 61 | 74 20 69 6e 20 74 68 65 |Note tha|t in the|
|000062a0| 20 63 61 73 65 20 6f 66 | 20 61 20 24 32 24 2d 61 | case of| a $2$-a|
|000062b0| 64 69 63 20 6e 75 6d 62 | 65 72 2c 0a 24 7b 5c 74 |dic numb|er,.${\t|
|000062c0| 74 20 73 71 72 7d 20 28 | 20 78 20 29 24 20 69 73 |t sqr} (| x )$ is|
|000062d0| 20 6e 6f 74 20 69 64 65 | 6e 74 69 63 61 6c 20 74 | not ide|ntical t|
|000062e0| 6f 20 24 78 2a 78 24 3a | 20 66 6f 72 20 65 78 61 |o $x*x$:| for exa|
|000062f0| 6d 70 6c 65 20 69 66 0a | 24 78 20 3d 20 31 2b 4f |mple if.|$x = 1+O|
|00006300| 28 32 5e 35 29 24 20 74 | 68 65 6e 20 24 78 2a 78 |(2^5)$ t|hen $x*x|
|00006310| 20 3d 20 31 2b 4f 28 32 | 5e 35 29 24 20 77 68 69 | = 1+O(2|^5)$ whi|
|00006320| 6c 65 20 24 7b 5c 74 74 | 20 73 71 72 7d 20 28 20 |le ${\tt| sqr} ( |
|00006330| 78 20 29 20 3d 20 31 2b | 4f 28 32 5e 36 29 24 2e |x ) = 1+|O(2^6)$.|
|00006340| 0a 28 52 65 6d 61 72 6b | 3a 20 6e 6f 74 65 20 74 |.(Remark|: note t|
|00006350| 68 61 74 20 69 66 20 77 | 65 20 77 61 6e 74 65 64 |hat if w|e wanted|
|00006360| 20 74 6f 20 62 65 20 73 | 74 72 69 63 74 6c 79 20 | to be s|trictly |
|00006370| 63 6f 6e 73 69 73 74 65 | 6e 74 20 77 69 74 68 20 |consiste|nt with |
|00006380| 74 68 65 0a 50 41 52 49 | 20 70 68 69 6c 6f 73 6f |the.PARI| philoso|
|00006390| 70 68 79 2c 20 77 65 20 | 73 68 6f 75 6c 64 20 68 |phy, we |should h|
|000063a0| 61 76 65 20 24 78 2a 79 | 3d 20 28 34 20 5c 6d 6f |ave $x*y|= (4 \mo|
|000063b0| 64 20 38 29 24 20 77 68 | 65 6e 20 62 6f 74 68 20 |d 8)$ wh|en both |
|000063c0| 24 78 24 20 61 6e 64 20 | 24 79 24 20 61 72 65 0a |$x$ and |$y$ are.|
|000063d0| 63 6f 6e 67 72 75 65 6e | 74 20 74 6f 20 24 32 24 |congruen|t to $2$|
|000063e0| 20 6d 6f 64 75 6c 6f 20 | 24 34 24 2c 20 6f 72 20 | modulo |$4$, or |
|000063f0| 24 7b 5c 74 74 20 73 71 | 72 7d 28 78 29 3d 28 34 |${\tt sq|r}(x)=(4|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.