interval

The interval package for real-valued interval arithmetic allows one to evaluate functions over subsets of their domain. All results are verified, because interval computations automatically keep track of any errors. These concepts can be used to handle uncertainties, estimate arithmetic errors and produce reliable results. Also it can be applied to computer-assisted proofs, constraint programming, and verified computing. The implementation is based on interval boundaries represented by binary64 numbers and is conforming to IEEE Std 1788-2015, IEEE standard for interval arithmetic.

Select category:

Interval constant

empty
Return the empty interval.
entire
Return the entire set of real numbers.
nai
Return the ill-formed decorated interval, called NaI (Not an Interval).

Interval constructor

hull
Create an interval enclosure for a list of parameters.
midrad
Create an interval enclosure I for [M-R, M+R].
@infsup/infsup
Create an interval (from boundaries).
@infsup/newdec
Create a decorated interval from a bare interval.
@infsupdec/infsupdec
Create a decorated interval from boundaries.

Interval function (most with tightest accuracy)

@infsup/abs
Compute the absolute value of numbers.
@infsup/acos
Compute the inverse cosine in radians (arccosine).
@infsup/acosh
Compute the inverse hyperbolic cosine.
@infsup/asin
Compute the inverse sine in radians (arcsine).
@infsup/asinh
Compute the inverse hyperbolic sine.
@infsup/atan
Compute the inverse tangent in radians.
@infsup/atan2
Compute the inverse tangent with two arguments.
@infsup/atanh
Compute the inverse hyperbolic tangent.
@infsup/cancelminus
Recover interval Z from intervals X and Y, given that one knows X was obtained as the sum Y + Z.
@infsup/cancelplus
Recover interval Z from intervals X and Y, given that one knows X was obtained as the difference Z - Y.
@infsup/cbrt
Compute the cube root.
@infsup/ceil
Round each number in interval X towards +Inf.
@infsup/cos
Compute the cosine in radians.
@infsup/cosh
Compute the hyperbolic cosine.
@infsup/cot
Compute the cotangent in radians, that is the reciprocal tangent.
@infsup/coth
Compute the hyperbolic cotangent, that is the reciprocal hyperbolic tangent.
@infsup/csc
Compute the cosecant in radians, that is the reciprocal sine.
@infsup/csch
Compute the hyperbolic cosecant, that is the reciprocal hyperbolic sine.
@infsup/dilog
Compute the real part of the dilogarithm function.
@infsup/ei
Compute the exponential integral for positive arguments.
@infsup/erf
Compute the error function.
@infsup/erfc
Compute the complementary error function ‘1 - erf (X)’.
@infsup/exp
Compute the exponential function.
@infsup/expm1
Compute ‘exp (X) - 1’ accurately in the neighborhood of zero.
@infsup/factorial
Compute the factorial of N where N is a non-negative integer.
@infsup/fix
Truncate fractional portion of each number in interval X.
@infsup/floor
Round each number in interval X towards -Inf.
@infsup/fma
Fused multiply and add ‘X * Y + Z’.
@infsup/gamma
Compute the gamma function.
@infsup/gammaln
Compute the logarithm of the gamma function for positive arguments.
@infsup/hypot
Compute the euclidean norm.
@infsup/ldivide
Divide all numbers of interval Y by all numbers of X.
@infsup/linspace
Return a row vector of N linearly spaced members between BASE and LIMIT.
@infsup/log
Compute the natural logarithm.
@infsup/log10
Compute the decimal (base-10) logarithm.
@infsup/log1p
Compute ‘log (1 + X)’ accurately in the neighborhood of zero.
@infsup/log2
Compute the binary (base-2) logarithm.
@infsup/max
Compute the maximum value chosen from intervals.
@infsup/min
Compute the minimum value chosen from intervals.
@infsup/minus
Subtract all numbers of interval Y from all numbers of X.
@infsup/mod
Compute the modulus of X and Y.
@infsup/nthroot
Compute the real n-th root of X.
@infsup/plus
Add all numbers of interval X to all numbers of Y.
@infsup/pow
Compute the simple power function on intervals defined by ‘exp (Y * log (X))’.
@infsup/pow10
Compute ‘10^x’ for all numbers in X.
@infsup/pow2
Compute ‘2^x’ for all numbers in X.
@infsup/power
Compute the general power function on intervals, which is defined for (1) any positive base X; (2) ‘X = 0’ when Y is positive; (3) negative base X together with integral exponent Y.
@infsup/pown
Compute the monomial ‘x^P’ for all numbers in X.
@infsup/psi
Compute the digamma function, also known as the psi function.
@infsup/rdivide
Divide all numbers of interval X by all numbers of Y.
@infsup/realsqrt
Compute the square root (for all non-negative numbers).
@infsup/rem
Compute the remainder of the division X by Y.
@infsup/round
Round each number in interval X to the nearest integer.
@infsup/roundb
Round each number in interval X to the nearest integer.
@infsup/rsqrt
Compute the reciprocal square root (for all positive numbers).
@infsup/sec
Compute the secant in radians, that is the reciprocal cosine.
@infsup/sech
Compute the hyperbolic secant, that is the reciprocal hyperbolic cosine.
@infsup/sign
Compute the signum function for each number in interval X.
@infsup/sin
Compute the sine in radians.
@infsup/sinh
Compute the hyperbolic sine.
@infsup/sqrt
Compute the square root (for all non-negative numbers).
@infsup/tan
Compute the tangent in radians.
@infsup/tanh
Compute the hyperbolic tangent.
@infsup/times
Multiply all numbers of interval X by all numbers of Y.
@infsup/uminus
Negate all numbers in the interval.
@infsup/uplus
Return the interval itself.

Interval matrix operation

@infsup/chol
Compute the Cholesky factor, R, of each symmetric positive definite matrix in A.
@infsup/det
Compute the determinant of matrix A.
@infsup/dot
Compute the dot product of two interval vectors.
@infsup/expm
Compute the matrix exponential of square matrix A.
@infsup/inv
Compute the inverse of the square matrix A.
@infsup/lu
Compute the LU decomposition of A.
@infsup/mldivide
Return the interval matrix left division of X and Y.
@infsup/mpower
Return the matrix power operation of X raised to the Y power.
@infsup/mrdivide
Return the interval matrix right division of X and Y.
@infsup/mtimes
Compute the interval matrix multiplication.
@infsup/norm
Compute the p-norm (or p,q-norm) of the matrix A.
@infsup/prod
Product of elements along dimension DIM.
@infsup/qr
Compute the QR decomposition of A.
@infsup/sum
Sum of elements along dimension DIM.
@infsup/sumabs
Sum of absolute values along dimension DIM.
@infsup/sumsq
Sum of squares along dimension DIM.

Interval comparison

@infsup/disjoint
Evaluate disjoint comparison on intervals.
@infsup/eq
Compare intervals A and B for equality.
@infsup/ge
Compare intervals A and B for weakly greater.
@infsup/gt
Compare intervals A and B for strict greater.
@infsup/interior
Evaluate interior comparison on intervals.
@infsup/iscommoninterval
Check if the interval is a common interval, that is a nonemty, closed bounded real interval.
@infsup/isempty
Check if the interval represents the empty set.
@infsup/isentire
Check if the interval represents the entire set of real numbers.
@infsup/ismember
Check if the interval X contains the number M.
@infsup/issingleton
Check if the interval represents a set that contains a single real only.
@infsup/le
Compare intervals A and B for weakly less.
@infsup/lt
Compare intervals A and B for strictly less.
@infsup/ne
Compare intervals A and B for inequality.
@infsup/overlap
Extensively compare the positions of intervals A and B on the real number line.
@infsup/precedes
Evaluate precedes comparison on intervals.
@infsup/strictprecedes
Evaluate strict precedes comparison on intervals.
@infsup/strictsubset
Evaluate strict subset comparison on intervals.
@infsup/subset
Evaluate subset comparison on intervals.
@infsupdec/isnai
Check if the interval is the result of a failed interval construction.

Set operation

@infsup/bisect
Bisect an interval into two intervals, which contain half the amount of binary64 numbers each.
@infsup/intersect
Intersect intervals.
@infsup/mince
Mince interval X into a row vector of N sub-intervals of equal size.
@infsup/nextout
Increases the interval’s boundaries in each direction to the next number.
@infsup/setdiff
Build the relative complement of interval B in interval A.
@infsup/setxor
Build the symmetric difference of intervals A and B.
@infsup/union
Build the interval hull of the union of intervals.

Interval reverse operation

@infsup/absrev
Compute the reverse absolute value function.
@infsup/atan2rev1
Compute the reverse atan2 function for the first parameter.
@infsup/atan2rev2
Compute the reverse atan2 function for the second parameter.
@infsup/coshrev
Compute the reverse hyperbolic cosine function.
@infsup/cosrev
Compute the reverse cosine function.
@infsup/mulrev
Compute the reverse multiplication function or the two-output division.
@infsup/pownrev
Compute the reverse monomial ‘x^P’.
@infsup/powrev1
Compute the reverse power function for the first parameter.
@infsup/powrev2
Compute the reverse power function for the second parameter.
@infsup/sinrev
Compute the reverse sine function.
@infsup/sqrrev
Compute the reverse square function.
@infsup/tanrev
Compute the reverse tangent function.

Interval numeric function

@infsup/hdist
Compute the Hausdorff distance between two intervals as sets.
@infsup/idist
Compute the inner distance between two intervals as sets.
@infsup/inf
Get the (greatest) lower boundary for all numbers of interval X.
@infsup/mag
Get the magnitude of numbers in interval X, that is the maximum of absolute values for each element.
@infsup/mid
Get the midpoint of interval X.
@infsup/mig
Get the mignitude of numbers in interval X, that is the minimum of absolute values for each element.
@infsup/rad
Get the radius (and midpoint) of interval X.
@infsup/sdist
Compute the signed distance between two intervals as sets.
@infsup/smig
Get the signed mignitude of numbers in interval X, that is the unique number closest to zero for each element.
@infsup/sup
Get the (least) upper boundary for all numbers of interval X.
@infsup/wid
Get the width of interval X.

Interval input and output

interval_bitpack
Decode an interval from its interchange format.
intervaltotext
Convert interval X to an interval literal string S, which contains X.
exacttointerval
Create a bare interval.
@infsup/bitunpack
Encode bare interval X in interchange format.
@infsup/disp
Display the value of interval X.
@infsup/display
Display the variable name and value of interval X.
@infsup/fprintf
Write interval X under the control of a template string TEMPLATE to the file descriptor ‘fid’ and return the number of characters printed.
@infsup/intervaltoexact
Build an exact representation of the interval X in hexadecimal-significand form.
@infsup/plot
Create a 2D-plot of intervals.
@infsup/plot3
Create a 3D-plot of intervals.
@infsup/printf
Print interval X under the control of a template string TEMPLATE to the stream ‘stdout’ and return the number of characters printed.
@infsup/sprintf
Convert interval X under the control of a template string TEMPLATE to a string with interval literals.

Interval solver or optimizer

@infsup/fminsearch
Minimize the function F over the interval box X0 and return rigorous bounds.
@infsup/fsolve
Compute the preimage of the set Y under function F.
@infsup/fzero
Compute the enclosure of all roots of function F in interval X0.
@infsup/gauss
Solve a linear interval system A * X = B using Gaussian elimination.
@infsup/polyval
Evaluate polynomial P with argument X.

Interval contractor arithmetic

ctc_intersect
Return a contractor function for the intersection of two sets.
ctc_union
Return a contractor function for the union of two sets.

Verified solver or optimizer

vereigback
Verified backward error analysis of eigenpairs.
vereigvec
Verified real eigenvector of an interval matrix.
verintlinineqs
Verified strong solution of interval linear inequalities.
verinvnonneg
Verified nonnegative invertibility of an interval matrix.
verlinineqnn
Verified nonnegative solution of a system of linear inequalities.
verlinprog
Verified linear programming.

Utility function

@infsup/cat
Return the concatenation of N-D interval arrays ARRAY1, ARRAY2, … along dimension DIM.
@infsup/columns
Return the number of columns of A.
@infsup/ctranspose
Return the complex conjugate transpose of X.
@infsup/diag
Create a diagonal matrix M with vector V on diagonal K or extract a vector V from the K-th diagonal of matrix M.
@infsup/end
The magic index ‘end’ refers to the last valid entry in an indexing operation.
@infsup/horzcat
Return the horizontal concatenation of interval array objects along dimension 2.
@infsup/iscolumn
Return true if A is an interval column vector.
@infsup/isrow
Return true if A is an interval row vector.
@infsup/isscalar
Return true if A is an interval scalar.
@infsup/issquare
Return true if A is a square interval matrix.
@infsup/isvector
Return true if A is an interval vector.
@infsup/length
Return the length of interval object A.
@infsup/ndims
Return the number of dimensions of A.
@infsup/numel
Return the number of elements in the interval object A.
@infsup/postpad
Append the scalar interval value C to the interval vector X until it is of length L.
@infsup/prepad
Prepend the scalar interval value C to the interval vector X until it is of length L.
@infsup/reshape
Return an interval matrix with the specified dimensions (M, N, ...) whose elements are taken from the interval matrix A.
@infsup/resize
Resize interval array X cutting off elements as necessary.
@infsup/rows
Return the number of rows of A.
@infsup/size
Return a row vector with the size (number of elements) of each dimension for the interval array A.
@infsup/subsasgn
Perform the subscripted assignment operation according to the subscript specified by IDX.
@infsup/subsref
Select property P or elements I from interval array A.
@infsup/transpose
Return the transpose of interval matrix or vector X.
@infsup/tril
Return a new matrix formed by extracting the lower triangular part of the matrix A, and setting all other elements to zero.
@infsup/triu
Return a new matrix formed by extracting the upper triangular part of the matrix A, and setting all other elements to zero.
@infsup/vertcat
Return the vertical concatenation of interval array objects along dimension 1.
@infsupdec/decorationpart
Return the decoration of the decorated interval X.
@infsupdec/intervalpart
Return the bare interval for the decorated interval X.

API function to low-level libraries

crlibm_function
Evaluate a function in binary64 with correctly rounded result.
mpfr_function_d
Evaluate a function in binary64 with correctly rounded result.
mpfr_linspace_d
Return a row vector with N linearly spaced elements between BASE and LIMIT.
mpfr_matrix_mul_d
Compute the matrix product with binary64 numbers and correctly rounded result.
mpfr_matrix_sqr_d
Compute the lower and upper boundary of the matrix square of interval matrix [XL, XU].
mpfr_to_string_d
Convert binary64 numbers X to string representation, either exact or correctly rounded.
mpfr_vector_sum_d
Compute the sum S of all numbers in a binary64 array X along dimension DIM with correctly rounded result.
mpfr_vector_dot_d
Compute the dot product of arrays of binary 64 numbers along dimensionDIM with correctly rounded result.

Internal utility function (use at one's own risk)

__setround__
Changes the floating-point rounding direction for the current thread and any new threads which will be spawned from the current thread.
__check_crlibm__
Check whether crlibm is available and working.
__split_interval_literals__
Split string S into a cell array of interval literals.

Package: interval