Interval.add
function · packages/metakit/src/abstract/interval.ts:100
function add(a: Interval, b: Interval): IntervalMetakit / @doeixd/metakit/abstract
namespace · packages/metakit/src/abstract/interval.ts:10
export * as Interval from './abstract/interval.js'Interval abstract domain [lo, hi] with sound forward transformers for
numeric operators and Kleene $K_3$ comparison verdicts.
Every transformer satisfies Galois soundness over doubles: ∀ x ∈ γ(a), f(x) ∈ γ(f#(a)) since IEEE rounding is monotone, so the rounded bound of a sum or product still bounds every rounded sum or product inside.
Interval.addfunction · packages/metakit/src/abstract/interval.ts:100
function add(a: Interval, b: Interval): IntervalInterval.betweenfunction · packages/metakit/src/abstract/interval.ts:49
function between(lo: number, hi: number): IntervalInterval.bottomconst · packages/metakit/src/abstract/interval.ts:44
const bottom: IntervalEmpty interval (contradiction).
Interval.constantfunction · packages/metakit/src/abstract/interval.ts:58
function constant(value: number): IntervalInterval.containsfunction · packages/metakit/src/abstract/interval.ts:63
function contains(iv: Interval, value: number): booleanInterval.directedAddfunction · packages/metakit/src/abstract/interval.ts:91
function directedAdd(a: number, b: number, toward: -1 | 1): numbera + b rounded away from the exact sum in direction toward (-1 down, 1
up), so a bound stays a bound of the real sum as well as of the double.
The error term of Knuth's TwoSum says which side the double fell on.
Interval.Intervalinterface · packages/metakit/src/abstract/interval.ts:13
interface Interval {
readonly lo: number
readonly hi: number
}Interval.isfunction · packages/metakit/src/abstract/interval.ts:186
function is(a: Interval, b: Interval): Verdict.Verdict<never>Sound Kleene $K_3$ verdict for a == b.
Interval.isBottomfunction · packages/metakit/src/abstract/interval.ts:46
function isBottom(iv: Interval): booleanInterval.joinfunction · packages/metakit/src/abstract/interval.ts:77
function join(a: Interval, b: Interval): IntervalHull (least upper bound).
Interval.ltfunction · packages/metakit/src/abstract/interval.ts:170
function lt(a: Interval, b: Interval): Verdict.Verdict<never>Sound Kleene $K_3$ verdict for a < b.
Interval.ltefunction · packages/metakit/src/abstract/interval.ts:178
function lte(a: Interval, b: Interval): Verdict.Verdict<never>Sound Kleene $K_3$ verdict for a <= b.
Interval.meetfunction · packages/metakit/src/abstract/interval.ts:71
function meet(a: Interval, b: Interval): IntervalIntersection (greatest lower bound).
Interval.monotonefunction · packages/metakit/src/abstract/interval.ts:119
function monotone(
directions: ReadonlyArray<'up' | 'down'>,
at: (ends: ReadonlyArray<number>, toward: -1 | 1) => number,
): (args: ReadonlyArray<Interval>) => IntervalThe result of an operation that is monotone in each argument, in the
direction given for it: the low end from the operands' ends those
directions pick for a low result, the high end likewise. at computes one
end from the chosen operand ends, rounded away from the exact result
toward toward.
Interval.mulfunction · packages/metakit/src/abstract/interval.ts:143
function mul(a: Interval, b: Interval): IntervalInterval.negfunction · packages/metakit/src/abstract/interval.ts:105
function neg(a: Interval): IntervalInterval.nextDownfunction · packages/metakit/src/abstract/interval.ts:38
function nextDown(n: number): numberThe greatest double below n: x < n is x <= nextDown(n) over doubles.
Interval.nextUpfunction · packages/metakit/src/abstract/interval.ts:27
function nextUp(n: number): numberThe least double above n: x > n is x >= nextUp(n) over doubles. Both
zeros step to the least subnormal, the largest finite double to +∞, and NaN
and +∞ stay as they are.
Interval.SAFEconst · packages/metakit/src/abstract/interval.ts:56
const SAFE: IntervalThe integers a double holds exactly, which arithmetic must stay within or be refused.
Interval.subfunction · packages/metakit/src/abstract/interval.ts:110
function sub(a: Interval, b: Interval): IntervalInterval.topconst · packages/metakit/src/abstract/interval.ts:41
const top: IntervalUnbounded interval [-∞, +∞].
Interval.withinfunction · packages/metakit/src/abstract/interval.ts:67
function within(inner: Interval, outer: Interval): booleanWhether every value of inner is one of outer; an empty inner is within anything.