Jump to content

PARI/GP

From Wikipedia, the free encyclopedia
PARI/GP
Developer(s)Henri Cohen,Karim Belabas, et al., at theUniversité Bordeaux 1
Stable release
2.15.5[1]Edit this on Wikidata / 23 February 2024;6 months ago(23 February 2024)
Repository
Written inC
Operating systemCross-platform
TypeComputer algebra system
LicenseGNU General Public License
Websitepari.math.u-bordeaux.fr

PARI/GPis acomputer algebra systemwith the main aim of facilitatingnumber theorycomputations. Versions 2.1.0 and higher are distributed under theGNU General Public License.It runs on most commonoperating systems.

System overview

[edit]

The PARI/GP system is a package that is capable of doing formal computations on recursive types at high speed; it is primarily aimed at number theorists. Its three main strengths are its speed, the possibility of directly usingdata typesthat are familiar tomathematicians,and its extensive algebraic number theory module.

The PARI/GP system consists of the following standard components:

  • PARIis aClibrary,allowing for fast computations, and which can be called from a high-level language application (for instance, written in C,C++,Pascal,Fortran,Perl,orPython).
  • gpis an easy-to-use interactivecommand line interfacegiving access to the PARI functions. It functions as a sophisticated programmable calculator which contains most of the control instructions of a standard language like C.GPis the name ofgp's scripting language which can be used to programgp.

Also available isgp2c,the GP-to-C compiler, which compiles GP scripts into the C language and transparently loads the resulting functions intogp.The advantage of this is thatgp2c-compiled scripts will typically run three to four times faster.gp2cunderstands almost all of GP.

PARI/GP performsarbitrary precisioncalculations (e.g., thesignificandcan be millions of digits long—and billions of digits on64-bitmachines). It can computefactorizations,performelliptic curvecomputations and performalgebraic number theorycalculations. It also allows computations withmatrices,polynomials,power series,algebraic numbersand implements manyspecial functions.

PARI/GP comes with its own built-in graphicalplottingcapability. PARI/GP has some symbolic manipulation capability, e.g., multivariate polynomial and rational function handling. It also has some formalintegrationanddifferentiationcapabilities.

PARI/GP can be compiled withGMP(GNU Multiple Precision Arithmetic Library) providing faster computations than PARI/GP's native arbitrary-precision kernel.

History

[edit]

PARI/GP's progenitor was a program namedIsabelle,an interpreter forhigher arithmetic,written in 1979 byHenri CohenandFrançois Dressat theUniversité Bordeaux 1.[2]

PARI/GP was originally developed in 1985 by a team led by Henri Cohen at Laboratoire A2X and is now maintained byKarim Belabasat the Université Bordeaux 1 with the help of many volunteer contributors.

Etymology

[edit]

The name PARI is a pun about the project's early stages when the authors started to implement a library for "Pascal ARIthmetic" in thePascal programming language(although they quickly switched toC), and after"pari de Pascal"(Pascal's Wager).[3]

The first version of thegpcalculator was originally called GPC, for Great Programmable Calculator. The trailing C was eventually dropped.[3]

Usage examples

[edit]

Below are some samples of thegpcalculator usage:

?\p 212
realprecision = 221 significant digits (212 digits displayed)
? (1.378-0.09143*I)^(14.87+0.3721*I)
time = 0 ms.
%1 = 80.817082637557070449383034933010288336925078193546211741027496566803185
11092579265743992920628314516739962724446042667886245322716456966120413965187
3272488827365261487845201056199035423784093096984005713791800191 - 94.8384618
89186304973351271821601500916571303364865064205039706592481303045713982306764
33264430511752515705768858710051382035377195497482934017239179757538824688799
0680136241031895212412150770309289450962931402933*I

? 123456! + 0. \\ slower than gamma(123457) which uses floating point
time = 1,656 ms.
%2 = 2.6040699049291378729513930560926568818273270409503019584610185579952057
37967683415793560716617127908735520017061666000857261271456698589373086528293
4317244121152865814030204645985573419251305342231135573491050756 E574964

? sin(x)
time = 0 ms.
%3 = x - 1/6*x^3 + 1/120*x^5 - 1/5040*x^7 + 1/362880*x^9 - 1/39916800*x^11
+ 1/6227020800*x^13 - 1/1307674368000*x^15 + O(x^17)

? for(z=25,30, print (factor(2^z-1)))
[31, 1; 601, 1; 1801, 1]
[3, 1; 2731, 1; 8191, 1]
[7, 1; 73, 1; 262657, 1]
[3, 1; 5, 1; 29, 1; 43, 1; 113, 1; 127, 1]
[233, 1; 1103, 1; 2089, 1]
[3, 2; 7, 1; 11, 1; 31, 1; 151, 1; 331, 1]
time = 5 ms.

? K = bnfinit(x^2 + 23); K.cyc
time = 1ms.
%4 = [3]
/* This number field has class number 3. */

See also

[edit]

References

[edit]
  1. ^"pari-2.15.5 (STABLE) released".
  2. ^François Dress (1979–1980)."Le langage et l'interpréteur 'Isabelle', spécialement conçus pour utilisations arithmétiques".Séminaire de Théorie des Nombres de Bordeaux.9.exposé № 4.
  3. ^ab"TRIVIA" section of"Manpage of GP,"10 August 2004
[edit]

PARI/GP online calculator