API reference¶
All names below are available directly on the top-level pyintval module.
Interval¶
- class pyintval.Interval¶
A closed, connected set of real numbers with double-precision endpoints.
Construct from bounds
Interval(lo, hi), from a single real numberInterval(x)(a degenerate point interval), or from a stringInterval("[0.1, 0.2]")/Interval("0.1")which is parsed with correct outward rounding so the result provably encloses the exact decimal value.Every operation returns an interval guaranteed to contain the true image of the operation over its inputs. Division by an interval containing zero yields an unbounded interval (or the empty set) rather than raising.
- __and__(self: pyintval._core.Interval, arg0: pyintval._core.Interval) pyintval._core.Interval¶
- __contains__(self: pyintval._core.Interval, arg0: object) bool¶
- __or__(self: pyintval._core.Interval, arg0: pyintval._core.Interval) pyintval._core.Interval¶
- contains(self: pyintval._core.Interval, value: object) bool¶
True if value (a number or interval) lies in self.
- static empty() pyintval._core.Interval¶
The empty set.
- property endpoints¶
The pair (lo, hi).
- static entire() pyintval._core.Interval¶
The whole real line (-inf, +inf).
- property hi¶
Upper endpoint (-inf for the empty set).
- hull(self: pyintval._core.Interval, other: pyintval._core.Interval) pyintval._core.Interval¶
Interval hull of the union of self and other.
- intersection(self: pyintval._core.Interval, other: pyintval._core.Interval) pyintval._core.Interval¶
- property is_common¶
True if the interval is nonempty and bounded.
- is_disjoint(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- property is_empty¶
- property is_entire¶
- is_interior_to(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- property is_singleton¶
True if the interval is a single point.
- less(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- property lo¶
Lower endpoint (+inf for the empty set).
- property mag¶
the largest absolute value attained in the interval.
- Type:
Magnitude
- property mid¶
A finite midpoint inside the interval.
- property mig¶
the smallest absolute value attained in the interval.
- Type:
Mignitude
- overlaps(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- precedes(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- property rad¶
Radius (half width, rounded up).
- strict_less(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- strict_precedes(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
- subset(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
True if self is a subset of other.
- superset(self: pyintval._core.Interval, other: pyintval._core.Interval) bool¶
True if self is a superset of other.
- property wid¶
Width, rounded up.
DecoratedInterval¶
- class pyintval.DecoratedInterval¶
An interval paired with an IEEE 1788 decoration certifying, from the computation’s history, the strongest property known of the function evaluated so far: ‘com’ (defined, continuous, bounded on a common input), ‘dac’ (defined and continuous), ‘def’ (defined), ‘trv’ (only the enclosure is guaranteed), or ‘ill’ (not an interval). A result decoration of ‘dac’ or ‘com’ is a machine-checked certificate that the whole composed expression is defined and continuous on its input box.
- property decoration¶
The decoration as one of ‘com’/’dac’/’def’/’trv’/’ill’.
- static from_parts(interval: pyintval._core.Interval, decoration: str) pyintval._core.DecoratedInterval¶
Build a decorated interval from a bare interval and an explicit decoration.
- property hi¶
- property interval¶
The bare interval.
- property is_common¶
- property is_defined¶
- property is_defined_and_continuous¶
- property is_nai¶
- property lo¶
- static nai() pyintval._core.DecoratedInterval¶
The Not-an-Interval (ill) value.
Elementary functions¶
Each math function is polymorphic: an Interval argument returns an Interval,
a DecoratedInterval returns a DecoratedInterval carrying the propagated
decoration.
- pyintval.sqrt(*args, **kwargs)¶
Overloaded function.
sqrt(x: pyintval._core.Interval) -> pyintval._core.Interval
sqrt(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.sqr(*args, **kwargs)¶
Overloaded function.
sqr(x: pyintval._core.Interval) -> pyintval._core.Interval
sqr(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.cbrt(*args, **kwargs)¶
Overloaded function.
cbrt(x: pyintval._core.Interval) -> pyintval._core.Interval
cbrt(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.exp(*args, **kwargs)¶
Overloaded function.
exp(x: pyintval._core.Interval) -> pyintval._core.Interval
exp(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.exp2(*args, **kwargs)¶
Overloaded function.
exp2(x: pyintval._core.Interval) -> pyintval._core.Interval
exp2(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.exp10(*args, **kwargs)¶
Overloaded function.
exp10(x: pyintval._core.Interval) -> pyintval._core.Interval
exp10(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.expm1(*args, **kwargs)¶
Overloaded function.
expm1(x: pyintval._core.Interval) -> pyintval._core.Interval
expm1(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.log(*args, **kwargs)¶
Overloaded function.
log(x: pyintval._core.Interval) -> pyintval._core.Interval
log(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.log2(*args, **kwargs)¶
Overloaded function.
log2(x: pyintval._core.Interval) -> pyintval._core.Interval
log2(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.log10(*args, **kwargs)¶
Overloaded function.
log10(x: pyintval._core.Interval) -> pyintval._core.Interval
log10(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.log1p(*args, **kwargs)¶
Overloaded function.
log1p(x: pyintval._core.Interval) -> pyintval._core.Interval
log1p(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.sin(*args, **kwargs)¶
Overloaded function.
sin(x: pyintval._core.Interval) -> pyintval._core.Interval
sin(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.cos(*args, **kwargs)¶
Overloaded function.
cos(x: pyintval._core.Interval) -> pyintval._core.Interval
cos(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.tan(*args, **kwargs)¶
Overloaded function.
tan(x: pyintval._core.Interval) -> pyintval._core.Interval
tan(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.asin(*args, **kwargs)¶
Overloaded function.
asin(x: pyintval._core.Interval) -> pyintval._core.Interval
asin(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.acos(*args, **kwargs)¶
Overloaded function.
acos(x: pyintval._core.Interval) -> pyintval._core.Interval
acos(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.atan(*args, **kwargs)¶
Overloaded function.
atan(x: pyintval._core.Interval) -> pyintval._core.Interval
atan(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.atan2(*args, **kwargs)¶
Overloaded function.
atan2(y: pyintval._core.Interval, x: pyintval._core.Interval) -> pyintval._core.Interval
atan2(y: pyintval::DecoratedInterval, x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.sinh(*args, **kwargs)¶
Overloaded function.
sinh(x: pyintval._core.Interval) -> pyintval._core.Interval
sinh(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.cosh(*args, **kwargs)¶
Overloaded function.
cosh(x: pyintval._core.Interval) -> pyintval._core.Interval
cosh(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.tanh(*args, **kwargs)¶
Overloaded function.
tanh(x: pyintval._core.Interval) -> pyintval._core.Interval
tanh(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.asinh(*args, **kwargs)¶
Overloaded function.
asinh(x: pyintval._core.Interval) -> pyintval._core.Interval
asinh(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.acosh(*args, **kwargs)¶
Overloaded function.
acosh(x: pyintval._core.Interval) -> pyintval._core.Interval
acosh(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.atanh(*args, **kwargs)¶
Overloaded function.
atanh(x: pyintval._core.Interval) -> pyintval._core.Interval
atanh(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.hypot(*args, **kwargs)¶
Overloaded function.
hypot(x: pyintval._core.Interval, y: pyintval._core.Interval) -> pyintval._core.Interval
hypot(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.pow(*args, **kwargs)¶
Overloaded function.
pow(x: pyintval._core.Interval, y: pyintval._core.Interval) -> pyintval._core.Interval
pow(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.pown(*args, **kwargs)¶
Overloaded function.
pown(x: pyintval._core.Interval, n: typing.SupportsInt | typing.SupportsIndex) -> pyintval._core.Interval
pown(x: pyintval::DecoratedInterval, n: typing.SupportsInt | typing.SupportsIndex) -> pyintval::DecoratedInterval
- pyintval.erf(*args, **kwargs)¶
Overloaded function.
erf(x: pyintval._core.Interval) -> pyintval._core.Interval
erf(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.erfc(*args, **kwargs)¶
Overloaded function.
erfc(x: pyintval._core.Interval) -> pyintval._core.Interval
erfc(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
Rounding, sign, and step functions¶
- pyintval.abs(*args, **kwargs)¶
Overloaded function.
abs(x: pyintval._core.Interval) -> pyintval._core.Interval
abs(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.fma(*args, **kwargs)¶
Overloaded function.
fma(x: pyintval._core.Interval, y: pyintval._core.Interval, z: pyintval._core.Interval) -> pyintval._core.Interval
Fused multiply-add: a tight enclosure of x*y + z.
fma(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval, z: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.recip(*args, **kwargs)¶
Overloaded function.
recip(x: pyintval._core.Interval) -> pyintval._core.Interval
recip(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.floor(*args, **kwargs)¶
Overloaded function.
floor(x: pyintval._core.Interval) -> pyintval._core.Interval
floor(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.ceil(*args, **kwargs)¶
Overloaded function.
ceil(x: pyintval._core.Interval) -> pyintval._core.Interval
ceil(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.trunc(*args, **kwargs)¶
Overloaded function.
trunc(x: pyintval._core.Interval) -> pyintval._core.Interval
trunc(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.round(*args, **kwargs)¶
Overloaded function.
round(x: pyintval._core.Interval) -> pyintval._core.Interval
round(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.round_ties_to_away(*args, **kwargs)¶
Overloaded function.
round_ties_to_away(x: pyintval._core.Interval) -> pyintval._core.Interval
round_ties_to_away(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.sign(*args, **kwargs)¶
Overloaded function.
sign(x: pyintval._core.Interval) -> pyintval._core.Interval
sign(x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.min(*args, **kwargs)¶
Overloaded function.
min(x: pyintval._core.Interval, y: pyintval._core.Interval) -> pyintval._core.Interval
min(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.max(*args, **kwargs)¶
Overloaded function.
max(x: pyintval._core.Interval, y: pyintval._core.Interval) -> pyintval._core.Interval
max(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
Set operations and reverse (constraint) operations¶
- pyintval.hull(*args, **kwargs)¶
Overloaded function.
hull(x: pyintval._core.Interval, y: pyintval._core.Interval) -> pyintval._core.Interval
hull(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.intersection(*args, **kwargs)¶
Overloaded function.
intersection(x: pyintval._core.Interval, y: pyintval._core.Interval) -> pyintval._core.Interval
intersection(x: pyintval::DecoratedInterval, y: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.cancel_minus(*args, **kwargs)¶
Overloaded function.
cancel_minus(a: pyintval._core.Interval, b: pyintval._core.Interval) -> pyintval._core.Interval
cancel_minus(a: pyintval::DecoratedInterval, b: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.cancel_plus(*args, **kwargs)¶
Overloaded function.
cancel_plus(a: pyintval._core.Interval, b: pyintval._core.Interval) -> pyintval._core.Interval
cancel_plus(a: pyintval::DecoratedInterval, b: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.mul_rev(*args, **kwargs)¶
Overloaded function.
mul_rev(b: pyintval._core.Interval, c: pyintval._core.Interval) -> pyintval._core.Interval
{x : b*x meets c} as an interval hull.
mul_rev(b: pyintval._core.Interval, c: pyintval._core.Interval, x: pyintval._core.Interval) -> pyintval._core.Interval
mul_rev(b: pyintval::DecoratedInterval, c: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
mul_rev(b: pyintval::DecoratedInterval, c: pyintval::DecoratedInterval, x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.sqr_rev(*args, **kwargs)¶
Overloaded function.
sqr_rev(c: pyintval._core.Interval) -> pyintval._core.Interval
sqr_rev(c: pyintval._core.Interval, x: pyintval._core.Interval) -> pyintval._core.Interval
sqr_rev(c: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
sqr_rev(c: pyintval::DecoratedInterval, x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
- pyintval.abs_rev(*args, **kwargs)¶
Overloaded function.
abs_rev(c: pyintval._core.Interval) -> pyintval._core.Interval
abs_rev(c: pyintval._core.Interval, x: pyintval._core.Interval) -> pyintval._core.Interval
abs_rev(c: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
abs_rev(c: pyintval::DecoratedInterval, x: pyintval::DecoratedInterval) -> pyintval::DecoratedInterval
Constructors and constants¶
- pyintval.empty() pyintval._core.Interval¶
- pyintval.entire() pyintval._core.Interval¶
- pyintval.pi() pyintval._core.Interval¶
A tight interval enclosing the mathematical constant pi.
- pyintval.e() pyintval._core.Interval¶
A tight interval enclosing Euler’s number e.