Module: sage.functions.transcendental
Transcendental Functions
Module-level Functions
z) |
Return the value of the complex exponential integral Ei(z) at a complex number z.
WARNING: Calculations are done to double precision, and the output is a complex double element, no matter how big the precision of the input is.
sage: Ei(10) 2492.22897624 sage: Ei(I) 0.337403922901 + 2.51687939716*I sage: Ei(3+I) 7.823134676 + 6.09751978399*I
ALGORITHM: Uses scipy's special.exp1 function.
x, [eps_rel=None], [err_bound=False]) |
Return value of the function Li(x) as a real double field element.
This is the function
The function Li(x) is an approximation for the number
of primes up to
. In fact, the famous Riemann
Hypothesis is equivalent to the statement that for
we have
For ``small''
ALGORITHM: Computed numerically using GSL.
Input:
sage: Li(2) 0.0 sage: Li(5) 2.58942452992 sage: Li(1000) 176.56449421 sage: Li(10^5) 9628.76383727 sage: prime_pi(10^5) 9592 sage: Li(1) Traceback (most recent call last): ... ValueError: Li only defined for x at least 2.
sage: for n in range(1,7): ... print '%-10s%-10s%-20s'%(10^n, prime_pi(10^n), Li(10^n)) 10 4 5.12043572467 100 25 29.080977804 1000 168 176.56449421 10000 1229 1245.09205212 100000 9592 9628.76383727 1000000 78498 78626.5039957
x, [n=0]) |
Returns the exponential integral
. If the optional argument
is given, computes list of the first
values of the exponential
integral
.
The exponential integral
is
Input:
sage: exponential_integral_1(2) 0.048900510708061118 sage: w = exponential_integral_1(2,4); w [0.048900510708061118, 0.0037793524098489067, 0.00036008245216265867, 3.76656228439249e-05]
IMPLEMENTATION: We use the PARI C-library functions eint1 and veceint1.
REFERENCE: See page 262, Prop 5.6.12, of Cohen's book "A Course in Computational Algebraic Number Theory".
REMARKS: When called with the optional argument n, the PARI C-library is fast for values of n up to some bound, then very very slow. For example, if x=5, then the computation takes less than a second for n=800000, and takes "forever" for n=900000.
s) |
Gamma function at s.
sage: gamma(CDF(0.5,14)) -4.05370307804e-10 - 5.77329983455e-10*I sage: gamma(I) -0.154949828301811 - 0.498015668118356*I sage: gamma(6) 120
s, t) |
Incomplete Gamma function Gamma(s,t).
sage: gamma_inc(CDF(0,1), 3) 0.00320857499337 + 0.0124061858119*I sage: gamma_inc(3, 3) 0.846380162253687 + 2.52435489670724e-29*I # 32-bit 0.846380162253687 # 64-bit sage: gamma_inc(RDF(1), 3) 0.0497870683678639
s, t) |
Incomplete Gamma function Gamma(s,t).
sage: gamma_inc(CDF(0,1), 3) 0.00320857499337 + 0.0124061858119*I sage: gamma_inc(3, 3) 0.846380162253687 + 2.52435489670724e-29*I # 32-bit 0.846380162253687 # 64-bit sage: gamma_inc(RDF(1), 3) 0.0497870683678639
s) |
Riemann zeta function at s with s a real or complex number.
Input:
If s is a real number the computation is done using the MPFR library. When the input is not real, the computation is done using the PARI C library.
sage: zeta(2) 1.64493406684823 sage: RR = RealField(200) sage: zeta(RR(2)) 1.6449340668482264364724151666460251892189499012067984377356 sage: zeta(I) 0.00330022368532410 - 0.418155449141322*I
s) |
Completed function
that satisfies
and
has zeros at the same points as the Riemann zeta function.
Input:
If s is a real number the computation is done using the MPFR library. When the input is not real, the computation is done using the PARI C library.
More precisely,
sage: zeta_symmetric(0.7) 0.497580414651127 sage: zeta_symmetric(1-0.7) 0.497580414651127 sage: RR = RealField(200) sage: zeta_symmetric(RR('0.7')) 0.49758041465112690357779107525638385212657443284080589766062 sage: I = CC.0 sage: zeta_symmetric(RR('0.5') + I*RR('14.0')) 0.000201294444235258 + 4.74338450462408e-20*I sage: zeta_symmetric(RR('0.5') + I*RR('14.1')) 0.0000489893483255687 + 1.18584612615602e-20*I sage: zeta_symmetric(RR('0.5') + I*RR('14.2')) -0.0000868931282620101 - 2.03287907341032e-20*I
REFERENCE: I copied the definition of xi from http://www.math.ubc.ca/~pugh/RiemannZeta/RiemannZetaLong.html
Class: PrimePi
sage: prime_pi(7) 4 sage: prime_pi(100) 25 sage: prime_pi(1000) 168 sage: prime_pi(100000) 9592 sage: prime_pi(0.5) 0 sage: prime_pi(-10) 0
The prime_pi function also has a special plotting method, so it plots quickly and perfectly as a step function.
sage: P = plot(prime_pi, 50,100)
Functions: plot
Special Functions: __call__,
__repr__
See About this document... for information on suggesting changes.