Macaulay2 » Documentation
Packages » Macaulay2Doc » rings » basic rings of numbers » RRi
next | previous | forward | backward | up | index | toc

RRi -- the class of all real intervals

Description

A real interval is entered as a pair of real numbers to the interval function. It is stored internally as an arbitrary precision interval using the MPFI library.
i1 : interval(3.1415,3.1416)

o1 = [3.1415,3.1416]

o1 : RRi (of precision 53)
The precision is measured in bits, is visible in the ring displayed on the second of each pair of output lines, and can be recovered using precision.
i2 : precision interval(3.1415,3.1416)

o2 = 53
For real intervals, the functions class and ring yield different results. That allows numbers of various precisions to be used without creating a new ring for each precision.
i3 : class interval(3.1,3.5)

o3 = RRi

o3 : InexactFieldFamily
i4 : ring interval(3.1,3.5)

o4 = RRi
        53

o4 : RealIntervalField
The precision can be specified on input by specifying the precision of both input RR numbers. Alternatively, the precision can be specified by including the option Precision.
i5 : interval(2.5p100,3.2p1000)

o5 = [2.5,3.200000000000000000000000000001]

o5 : RRi (of precision 100)
i6 : interval(2.5,3.2,Precision=>200)

o6 = [2.5,3.20000000000000017763568394002504646778106689453125]

o6 : RRi (of precision 200)
Intervals can also be created using span(Sequence) to create the smallest interval containing the inputs.
i7 : span(2,Precision=>100)

o7 = [2,2]

o7 : RRi (of precision 100)
i8 : span(2,3,interval(-1.5,-0.5),73)

o8 = [-1.5,73]

o8 : RRi (of precision 53)
Operations using intervals are computed as sets so that the resulting intervals contain all possible outputs from pairs of points in input intervals.
i9 : interval(1,3)+interval(2,4)

o9 = [3,7]

o9 : RRi (of precision 53)
i10 : interval(-1,1)*interval(2,3)

o10 = [-3,3]

o10 : RRi (of precision 53)
i11 : interval(0,1)-interval(0,1)

o11 = [-1,1]

o11 : RRi (of precision 53)
i12 : interval(1,2)/interval(1,2)

o12 = [.5,2]

o12 : RRi (of precision 53)
The notion of equality tested by == amounts to checking the equality of the endpoints of intervals.The notion of equality tested by === takes into account the precision of the inputs as well.
i13 : interval(1,3) == interval(1,3,Precision=>100)

o13 = true
i14 : interval(1,3) === interval(1,3,Precision=>100)

o14 = false
i15 : interval(1/3,1,Precision=>100)==interval(1/3,1,Precision=>1000)

o15 = false
The notion of inequalities for intervals amounts to testing the inequality for all points in the intervals. In particular, <= is not the same as < or ==.
i16 : interval(1,2)<=interval(2,3)

o16 = true
i17 : interval(1,2)<=interval(1,2)

o17 = false
i18 : interval(1,2)<interval(2,3)

o18 = false
i19 : interval(1,2)<interval(3,4)

o19 = true
Transcendental functions on intervals produce intervals containing the image of the function on the interval.
i20 : exp(interval(2,4))

o20 = [7.38905609893065,54.59815003314424]

o20 : RRi (of precision 53)
i21 : cos(interval(1,1.3))

o21 = [.2674988286245873,.5403023058681398]

o21 : RRi (of precision 53)
i22 : sqrt(interval(2))

o22 = [1.414213562373095,1.414213562373095]

o22 : RRi (of precision 53)
Transcendental functions are available to high precision, with numericInterval.
i23 : numericInterval(100,pi)

o23 = [3.141592653589793238462643383279,3.141592653589793238462643383282]

o23 : RRi (of precision 100)
i24 : numericInterval_200 EulerConstant

o24 = [.5772156649015328606065120900824024310421593359399235988057672
      ,.5772156649015328606065120900824024310421593359399235988057678]

o24 : RRi (of precision 200)
The left and right endpoints of an interval can be accessed with left and right. Similarly, the midpoint and the length of an interval can be found with midpoint and diameter.
i25 : left interval(1,5)

o25 = 1

o25 : RR (of precision 53)
i26 : right interval(1,5)

o26 = 5

o26 : RR (of precision 53)
i27 : midpoint interval(1,5)

o27 = 3

o27 : RR (of precision 53)
i28 : diameter interval(1,5)

o28 = 4

o28 : RR (of precision 53)

See also

Menu

Functions and methods returning a real interval:

  • QQ * RRi -- see * -- a binary operator, usually used for multiplication
  • RR * RRi -- see * -- a binary operator, usually used for multiplication
  • RRi * QQ -- see * -- a binary operator, usually used for multiplication
  • RRi * RR -- see * -- a binary operator, usually used for multiplication
  • RRi * RRi -- see * -- a binary operator, usually used for multiplication
  • RRi * ZZ -- see * -- a binary operator, usually used for multiplication
  • ZZ * RRi -- see * -- a binary operator, usually used for multiplication
  • + RRi -- see + -- a unary or binary operator, usually used for addition
  • QQ + RRi -- see + -- a unary or binary operator, usually used for addition
  • RR + RRi -- see + -- a unary or binary operator, usually used for addition
  • RRi + QQ -- see + -- a unary or binary operator, usually used for addition
  • RRi + RR -- see + -- a unary or binary operator, usually used for addition
  • RRi + RRi -- see + -- a unary or binary operator, usually used for addition
  • RRi + ZZ -- see + -- a unary or binary operator, usually used for addition
  • ZZ + RRi -- see + -- a unary or binary operator, usually used for addition
  • - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • QQ - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RR - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RRi - QQ -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RRi - RR -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RRi - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RRi - ZZ -- see - -- a unary or binary operator, usually used for negation or subtraction
  • ZZ - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • QQ / RRi -- see / -- a binary operator, usually used for division
  • RR / RRi -- see / -- a binary operator, usually used for division
  • RRi / QQ -- see / -- a binary operator, usually used for division
  • RRi / RR -- see / -- a binary operator, usually used for division
  • RRi / RRi -- see / -- a binary operator, usually used for division
  • RRi / ZZ -- see / -- a binary operator, usually used for division
  • ZZ / RRi -- see / -- a binary operator, usually used for division
  • intersect(RRi) -- intersection of input intervals
  • intersect(RRi,RRi) -- see intersect(RRi) -- intersection of input intervals

Methods that use a real interval:

  • CC * RRi -- see * -- a binary operator, usually used for multiplication
  • CCi * RRi -- see * -- a binary operator, usually used for multiplication
  • RRi * CC -- see * -- a binary operator, usually used for multiplication
  • RRi * CCi -- see * -- a binary operator, usually used for multiplication
  • CC + RRi -- see + -- a unary or binary operator, usually used for addition
  • CCi + RRi -- see + -- a unary or binary operator, usually used for addition
  • RRi + CC -- see + -- a unary or binary operator, usually used for addition
  • RRi + CCi -- see + -- a unary or binary operator, usually used for addition
  • CC - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • CCi - RRi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RRi - CC -- see - -- a unary or binary operator, usually used for negation or subtraction
  • RRi - CCi -- see - -- a unary or binary operator, usually used for negation or subtraction
  • CC / RRi -- see / -- a binary operator, usually used for division
  • CCi / RRi -- see / -- a binary operator, usually used for division
  • RRi / CC -- see / -- a binary operator, usually used for division
  • RRi / CCi -- see / -- a binary operator, usually used for division
  • diameter(RRi) -- see diameter -- diameter of an interval
  • intersect(CCi,RRi) -- see intersect(RRi) -- intersection of input intervals
  • intersect(RRi,CCi) -- see intersect(RRi) -- intersection of input intervals
  • interval(CC,RRi) -- see interval -- construct an interval
  • interval(RR,RRi) -- see interval -- construct an interval
  • interval(RRi) -- see interval -- construct an interval
  • interval(RRi,CC) -- see interval -- construct an interval
  • interval(RRi,RR) -- see interval -- construct an interval
  • interval(RRi,RRi) -- see interval -- construct an interval
  • isEmpty(RRi) -- empty test for an interval
  • isMember(CC,RRi) -- see isMember(QQ,CCi) -- membership test in an interval
  • isMember(QQ,RRi) -- see isMember(QQ,CCi) -- membership test in an interval
  • isMember(RR,RRi) -- see isMember(QQ,CCi) -- membership test in an interval
  • isMember(ZZ,RRi) -- see isMember(QQ,CCi) -- membership test in an interval
  • isReal(RRi) -- see isReal -- whether a number is real
  • isSubset(CCi,RRi) -- see isSubset(CCi,CCi) -- subset test for intervals
  • isSubset(RRi,CCi) -- see isSubset(CCi,CCi) -- subset test for intervals
  • isSubset(RRi,RRi) -- see isSubset(CCi,CCi) -- subset test for intervals
  • left(RRi) -- see left -- left endpoint of an interval
  • RRi << ZZ -- see left shift
  • lift(RRi,type of QQ) -- see lift -- lift to another ring
  • lift(RRi,type of RR_*) -- see lift -- lift to another ring
  • lift(RRi,type of RRi_*) -- see lift -- lift to another ring
  • lift(RRi,type of ZZ) -- see lift -- lift to another ring
  • lngamma(RRi) -- see lngamma -- logarithm of the Gamma function
  • lowerLeft(RRi) (missing documentation)
  • lowerRight(RRi) (missing documentation)
  • midpoint(RRi) -- see midpoint -- midpoint of an interval
  • numeric(RRi) -- see numeric -- convert to floating point
  • numeric(ZZ,RRi) -- see numeric -- convert to floating point
  • right(RRi) -- see right -- right endpoint of an interval
  • RRi >> ZZ -- see right shift
  • ring(RRi) -- see ring -- get the associated ring of an object
  • round(ZZ,RRi) -- see round -- round a number
  • size2(RRi) -- see size2 -- number of binary digits to the left of the point
  • span(CCi,RRi) -- see span -- construct smallest interval
  • span(RRi,CCi) -- see span -- construct smallest interval
  • span(RRi,RRi) -- see span -- construct smallest interval
  • upperLeft(RRi) (missing documentation)
  • upperRight(RRi) (missing documentation)

For the programmer

The object RRi is an inexact field family, with ancestor classes InexactNumber < Number < Thing.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_rings.m2:488:0.