Pari/GP Reference Documentation |
Contents - Index - Meta commands |

Euler I Pi ^ abs acos acosh agm arg asin asinh atan atanh bernfrac bernreal bernvec besselh1 besselh2 besseli besselj besseljh besselk besseln cos cosh cotan dilog eint1 erfc eta exp gamma gammah hyperu incgam incgamc lngamma log polylog psi sin sinh sqr sqrt sqrtn tan tanh teichmuller theta thetanullk weber zeta | |

^ | |

The expression x{ PARI is able to rewrite the multiplication x * x of two If the exponent is not of type integer, this is treated as a transcendental
function (see Section [ As an exception, if the exponent is a rational number p/q and x an integer modulo a prime or a p-adic number, return a solution y of y^q = x^p if it exists. Currently, q must not have large prime factors. Beware that
If the exponent is a negative integer, an inverse must be computed.
For non-invertible
(Here, a factor 2 is obtained directly. In general, take the gcd of the representative and the modulus.) This is most useful when performing complicated operations modulo an integer N whose factorization is unknown. Either the computation succeeds and all is well, or a factor d is discovered and the computation may be restarted modulo d or N/d. For non-invertible
In fact the latter polynomial is invertible, but the algorithm used
(subresultant) assumes the base ring is a domain. If it is not the case,
as here for
This is not guaranteed to work either since it must invert pivots. See
Section [ The library syntax is | |

Euler | |

Euler's constant gamma = 0.57721.... Note that
The library syntax is | |

I | |

the complex number sqrt{-1}. The library syntax is the global variable | |

Pi | |

the constant Pi (3.14159...). The library syntax is | |

abs(x) | |

absolute value of x (modulus if x is complex).
Rational functions are not allowed. Contrary to most transcendental
functions, an exact argument is
If x is a polynomial, returns -x if the leading coefficient is real and negative else returns x. For a power series, the constant coefficient is considered instead. The library syntax is | |

acos(x) | |

principal branch of {cos}^{-1}(x),
i.e.such that {Re(acos}(x)) belongs to [0,Pi]. If
x belongs to The library syntax is | |

acosh(x) | |

principal branch of {cosh}^{-1}(x),
i.e.such that {Im(acosh}(x)) belongs to [0,Pi]. If
x belongs to The library syntax is | |

agm(x,y) | |

arithmetic-geometric mean of x and y. In the case of complex or negative numbers, the principal square root is always chosen. p-adic or power series arguments are also allowed. Note that a p-adic agm exists only if x/y is congruent to 1 modulo p (modulo 16 for p = 2). x and y cannot both be vectors or matrices. The library syntax is | |

arg(x) | |

argument of the complex number x, such that
-Pi < {arg}(x) The library syntax is | |

asin(x) | |

principal branch of {sin}^{-1}(x), i.e.such
that {Re(asin}(x)) belongs to [-Pi/2,Pi/2]. If x belongs to The library syntax is | |

asinh(x) | |

principal branch of {sinh}^{-1}(x), i.e.such that {Im(asinh}(x)) belongs to [-Pi/2,Pi/2]. The library syntax is | |

atan(x) | |

principal branch of {tan}^{-1}(x), i.e.such that {Re(atan}(x)) belongs to ]-Pi/2,Pi/2[. The library syntax is | |

atanh(x) | |

principal branch of {tanh}^{-1}(x), i.e.such
that {Im(atanh}(x)) belongs to ]-Pi/2,Pi/2]. If x belongs to The library syntax is | |

bernfrac(x) | |

Bernoulli number B_x, where B_0 = 1, B_1 = -1/2, B_2 = 1/6,..., expressed as a rational number. The argument x should be of type integer. The library syntax is | |

bernreal(x) | |

Bernoulli number
B_x, as The library syntax is | |

bernvec(x) | |

creates a vector containing, as rational numbers,
the Bernoulli numbers B_0, B_2,..., B_{2x}.
This routine is obsolete. Use
The library syntax is | |

besselh1(nu,x) | |

H^1-Bessel function of index The library syntax is | |

besselh2(nu,x) | |

H^2-Bessel function of index The library syntax is | |

besseli(nu,x) | |

I-Bessel function of index The library syntax is | |

besselj(nu,x) | |

J-Bessel function of index The library syntax is | |

besseljh(n,x) | |

J-Bessel function of half integral index.
More precisely, The library syntax is | |

besselk(nu,x,{flag = 0}) | |

K-Bessel function of index
The library syntax is | |

besseln(nu,x) | |

N-Bessel function of index The library syntax is | |

cos(x) | |

cosine of x. The library syntax is | |

cosh(x) | |

hyperbolic cosine of x. The library syntax is | |

cotan(x) | |

cotangent of x. The library syntax is | |

dilog(x) | |

principal branch of the dilogarithm of x,
i.e.analytic continuation of the power series log_2(x) = sum_{n The library syntax is | |

eint1(x,{n}) | |

exponential integral
int_x^ oo (e^{-t})/(t)dt (x belongs to If n is present, outputs the n-dimensional vector
[ The library syntax is | |

erfc(x) | |

complementary error function
(2/sqrtPi)int_x^ oo e^{-t^2}dt (x belongs to The library syntax is | |

eta(x,{flag = 0}) | |

Dedekind's eta function, without the q^{1/24}. This means the following: if x is a complex number with positive imaginary part, the result is prod_{n = 1}^ oo (1-q^n), where q = e^{2iPi x}. If x is a power series (or can be converted to a power series) with positive valuation, the result is prod_{n = 1}^ oo (1-x^n). If The library syntax is | |

exp(x) | |

exponential of x. p-adic arguments with positive valuation are accepted. The library syntax is | |

gammah(x) | |

gamma function evaluated at the argument x+1/2. The library syntax is | |

gamma(x) | |

gamma function of x. The library syntax is | |

hyperu(a,b,x) | |

U-confluent hypergeometric function with parameters a and b. The parameters a and b can be complex but the present implementation requires x to be positive. The library syntax is | |

incgam(s,x,{y}) | |

incomplete gamma function. The argument x and s are complex numbers (x must be a positive real number if s = 0). The result returned is int_x^ oo e^{-t}t^{s-1}dt. When y is given, assume (of course without checking!) that y = Gamma(s). For small x, this will speed up the computation. The library syntax is
NULL). | |

incgamc(s,x) | |

complementary incomplete gamma function. The arguments x and s are complex numbers such that s is not a pole of Gamma and |x|/(|s|+1) is not much larger than 1 (otherwise the convergence is very slow). The result returned is int_0^x e^{-t}t^{s-1}dt. The library syntax is | |

log(x) | |

principal branch of the natural logarithm of
x, i.e.such that {Im(log}(x)) belongs to ]-Pi,Pi]. The result is complex
(with imaginary part equal to Pi) if x belongs to p-adic arguments are also accepted for x, with the convention that log(p) = 0. Hence in particular exp(log(x))/x is not in general equal to 1 but to a (p-1)-th root of unity (or ±1 if p = 2) times a power of p. The library syntax is | |

lngamma(x) | |

principal branch of the logarithm of the gamma
function of x. This function is analytic on the complex plane with
non-positive integers removed. Can have much larger arguments than The library syntax is | |

polylog(m,x,{flag = 0}) | |

one of the different polylogarithms,
depending on If Using If If If These three functions satisfy the functional equation f_m(1/x) = (-1)^{m-1}f_m(x). The library syntax is | |

psi(x) | |

the psi-function of x, i.e.the logarithmic derivative Gamma'(x)/Gamma(x). The library syntax is | |

sin(x) | |

sine of x. The library syntax is | |

sinh(x) | |

hyperbolic sine of x. The library syntax is | |

sqr(x) | |

square of x. This operation is not completely straightforward, i.e.identical to x * x, since it can usually be computed more efficiently (roughly one-half of the elementary multiplications can be saved). Also, squaring a 2-adic number increases its precision. For example,
Note that this function is also called whenever one multiplies two objects
which are known to be
(note the difference between The library syntax is | |

sqrt(x) | |

principal branch of the square root of x,
i.e.such that {Arg}({sqrt}(x)) belongs to ]-Pi/2, Pi/2], or in other
words such that Re({sqrt}(x)) > 0 or Re({sqrt}(x)) = 0 and
Im({sqrt}(x)) Intmod a prime and p-adics are allowed as arguments. In that case, the square root (if it exists) which is returned is the one whose first p-adic digit (or its unique p-adic digit in the case of intmods) is in the interval [0,p/2]. When the argument is an intmod a non-prime (or a non-prime-adic), the result is undefined. The library syntax is | |

sqrtn(x,n,{&z}) | |

principal branch of the nth root of x, i.e.such that {Arg}({sqrt}(x)) belongs to ]-Pi/n, Pi/n]. Intmod a prime and p-adics are allowed as arguments. If z is present, it is set to a suitable root of unity allowing to recover all the other roots. If it was not possible, z is set to zero. In the case this argument is present and no square root exist, 0 is returned instead or raising an error.
The following script computes all roots in all possible cases:
The library syntax is | |

tan(x) | |

tangent of x. The library syntax is | |

tanh(x) | |

hyperbolic tangent of x. The library syntax is | |

teichmuller(x) | |

Teichmüller character of the p-adic number x, i.e. the unique (p-1)-th root of unity congruent to x / p^{v_p(x)} modulo p. The library syntax is | |

theta(q,z) | |

Jacobi sine theta-function. The library syntax is | |

thetanullk(q,k) | |

k-th derivative at z = 0 of
The library syntax is | |

weber(x,{flag = 0}) | |

one of Weber's three f functions.
If The library syntax is
or werberf1(x,prec)
.werberf2(x,prec) | |

zeta(s) | |

For s a complex number, Riemann's zeta
function zeta(s) = sum_{n For s a p-adic number, Kubota-Leopoldt zeta function at s, that is the unique continuous p-adic function on the p-adic integers that interpolates the values of (1 - p^{-k}) zeta(k) at negative integers k such that k = 1 (mod p-1) (resp. k is odd) if p is odd (resp. p = 2). The library syntax is | |