Public API
PWPoly.approximate_roots — Method
approximate_roots(coeffs; log2eps=-53, nbMroots=-1, acb=false,
domain_num=zeros(BigInt,4), domain_den=zeros(BigInt,4))Find the complex roots of a polynomial with integer coefficients. Unlike isolate_roots, the polynomial does NOT need to be square-free. Returns multiplicity information (sum of multiplicities per cluster).
Arguments
coeffs: Vector of integer coefficients [a0, a1, ..., an] for p(x) = a0 + a1x + ... + anx^nlog2eps: log of desired relative precision of the output (default -53)nbMroots: max number of roots to find (-1 = all)acb: iftrue, return roots asVector{ComplexFieldElem}(Arb balls with radius); defaultfalsereturnsVector{Complex{BigFloat}}(midpoint only)domain_num,domain_den: domain bounds [lre, ure, lim, uim] as rationals num/den; default is the whole complex plane (zero vectors)
Returns
roots: roots of the polynomialmultiplicities: Vector{Int} sum of multiplicities per clusteris_real: Vector{Bool} indicating which roots are realnbreals: number of real roots
PWPoly.approximate_roots_complex — Method
approximate_roots_complex(coeffs_real, coeffs_imag; log2eps=-53, nbMroots=-1, acb=false,
domain_num=zeros(BigInt,4), domain_den=zeros(BigInt,4))Find the complex roots of a polynomial with complex integer coefficients. The polynomial does NOT need to be square-free.
Arguments
coeffs_real: Vector of integer coefficients of the real partcoeffs_imag: Vector of integer coefficients of the imaginary partlog2eps: log of desired relative precision of the output (default -53)nbMroots: max number of roots to find (-1 = all)acb: iftrue, return roots asVector{ComplexFieldElem}(Arb balls with radius); defaultfalsereturnsVector{Complex{BigFloat}}(midpoint only)domain_num,domain_den: domain bounds [lre, ure, lim, uim] as rationals num/den; default is the whole complex plane (zero vectors)
Returns
roots: roots of the polynomialmultiplicities: Vector{Int} sum of multiplicities per cluster
PWPoly.evaluate_polynomial — Method
evaluate_polynomial(coeffs, points; precision=53)Evaluate a polynomial with rational or integer coefficients at complex points.
Arguments
coeffs: Vector of integer or rational coefficients [a0, a1, ..., an] for p(x) = a0 + a1x + ... + anx^npoints: Vector ofComplexFieldElemorComplex{BigFloat}to evaluate atprecision: target desired relative precision in bits (default 53). Internally, the C library uses working prec = 2*(m + ceil(log₂(length))), where length is degree + 1.
Returns
values: Vector of the same element type aspoints
PWPoly.evaluate_polynomial_complex — Method
evaluate_polynomial_complex(coeffs_re, coeffs_im, points; precision=53)Evaluate a polynomial with complex rational/integer coefficients p(x) = pre(x) + i·pim(x) at complex points.
Arguments
coeffs_re: Vector of integer/rational coefficients of the real partcoeffs_im: Vector of integer/rational coefficients of the imaginary partpoints: Vector ofComplexFieldElemorComplex{BigFloat}to evaluate atprecision: target desired relative precision in bits (default 53). Internally, the C library uses working prec = 2*(m + ceil(log₂(length))), where length is degree + 1.
Returns
values: Vector of the same element type aspoints
PWPoly.isolate_roots — Method
isolate_roots(coeffs; log2eps=-53, nbMroots=-1, acb=false,
domain_num=zeros(BigInt,4), domain_den=zeros(BigInt,4))Find the complex roots of a square-free polynomial with integer coefficients.
Arguments
coeffs: Vector of integer coefficients [a₀, a₁, ..., aₙ] for p(x) = a₀ + a₁x + ... + aₙxⁿlog2eps: log of desired relative precision of the output (default -53)nbMroots: max number of roots to find (-1 = all)acb: iftrue, return roots asVector{ComplexFieldElem}(Arb balls with radius); defaultfalsereturnsVector{Complex{BigFloat}}(midpoint only)domain_num,domain_den: domain bounds [lre, ure, lim, uim] as rationals num/den; default is the whole complex plane (zero vectors)
Returns
roots: roots of the polynomialis_real: Vector{Bool} indicating which roots are realnbreals: number of real roots
PWPoly.isolate_roots_complex — Method
isolate_roots_complex(coeffs_real, coeffs_imag; log2eps=-53, nbMroots=-1, acb=false,
domain_num=zeros(BigInt,4), domain_den=zeros(BigInt,4))Find the complex roots of a square-free polynomial with complex integer coefficients. The polynomial is given as p(x) = pre(x) + i·pim(x).
Arguments
coeffs_real: Vector of integer coefficients of the real partcoeffs_imag: Vector of integer coefficients of the imaginary partlog2eps: log of desired relative precision of the output (default -53)nbMroots: max number of roots to find (-1 = all)acb: iftrue, return roots asVector{ComplexFieldElem}(Arb balls with radius); defaultfalsereturnsVector{Complex{BigFloat}}(midpoint only)domain_num,domain_den: domain bounds [lre, ure, lim, uim] as rationals num/den; default is the whole complex plane (zero vectors)
Returns
roots: roots of the polynomial
PWPoly.refine_roots — Method
refine_roots(coeffs; epsilon=-53, nbMroots, acb=false,
domain_num, domain_den)Refine roots of a real polynomial in a bounded domain where the number of roots (counted with multiplicity) is known.
Arguments
coeffs: Vector of integer coefficients [a₀, a₁, ..., aₙ]epsilon: log of desired relative precision of the output (default -53)nbMroots: number of roots in the domain (counted with multiplicity)acb: iftrue, return roots asVector{ComplexFieldElem}(Arb balls with radius); defaultfalsereturnsVector{Complex{BigFloat}}(midpoint only)domain_num,domain_den: domain bounds [lre, ure, lim, uim] as rationals num/den (must be finite, i.e. all den ≠ 0)
Returns
roots: roots of the polynomialmultiplicities: Vector{Int} sum of multiplicities per clusteris_real: Vector{Bool} indicating which roots are realnbreals: number of real roots
PWPoly.refine_roots_complex — Method
refine_roots_complex(coeffs_real, coeffs_imag; epsilon=-53, nbMroots, acb=false,
domain_num, domain_den)Refine roots of a complex polynomial in a bounded domain where the number of roots (counted with multiplicity) is known.
Arguments
coeffs_real: Vector of integer coefficients of the real partcoeffs_imag: Vector of integer coefficients of the imaginary partepsilon: log of desired relative precision of the output (default -53)nbMroots: number of roots in the domain (counted with multiplicity)acb: iftrue, return roots asVector{ComplexFieldElem}(Arb balls with radius); defaultfalsereturnsVector{Complex{BigFloat}}(midpoint only)domain_num,domain_den: domain bounds [lre, ure, lim, uim] as rationals num/den (must be finite, i.e. all den ≠ 0)
Returns
roots: roots of the polynomialmultiplicities: Vector{Int} sum of multiplicities per cluster