arb_poly – polynomials over real numbers¶

class flint.arb_poly(val=None)
coeffs(self)
degree(self) → long
derivative(self)
evaluate(self, xs, algorithm='fast')

Multipoint evaluation: evaluates self at the list of points xs. The algorithm can be ‘iter’ or ‘fast’. The ‘fast’ algorithm is asymptotically fast, but has worse numerical stability.

Note: for ordinary single-point evaluation, just call the polynomial with the point as the argument.

from_roots(type cls, roots)

Constructs the monic polynomial whose roots are the given real numbers.

>>> arb_poly.from_roots(range(4))
1.00000000000000*x^4 + (-6.00000000000000)*x^3 + 11.0000000000000*x^2 + (-6.00000000000000)*x


There is currently no dedicated method to construct a real polynomial from complex conjugate roots (use acb_poly.from_roots()).

integral(self)
interpolate(type cls, xs, ys, algorithm='fast')

Constructs the unique interpolating polynomial of length at most n taking the values ys when evaluated at the n distinct points xs. Algorithm can be ‘newton’, ‘barycentric’ or ‘fast’. The ‘fast’ algorithm is asymptotically fast, but has worse numerical stability.

length(self) → long
repr(self)
roots(self, **kwargs)

Isolates the complex roots of self. See acb_poly.roots() for details.

str(self, bool ascending=False)

Convert to a human-readable string (generic implementation for all polynomial types).

If ascending is True, the monomials are output from low degree to high, otherwise from high to low.

unique_fmpz_poly(self)