_Interval

it.grypho.scala.leonardo.core._Interval
See the_Interval companion class
object _Interval

Construction, the bound algebra, and the interval kernels of the elementary functions.

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
_Interval.type

Members list

Value members

Concrete methods

def add(a: _Value, b: _Value, env: Environment): Option[_Value]

a + b, when at least one is an interval; None otherwise or when not representable.

a + b, when at least one is an interval; None otherwise or when not representable.

Value parameters

a

the left operand

b

the right operand

env

the environment, for the exact tier's gcd policy

Attributes

Returns

the sum's interval, or None

def below(a: _Value, b: _Value, strict: Boolean, tol: Double): Option[Boolean]

Whether every point of a lies below every point of b (strict: <, else ≤), with the = tolerance: Some(true) when it holds for every pair, Some(false) when it fails for every pair, None (unknown) otherwise. At least one operand must be an interval.

Whether every point of a lies below every point of b (strict: <, else ≤), with the = tolerance: Some(true) when it holds for every pair, Some(false) when it fails for every pair, None (unknown) otherwise. At least one operand must be an interval.

Value parameters

a

the left operand

b

the right operand

strict

< rather than ≤

tol

the tolerance within which two points count as equal

Attributes

Returns

the verdict, or None when it depends on the points chosen

def comparable(a: _Value, b: _Value): Boolean

Whether a relation between a and b is a question about points of an interval: one of them is an interval and both have real bounds (F_0101). A complex number, a matrix or a truth value has none, so a relation with one is not decided here at all — it stays symbolic, as it would without the interval, rather than being answered unknown. below and equal answer None for both cases, so a caller asks this first.

Whether a relation between a and b is a question about points of an interval: one of them is an interval and both have real bounds (F_0101). A complex number, a matrix or a truth value has none, so a relation with one is not decided here at all — it stays symbolic, as it would without the interval, rather than being answered unknown. below and equal answer None for both cases, so a caller asks this first.

Value parameters

a

the left operand

b

the right operand

Attributes

Returns

whether below and equal apply

def divide(a: _Value, b: _Value, env: Environment): Option[_Value]

a / b, when at least one is an interval; None when the divisor contains zero, since the quotient is then two disjoint rays, not an interval.

a / b, when at least one is an interval; None when the divisor contains zero, since the quotient is then two disjoint rays, not an interval.

Value parameters

a

the dividend

b

the divisor

env

the environment, for the exact tier's gcd policy

Attributes

Returns

the quotient's interval, or None

def equal(a: _Value, b: _Value, tol: Double): Option[Boolean]

Whether a = b for every pair of points (Some(true)), for none (Some(false): the intervals are apart by more than tol), or neither (None, unknown).

Whether a = b for every pair of points (Some(true)), for none (Some(false): the intervals are apart by more than tol), or neither (None, unknown).

Value parameters

a

the left operand

b

the right operand

tol

the = tolerance, 0.5·10⁻ᵖ

Attributes

Returns

the verdict, or None when unknown or not comparable

def function(name: String, a: _Value, env: Environment): Option[_Value]

The interval image of a named elementary function, or None when the function has no interval rule here or the interval leaves its domain (a pole of tan, ln reaching zero, asin beyond ±1).

The interval image of a named elementary function, or None when the function has no interval rule here or the interval leaves its domain (a pole of tan, ln reaching zero, asin beyond ±1).

Value parameters

a

the argument, an interval

env

supplies the working precision for an exact interval

name

the function's grammar name: exp ln sin cos tan asin acos atan sinh cosh tanh abs

Attributes

Returns

the image, or None

def logBase(a: _Value, base: _Value, env: Environment): Option[_Value]

log_base(a) as ln(a) / ln(base), either of them an interval: a number's logarithm is itself enclosed, so the quotient stays rigorous. None outside the domain, and for a base whose logarithm interval contains zero (a base at or around 1).

log_base(a) as ln(a) / ln(base), either of them an interval: a number's logarithm is itself enclosed, so the quotient stays rigorous. None outside the domain, and for a base whose logarithm interval contains zero (a base at or around 1).

Value parameters

a

the argument

base

the base

env

supplies the working precision for exact operands

Attributes

Returns

the enclosure, or None

def multiply(a: _Value, b: _Value, env: Environment): Option[_Value]

a · b, when at least one is an interval.

a · b, when at least one is an interval.

Value parameters

a

the left operand

b

the right operand

env

the environment, for the exact tier's gcd policy

Attributes

Returns

the product's interval, or None when neither is an interval or it is not representable

def of(lo: _Value, hi: _Value): Option[_Value]

An interval from two endpoints, or None when they do not make one: an endpoint that is not a real number, a non-finite or NaN one, or lo > hi. Equal endpoints give the number itself.

An interval from two endpoints, or None when they do not make one: an endpoint that is not a real number, a non-finite or NaN one, or lo > hi. Equal endpoints give the number itself.

Value parameters

hi

the upper endpoint

lo

the lower endpoint

Attributes

Returns

the interval, the number, or None

def power(a: _Value, e: _Value, env: Environment): Option[_Value]

a ^ e for an interval a and a numeric exponent; None for an interval exponent, a negative power of an interval containing zero, a fractional power of an interval reaching below zero, or a result that is not representable.

a ^ e for an interval a and a numeric exponent; None for an interval exponent, a negative power of an interval containing zero, a fractional power of an interval reaching below zero, or a result that is not representable.

An integer power keeps the even/odd distinction ([−2, 1]² = [0, 4], not [1, 4]); a fractional one is monotone on [0, ∞).

Value parameters

a

the base, an interval

e

the exponent, a number

env

the environment, for the exact tier's gcd policy and working precision

Attributes

Returns

the power's interval, or None