Skip to main content

Crate neco_polynomial

Crate neco_polynomial 

Source
Expand description

§neco-polynomial

日本語

neco-polynomial provides canonical univariate polynomials over exact real algebraic coefficients, together with formal derivatives and validated interval evaluation.

§Features

Canonical Polynomial Construction

Constructing a polynomial removes trailing zero coefficients, which makes the coefficient representation unique. Every polynomial has at least one coefficient.

Exact and Interval Evaluation

Exact evaluation uses Horner’s method. The result of interval evaluation is an interval containing every value the polynomial takes over the supplied interval of dyadic rationals (rationals whose denominator is a power of two).

Typed Failures

Construction, arithmetic, and interval failures, and failures from exceeding resource limits, are returned as distinct variants. Algebraic failures keep the payload returned by the crate that defines the operation.

§Specifications and Constraints

OperationConstraintResult at the Limit
ConstructionCoefficients $\le 256$Returns PolynomialFailure::Resource for a larger coefficient sequence
DifferentiationDerivative order $\le 64$Returns PolynomialFailure::Resource for a larger order
Interval EvaluationPrecision $\le 256$ bitsReturns PolynomialFailure::Resource for a larger precision
CanonicalizationThe coefficient sequence is nonemptyReturns PolynomialFailure::EmptyCoefficients for an empty sequence. Removes trailing zero coefficients and represents the zero polynomial with one coefficient

§Runtime Configuration

The default configuration uses the standard library.

[dependencies]
neco-polynomial = "0.1"

Disabling the default std feature leaves dynamic memory allocation as the only runtime requirement, so the crate can be used in environments without the standard library. Polynomial and failure semantics are the same in both configurations.

[dependencies]
neco-polynomial = { version = "0.1", default-features = false }

§Dependencies

  • neco-algnum: Exact real algebraic coefficients and enclosures.
  • neco-bigint: Exact integer and dyadic arithmetic.

§License

MIT License. See the repository LICENSE for details.

Structs§

DerivativeOrder
Enclosure
Polynomial

Enums§

IntervalFailure
PolynomialFailure
ResourceFailure

Constants§

MAX_COEFFICIENTS
MAX_DERIVATIVE_ORDER
MAX_PRECISION_BITS