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) returns true if iv 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 (a n + 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) where j is the Klein j-invariant. The common factor f is chosen in such a way that A and B 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 the basedir is empty.

chudnovskyB2tauCandidates: (PositiveInteger, AlgebraicNumber, String) -> List AlgebraicNumber

chudnovskyB2tauCandidates(nn,zN,basedir) returns a list of candidate values for B(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 of B(tau) only depends on zN=1/j(tau) where j is the Klein j 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 the basedir 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) returns true iff the one over pi formular corresponding to the Chudnovsky family and the parameters a, b, f, and zN) 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) where j is the Klein j-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 the basedir 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) where j is the Klein j-invariant. As the running variable, the symbol nsy 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 the basedir 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 (A n + 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 factor f is chosen in such a way that a and b possibly have no denominator.

containsOneOverPiInterval?: (NonNegativeInteger, List AlgebraicNumber, AlgebraicNumber, NonNegativeInteger -> Fraction Integer, AInterval Fraction Integer) -> Boolean

containsOneOverPiInterval?(m,abf,zN,y,ivy) returns true if the rational interval corresponding to the approximating rational intervals with for the algebraic numbers a, b, f, and zN (expressed in radicals) with about 45 digits of precision contains a rational approximating rational interval for pi 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 inverval z such that contains?(z,x) and the bounds of z are rational numbers whose numerator and denominator are appropriate continued fraction approximations of the respective bounds of x.

exp2PiI: AlgebraicNumber -> Expression Integer

exp2PiI(tau) computes exp(2*pi*i*tau) for tau 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) for tau 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 interval qi that uses a heuristically determined number of terms for the expansion of the exponential function to make the interval rather small, such that for tau of the form $sqrt{-d}+n$ with n integral and d>0 we have ql<q<qh where $q=s*exp(-pisqrt{d})$ with s=1 if n is even and s=-1 if s 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 (a n + 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 factor f is chosen in such a way that A and B 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 the basedir is empty.

gosperAtau: AlgebraicNumber -> AlgebraicNumber

gosperAtau(zN) returns zN*(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 for B(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 of B(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 the basedir 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 case id (where id can be one of “1N”, “1K”, “NK”), then plugs in the series hlf and hlt for the variables in syms and returns true iff the resulting (truncated series) vanishes. The directory basedir is use to look for a precomputed version of the modular polynomial.

gosperContainsOneOverPiInterval?: (NonNegativeInteger, List AlgebraicNumber, AlgebraicNumber) -> Boolean

gosperContainsOneOverPiInterval?(m,abf,zN) returns true iff the one over pi formular corresponding to the Gosper family and the parameters a, b, f, and zN) contains 1/pi. No floating point computation is involved in the implementation.

gosperIotaAt: (PositiveInteger, NonNegativeInteger, AlgebraicNumber, String) -> AlgebraicNumber

gosperIotaAt(nn,m,tau,basedir) returns z where z 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 from z 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 bounds wl and wh for the evaluation of $iota(tau)$ where $q=exp(pi i 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 parameter m 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 to exIota1 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) for fa and fb in order to compute it and then stores it in that file where trfs is given though the fgamma parts of cmats. We assume that cmats 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 characteristic p and lifted to integers if p is a prime. Currently p=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 the basedir 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 the basedir 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 (a n + 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 factor f is chosen in such a way that a and b possibly have no denominator.

kleinJAt: (NonNegativeInteger, AlgebraicNumber, List SparseUnivariatePolynomial Integer) -> AlgebraicNumber

kleinJAt(m,tau,facs) returns z where z is a radical root of a polynomial in facs and its floating point value is in the interval kleinJInterval(m,tau). Then there is no other root different from z 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.

kleinJInterval: (NonNegativeInteger, AlgebraicNumber) -> AInterval Fraction Integer

kleinJInterval(m,tau) returns an interval wi with bounds wl=inf(wi) and wh=sup(wi) for the evaluation of j(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 parameter m 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$ with n integral and d>0 an interval mli such that $inf(mli)<lambda(tau)<sup(mli)$ by truncating the involved $theta$ series after the m-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 the n-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 is true, then also oneOverPiFormulaInterval returns an error interval [0,-1]. If m 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 the n-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$ where n is an integer and d>0.

tauInterval: Fraction Integer -> AInterval Fraction Integer

tauInterval(d) computes an interval (tl,th) such that tl<t<th where $t=-pi sqrt{d}$ and d>0.