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)

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
  • acos(RRi) -- see acos -- arccosine
  • asin(RRi) -- see asin -- arcsine
  • atan(RRi) -- see atan -- compute the arctangent of a number
  • atan2(RR,RRi) -- see atan2 -- compute an angle of a certain triangle
  • atan2(RRi,RR) -- see atan2 -- compute an angle of a certain triangle
  • atan2(RRi,RRi) -- see atan2 -- compute an angle of a certain triangle
  • Beta(RR,RRi) -- see Beta -- Beta function
  • Beta(RRi,RR) -- see Beta -- Beta function
  • Beta(RRi,RRi) -- see Beta -- Beta function
  • cos(RRi) -- see cos -- compute the cosine
  • cosh(RRi) -- see cosh -- compute the hyperbolic cosine
  • cot(RRi) -- see cot -- cotangent
  • coth(RRi) -- see coth -- hyperbolic cotangent
  • csc(RRi) -- see csc -- cosecant
  • csch(RRi) -- see csch -- hyperbolic cosecant
  • Digamma(RRi) -- see Digamma -- Digamma function
  • eint(RRi) -- see eint -- exponential integral
  • erf(RRi) -- see erf -- error function
  • erfc(RRi) -- see erfc -- complementary error function
  • exp(RRi) -- see exp -- exponential function
  • expm1(RRi) -- see expm1 -- exponential minus 1
  • Gamma(RR,RRi) -- see Gamma -- Gamma function
  • Gamma(RRi) -- see Gamma -- Gamma function
  • Gamma(RRi,RR) -- see Gamma -- Gamma function
  • Gamma(RRi,RRi) -- see Gamma -- Gamma function
  • intersect(RRi) -- intersection of input intervals
  • intersect(RRi,RRi) -- see intersect(RRi) -- intersection of input intervals
  • inverseErf(RRi) -- see inverseErf -- inverse error function
  • log(RR,RRi) -- see log -- logarithm function
  • log(RRi) -- see log -- logarithm function
  • log(RRi,RR) -- see log -- logarithm function
  • log(RRi,RRi) -- see log -- logarithm function
  • log1p(RRi) -- see log1p -- logarithm of 1+x
  • regularizedBeta(RR,RR,RRi) -- see regularizedBeta -- regularized beta function
  • regularizedBeta(RR,RRi,RR) -- see regularizedBeta -- regularized beta function
  • regularizedBeta(RR,RRi,RRi) -- see regularizedBeta -- regularized beta function
  • regularizedBeta(RRi,RR,RR) -- see regularizedBeta -- regularized beta function
  • regularizedBeta(RRi,RR,RRi) -- see regularizedBeta -- regularized beta function
  • regularizedBeta(RRi,RRi,RR) -- see regularizedBeta -- regularized beta function
  • regularizedBeta(RRi,RRi,RRi) -- see regularizedBeta -- regularized beta function
  • regularizedGamma(RR,RRi) -- see regularizedGamma -- upper regularized gamma function
  • regularizedGamma(RRi,RR) -- see regularizedGamma -- upper regularized gamma function
  • regularizedGamma(RRi,RRi) -- see regularizedGamma -- upper regularized gamma function
  • sec(RRi) -- see sec -- secant
  • sech(RRi) -- see sech -- hyperbolic secant
  • sin(RRi) -- see sin -- compute the sine
  • sinh(RRi) -- see sinh -- compute the hyperbolic sine
  • sqrt(RRi) -- see sqrt -- square root function
  • tan(RRi) -- see tan -- compute the tangent
  • tanh(RRi) -- see tanh -- compute the hyperbolic tangent
  • zeta(RRi) -- see zeta -- Riemann zeta function

Methods that use a real interval:

  • abs(RRi) -- see abs -- absolute value function
  • diameter(RRi) -- see diameter -- diameter of an interval
  • isEmpty(RRi) -- empty test for an interval
  • isMember(QQ,RRi) -- membership test in an interval
  • isMember(RR,RRi) -- see isMember(QQ,RRi) -- membership test in an interval
  • isMember(ZZ,RRi) -- see isMember(QQ,RRi) -- membership test in an interval
  • isReal(RRi) -- see isReal -- whether a number is real
  • isSubset(RRi,RRi) -- subset test for intervals
  • 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 ZZ) -- see lift -- lift to another ring
  • lngamma(RRi) -- see lngamma -- logarithm of the Gamma function
  • numeric(RRi) -- see numeric -- convert to floating point
  • numeric(ZZ,RRi) -- see numeric -- convert to floating point
  • 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

For the programmer

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


The source of this document is in Macaulay2Doc/ov_rings.m2:486:0.