Skip to main content

Crate neco_rational

Crate neco_rational 

Source
Expand description

§neco-rational

日本語

neco-rational is a crate that provides exact rational functions formed from canonical polynomials. For both points and intervals, evaluation validates membership in the domain.

§Features

Validated Rational Functions

Construction keeps the canonical numerator and denominator polynomials and confirms that the denominator polynomial is nonzero.

Exact Point Evaluation

For values in the domain of the function, point evaluation gives an exact quotient.

Validated Interval Evaluation

The result of interval evaluation is an interval of dyadic rationals (rationals whose denominator is a power of two) that contains every quotient defined over the input interval.

Typed Failures

The variant of RationalFailure tells whether a failure arose in the domain, the polynomial, or the algebraic arithmetic, or came from exceeding a resource limit.

§Invariants and Validation Rules

TargetValidation RuleResult
ConstructionThe denominator polynomial is a canonical nonzero polynomialReturns RationalFailure when the denominator is the zero polynomial
Point EvaluationThe denominator value is nonzeroReturns a typed failure for an undefined point at a pole
Interval EvaluationThe denominator enclosure excludes zeroReturns a typed failure representing a domain violation for an interval containing a pole
ResourcesPolynomial coefficient and precision limits holdKeeps the failure that the dependency crate returns when a resource limit is exceeded

§Runtime Configuration

The default configuration uses the standard library.

[dependencies]
neco-rational = "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. Rational function and failure semantics are the same in both configurations.

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

§Dependencies

§License

MIT License. See the repository LICENSE for details.

Structs§

RationalFunction

Enums§

RationalFailure