Public API

PWPoly.approximate_rootsMethod
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^n
  • log2eps: log of desired relative precision of the output (default -53)
  • nbMroots: max number of roots to find (-1 = all)
  • acb: if true, return roots as Vector{ComplexFieldElem} (Arb balls with radius); default false returns Vector{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
  • multiplicities: Vector{Int} sum of multiplicities per cluster
  • is_real: Vector{Bool} indicating which roots are real
  • nbreals: number of real roots
source
PWPoly.approximate_roots_complexMethod
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 part
  • coeffs_imag: Vector of integer coefficients of the imaginary part
  • log2eps: log of desired relative precision of the output (default -53)
  • nbMroots: max number of roots to find (-1 = all)
  • acb: if true, return roots as Vector{ComplexFieldElem} (Arb balls with radius); default false returns Vector{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
  • multiplicities: Vector{Int} sum of multiplicities per cluster
source
PWPoly.evaluate_polynomialMethod
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^n
  • points: Vector of ComplexFieldElem or Complex{BigFloat} to evaluate at
  • precision: 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 as points
source
PWPoly.evaluate_polynomial_complexMethod
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 part
  • coeffs_im: Vector of integer/rational coefficients of the imaginary part
  • points: Vector of ComplexFieldElem or Complex{BigFloat} to evaluate at
  • precision: 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 as points
source
PWPoly.isolate_rootsMethod
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: if true, return roots as Vector{ComplexFieldElem} (Arb balls with radius); default false returns Vector{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
  • is_real: Vector{Bool} indicating which roots are real
  • nbreals: number of real roots
source
PWPoly.isolate_roots_complexMethod
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 part
  • coeffs_imag: Vector of integer coefficients of the imaginary part
  • log2eps: log of desired relative precision of the output (default -53)
  • nbMroots: max number of roots to find (-1 = all)
  • acb: if true, return roots as Vector{ComplexFieldElem} (Arb balls with radius); default false returns Vector{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
source
PWPoly.refine_rootsMethod
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: if true, return roots as Vector{ComplexFieldElem} (Arb balls with radius); default false returns Vector{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 polynomial
  • multiplicities: Vector{Int} sum of multiplicities per cluster
  • is_real: Vector{Bool} indicating which roots are real
  • nbreals: number of real roots
source
PWPoly.refine_roots_complexMethod
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 part
  • coeffs_imag: Vector of integer coefficients of the imaginary part
  • epsilon: log of desired relative precision of the output (default -53)
  • nbMroots: number of roots in the domain (counted with multiplicity)
  • acb: if true, return roots as Vector{ComplexFieldElem} (Arb balls with radius); default false returns Vector{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 polynomial
  • multiplicities: Vector{Int} sum of multiplicities per cluster
source