QEtaOneOverPiQ¶
oneoverpi.spad line 549 [edit on github]
QEtaOneOverPiQ provides functions to find formulas for the computation of 1/pi.
- approximatesPi?: AInterval Fraction Integer -> Boolean
approximatesPi?(iv)
returnstrue
ifiv
contains a rational interval that approximates the first 50 digits of pi.
- chudnovskyA2tau: AlgebraicNumber -> AlgebraicNumber
chudnovskyA2tau(zN)
returns zN^2*(1-1728*zN) according to equation~eqref{eq:A2
-tau}.
- chudnovskyABFCoefficients: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, String) -> List AlgebraicNumber
chudnovskyABFCoefficients(nn,gammaN,tauN,zN,basedir)
returns a list [a,b
,f
] such that $1/pi =f
sum_{n=0
}^infty (an
+b
)*(6n)!/
(3n)!/
(n!
)^3*z_N^n$ where the Sato-Eigenvalue triple (nn
,gammaN
,tauN
) is such that moebiusTransform(gammaN
,tauN
)=nn*tauN. For the Chudnovsky case we require zN=1/j(tauN
) wherej
is the Kleinj
-invariant. The common factorf
is chosen in such a way that A andB
possibly have no denominator. It returns the empty list if no such triple can be proven. The string concat[basedir
,"/"
,string(nn
)] in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- chudnovskyB2tauCandidates: (PositiveInteger, AlgebraicNumber, String) -> List AlgebraicNumber
chudnovskyB2tauCandidates(nn,zN,basedir)
returns a list of candidate values forB
(tau)^2
according to eqref{eq:def-AB} and eqref{eq:def-K
-tau-Chudnovsky} coming from the zeros of the respective polynomial for $K
(tau)$. Note that tau is not actually directly needed. In this particular case the value ofB
(tau) only depends on zN=1/j(tau) wherej
is the Kleinj
invariant. The string concat[basedir
,"/"
,string(nn
)] is the directory in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- chudnovskyChi: Matrix Integer -> Integer
chudnovskyChi(m)
returns the multiplier in the transformation of sqrt(E4
).
- chudnovskyContainsOneOverPiInterval?: (NonNegativeInteger, List AlgebraicNumber, AlgebraicNumber) -> Boolean
chudnovskyContainsOneOverPiInterval?(m,abf,zN)
returnstrue
iff the one overpi
formular corresponding to the Chudnovsky family and the parameters a,b
,f
, andzN
) contains 1/pi. No floating point computation is involved in the implementation.
- chudnovskyModularPolynomial: (PositiveInteger, String, List NonNegativeInteger, String) -> Polynomial Integer
chudnovskyModularPolynomial(nn,kind,d,basedir)
with kind=”1” or kind=”N” eighter reads the file given by concat[basedir
,"/"
,string(nn
),”/modpol”,kind
,"K
.input”] and returns its contents (a polynomial) or explicityly calls modularPolynomial$QEtaModularEquationQ(An(QQ
)) in order to compute it and then stores it in that file.
- chudnovskyOneOverPiFormula: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, String) -> Equation Expression Integer
chudnovskyOneOverPiFormula(nn,gammaN,tauN,zN,basedir)
returns a 1/pi formula for the Sato-Eigenvalue triple (nn
,gammaN
,tauN
) such that moebiusTransform(gammaN
,tauN
)=nn*tauN. For the Chudnovsky case we require zN=1/j(tN
) wherej
is the Kleinj
-invariant. The string concat[basedir
,"/"
,string(nn
)] in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- chudnovskyOneOverPiSummand: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, Symbol, String) -> List Expression Integer
chudnovskyOneOverPiSummand(nn,gammaN,tauN,zN,nsy,basedir)
returns a summand for a 1/pi formula together with a common factor for the Sato-Eigenvalue triple (nn
,gammaN
,tauN
) such that moebiusTransform(gammaN
,tauN
)=nn*tauN. For the Chudnovsky case we require zN=1/j(tN
) wherej
is the Kleinj
-invariant. As the running variable, the symbolnsy
is used. The string concat[basedir
,"/"
,string(nn
)] in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- chudnovskySelectABF: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, AlgebraicNumber, List AlgebraicNumber) -> List AlgebraicNumber
chudnovskySelectABF(nn,gN,tauN,zN,a2tau,b2taucands)
eighter returns a triple [A,B
,F
] such that $1/pi =F
sum_{n=0
}^infty (An
+b
)y
(n
) z_N^n$ where $y
(n
) = frac{(6n)!}{(3n)! (n!
)^3
}$ or returns the empty list if the candidates involve imaginary radicals. The common factorf
is chosen in such a way that a andb
possibly have no denominator.
- containsOneOverPiInterval?: (NonNegativeInteger, List AlgebraicNumber, AlgebraicNumber, NonNegativeInteger -> Fraction Integer, AInterval Fraction Integer) -> Boolean
containsOneOverPiInterval?(m,abf,zN,y,ivy)
returnstrue
if the rational interval corresponding to the approximating rational intervals with for the algebraic numbers a,b
,f
, andzN
(expressed in radicals) with about 45 digits of precision contains a rational approximating rational interval forpi
with 50 digits of precision. No floating point computation is involved in the implementation.
- convergentInterval: AInterval Fraction Integer -> AInterval Fraction Integer
convergentInterval(x)
returns an invervalz
such that contains?(z
,x
) and the bounds ofz
are rational numbers whose numerator and denominator are appropriate continued fraction approximations of the respective bounds ofx
.
- exp2PiI: AlgebraicNumber -> Expression Integer
exp2PiI(tau)
computes exp(2*pi*i*tau) fortau
of the form tau=(a+b*sqrt(c
))/d
with 2*a/d integer,c<0
,b>0
.
- exp2PiIInterval: AlgebraicNumber -> AInterval Fraction Integer
exp2PiIInterval(tau)
returns expPiIInterval(2*tau).
- expPiI: AlgebraicNumber -> Expression Integer
expPiI(tau)
computes exp(pi*i*tau) fortau
of the form tau=(a+b*sqrt(c
))/d
with a/d integer,c<0
,b>0
.
- expPiIInterval: AlgebraicNumber -> AInterval Fraction Integer
expPiIInterval(tau)
determines an intervalqi
that uses a heuristically determined number of terms for the expansion of the exponential function to make the interval rather small, such that fortau
of the form $sqrt{-d
}+n
$ withn
integral andd>0
we have ql<q<qh where $q=s*exp(-pisqrt{d
})$ withs=1
ifn
is even ands=
-1 ifs
is odd. We make sure that not contains?(qi
,0).
- gosperABFCoefficients: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, String) -> List AlgebraicNumber
gosperABFCoefficients(nn,gN,tauN,zN,basedir)
returns a list [a,b
,f
] such that $1/pi =f
sum_{n=0
}^infty (an
+b
)*(4n)!/
(n!
)^4*z_N^n$ where the Sato-Eigenvalue triple (nn
,gammaN,tauN
) is such that moebiusTransform(gammaN,tauN
)=nn*tauN. For the Gosper case we require zN=1/iota(tauN
) where iota is given by equation eqref{eq:def-iota}. The common factorf
is chosen in such a way that A andB
possibly have no denominator. It returns the empty list if no such triple can be proven. The string concat[basedir
,"/"
,string(nn
)] in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- gosperAtau: AlgebraicNumber -> AlgebraicNumber
gosperAtau(zN)
returnszN*
(1-256*zN) according to equation~ref{sec:gosper-computation-A(tauy)}.
- gosperBtauCandidates: (PositiveInteger, AlgebraicNumber, String) -> List AlgebraicNumber
gosperBtauCandidates(nn,zN,basedir)
returns a list of candidate values forB
(tau) according to eqref{eq:def-AB} and eqref{eq:def-K
-tau-Gosper} coming from the zeros of the respective polynomial for $K
(tau)$. Note that tau is not actually directly needed. In this particular case the value ofB
(tau) only depends on zN=1/iota(tau) where iota is given by equation eqref{eq:def-iota}. The string concat[basedir
,"/"
,string(nn
)] is the directory in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- gosperCheckModularPolynomial: (String, XHashTable(Matrix Integer, List Integer), XHashTable(Matrix Integer, List Integer), List Symbol, PositiveInteger, String) -> Boolean
gosperCheckModularPolynomial(id,hlt,hlf,syms,nn,basedir)
reads the modular polynomial for caseid
(whereid
can be one of “1N”, “1K”, “NK”), then plugs in the serieshlf
andhlt
for the variables insyms
and returnstrue
iff the resulting (truncated series) vanishes. The directorybasedir
is use to look for a precomputed version of the modular polynomial.
- gosperContainsOneOverPiInterval?: (NonNegativeInteger, List AlgebraicNumber, AlgebraicNumber) -> Boolean
gosperContainsOneOverPiInterval?(m,abf,zN)
returnstrue
iff the one overpi
formular corresponding to the Gosper family and the parameters a,b
,f
, andzN
) contains 1/pi. No floating point computation is involved in the implementation.
- gosperIotaAt: (PositiveInteger, NonNegativeInteger, AlgebraicNumber, String) -> AlgebraicNumber
gosperIotaAt(nn,m,tau,basedir)
returnsz
wherez
is a radical root of a polynomial in facs and its floating point value is in the interval gosperIotaInterval(m
,tau
). Then there is no other root different fromz
of a polynomial from facs that also falls into that interval. If either no root (expressible in radicals) falls into the interval or serveral roots fall into the interval, then the function aborts with an error.
- gosperIotaInterval: (NonNegativeInteger, AlgebraicNumber) -> AInterval Fraction Integer
gosperIotaInterval(m,tau)
returns boundswl
andwh
for the evaluation of $iota(tau)$ where $q=
exp(pii
tau)$ is real and $0 <q_l
<|q|
<q_h
< 1$ for a sufficiently small real interval $(q_l
,q_h
)$ such that $w_l<iota(tau)<w_h$. The parameterm
specifies how many terms of the respective theta series are taken into account.
- gosperModularPolynomial1N: (PositiveInteger, String) -> Polynomial Integer
gosperModularPolynomial1N(nn,basedir)
computes the modular polynomial between the series corresponding toexIota1
and exIotaN.
- gosperModularPolynomial: (String, (Record(fdelta: PositiveInteger, fgamma: Matrix Integer, fred: Matrix Integer, ftriang: Matrix Integer), Fraction Integer) -> QEtaLaurentSeries Fraction Integer, (Record(fdelta: PositiveInteger, fgamma: Matrix Integer, fred: Matrix Integer, ftriang: Matrix Integer), Fraction Integer) -> QEtaLaurentSeries Fraction Integer, List Symbol, PositiveInteger, List Record(fdelta: PositiveInteger, fgamma: Matrix Integer, fred: Matrix Integer, ftriang: Matrix Integer), String) -> Polynomial Integer
gosperModularPolynomial(id,fa,fb,syms,nn,cmats,modpoldir)
either reads the file given by concat[modpoldir
,”/modpol”,id
,”.input”] and returns its contents (a polynomial) or explicityly calls modularPolynomial$QEtaModularEquationT(trfs) forfa
andfb
in order to compute it and then stores it in that file where trfs is given though the fgamma parts ofcmats
. We assume thatcmats
represents (some) cusps of Gamma(nn
).syms
must be a 2-element list that represents the variables for [fa
,fb
].
- gosperModularPolynomial: (String, XHashTable(Matrix Integer, List Integer), XHashTable(Matrix Integer, List Integer), List Symbol, PositiveInteger, String, PositiveInteger) -> Polynomial Integer
gosperModularPolynomial(id,hlt,hlf,syms,nn,basedir,p)
computes the modular polynomial of series given by their truncated integer representation. The computation is done in characteristicp
and lifted to integers ifp
is a prime. Currentlyp=0
is not (yet) implemented.
- gosperOneOverPiFormula: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, String) -> Equation Expression Integer
gosperOneOverPiFormula(nn,gammaN,tauN,zN,basedir)
returns a 1/pi formula for the Sato-Eigenvalue triple (nn
,gammaN
,tauN
) such that moebiusTransform(gammaN
,tauN
)=nn*tauN. For the Gosper case we require zN=1/iota(tauN
) where iota is given by equation eqref{eq:def-iota}. The string concat[basedir
,"/"
,string(nn
)] in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- gosperOneOverPiSummand: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, Symbol, String) -> List Expression Integer
gosperOneOverPiSummand(nn,gammaN,tauN,zN,nsy,basedir)
returns a summand for a 1/pi formula together with a commond factor for the Sato-Eigenvalue triple (nn
,gammaN
,tauN
) such that moebiusTransform(gammaN
,tauN
)=nn*tauN. For the Gosper case we require zN=1/iota(tauN
) where iota is given by equation eqref{eq:def-iota}. The string concat[basedir
,"/"
,string(nn
)] in which the function looks for precomputed modular polynomials with names modpol1K.input and modpolNK.input. If they exist they are read and used, otherwise the function computes them and writes these polynomials to the respective files in this directory unless thebasedir
is empty.
- gosperSelectABF: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, AlgebraicNumber, List AlgebraicNumber) -> List AlgebraicNumber
gosperSelectABF(nn,gN,tauN,zN,atau,btaucands)
eighter returns a triple [a,b
,f
] such that $1/pi =f
sum_{n=0
}^infty (an
+b
)y
(n
) z_N^n$ where $y
(n
) = frac{(4n)!}{(n!
)^4
}$ or returns the empty list if the candidates involve imaginary radicals. The common factorf
is chosen in such a way that a andb
possibly have no denominator.
- kleinJAt: (NonNegativeInteger, AlgebraicNumber, List SparseUnivariatePolynomial Integer) -> AlgebraicNumber
kleinJAt(m,tau,facs)
returnsz
wherez
is a radical root of a polynomial infacs
and its floating point value is in the interval kleinJInterval(m
,tau
). Then there is no other root different fromz
of a polynomial fromfacs
that also falls into that interval. If either no root (expressible in radicals) falls into the interval or serveral roots fall into the interval, then the function aborts with an error.
- kleinJInterval: (NonNegativeInteger, AlgebraicNumber) -> AInterval Fraction Integer
kleinJInterval(m,tau)
returns an intervalwi
with bounds wl=inf(wi
) and wh=sup(wi
) for the evaluation ofj
(tau) where $q:=exp(2*pi*i*tau)$ is real and $inf(qi
) <q
< sup(qi
)$ for $qi=exp2PiIInterval(tau
)$ with $0<inf(abs(qi
))<sup(abs(qi
))<1
$ such that $w_l<j(tau)<w_h$. The parameterm
specifies how many terms of the respective theta series are taken into account.
- modularLambdaInterval: (NonNegativeInteger, AlgebraicNumber) -> AInterval Fraction Integer
modularLambdaH(
m
,tau) returns for a tau of the form $sqrt{-d
}+n
$ withn
integral andd>0
an interval mli such that $inf(mli)<lambda(tau)<sup(mli)$ by truncating the involved $theta$ series after them
-th term.
- oneOverPiFormulaInterval: (NonNegativeInteger, AInterval Fraction Integer, Integer, AInterval Fraction Integer, AInterval Fraction Integer, NonNegativeInteger -> Fraction Integer, AInterval Fraction Integer) -> AInterval Fraction Integer
oneOverPiFormulaInterval(m,ivf,a,ivb,ivt,y,ivy)
returns an interval iv such that for any (f
,b
,t
) with contains?(ivf
,f
) and contains?(ivb
,b
) and contains?(ivt
,z
),y
(n
)>=0
is then
-th coefficient in the respective 1/pi formula and inv(ivy
)^n<=y(n
)<=n*y(n
)<=sup(ivy
)^n
for $s=f*sum_{n=0
}^infty(an+b)y
(n
)t^n
$ it holds inf(iv)<=s<=sup(iv). If error?(.) on any of the input intervals istrue
, then also oneOverPiFormulaInterval returns an error interval [0,-1
]. Ifm
is not big enough such that the remainder term is not positive, then the function returns the error interval [0,-2
].
- oneOverPiTerm: (PositiveInteger, Matrix Integer, AlgebraicNumber, AlgebraicNumber, AlgebraicNumber, AlgebraicNumber, NonNegativeInteger -> Fraction Integer, NonNegativeInteger) -> AlgebraicNumber
oneOverPiTerm(nn,gN,tauN,atauy,btauN,zN,y,n)
computes then
-th term of the 1/pi series, see eqref{eq:1
-over-pi
-sum} where $u_pi$ is put to the right-hand side.
- tauDInterval: AlgebraicNumber -> AInterval Fraction Integer
tauInterval(tau) computes an interval (
tl
,th) such that tl<t<th where $t=-
pi sqrt{d
}$ and tau must be of the form $sqrt{-d
}+n
$ wheren
is an integer andd>0
.