 Overview - Maple Help

RealBox

Box objects on the real line Calling Sequence RealBox( c, r ) RealBox( b ) Center( b ) Radius( b ) Parameters

 c - numeric; the center of the box r - (optional) nonnegative number; the radius of the box b - RealBox object precopt - (optional) equation of the form precision = n, where n is a positive integer Description

 • A RealBox object is defined by two numeric quantities, a center $c$ and a non-negative radius $r$.
 • You can access the center of a RealBox b by using the Center( b ) method, and the radius is available by using the Radius( b ) method.
 • The method Centre is provided as an alias.
 • If the radius is finite, then a RealBox represents a closed and bounded interval of the real line, namely $\left[c-r,c+r\right]$. In particular, a RealBox with radius equal to $0$ represents the single point $c$.
 • If the radius is infinite, the corresponding RealBox represents the entire real line.
 • RealBox objects can be combined using arithmetic operations, and have methods that allow you to apply many mathematical functions to them. These operations are effected using a version of interval arithmetic, adapted to boxes.
 • Arithmetic and mathematical functions applied to a real box also produce a real box as output. The result of an operation is guaranteed to contain the true value of the result of applying the function or arithmetic operation to any value of the input box or boxes. Thus, if $f$ is an implemented function, then $f\left(\left[c-r,c+r\right]\right)$ is a box of the form $\left[x-s,x+s\right]$, where $x$ and $s$ are such that, for any value $t$ in the box $\left[c-r,c+r\right]$, the value $f\left(t\right)$ lies in the box $\left[x-s,x+s\right]$. Precision

 • Operations such as arithmetic and the implemented elementary and special functions are controlled by a quantity called the precision. This is a positive integer value that you can set by assigning a value to the environment variable _EnvBoxPrecision.
 • Many methods for RealBox objects also accept an option of the form precision = n, for a positive integer n, which allows you to exert local control over precision.
 • For more details, see BoxPrecision. Creating Real Boxes

 • The simplest way to create a RealBox object is to pass the RealBox constructor a real constant.
 • To create a real box with a numeric value c as its center, and with radius equal to $0$, just pass the value c to the RealBox object.
 > b := RealBox( 0.5 );
 ${b}{≔}{⟨}{\text{RealBox:}}{0.5}{±}{0}{⟩}$ (1)
 > Center( b );
 ${0.500000000000000}$ (2)
 ${0.}$ (3)
 • This uses the default value of $0$ as the radius, which means that the box object represents the value of its center exactly.
 • To specify a nonzero radius, the radius argument r can be passed as a second, optional argument.
 > b := RealBox( 0.5, 1e-5 );
 ${b}{≔}{⟨}{\text{RealBox:}}{0.5}{±}{1e-05}{⟩}$ (4)
 > Center( b );
 ${0.500000000000000}$ (5)
 ${0.0000100000000031741}$ (6)
 • However, the actual radius of a RealBox object depends upon not only the value passed, but also the precision used for construction, as not all values can be exactly represented in floating point.
 • The rational number $\frac{3}{2}$ can be represented exactly as a float.
 > b1 := RealBox( 3/2 );
 ${\mathrm{b1}}{≔}{⟨}{\text{RealBox:}}{1.5}{±}{0}{⟩}$ (7)
 • Thus, the radius of the resulting box is, in fact, the default value of $0$.
 ${0.}$ (8)
 • On the other hand, the number $\frac{2}{3}$ is not exactly representable, so the radius of a RealBox representation is nonzero.
 > b2 := RealBox( 2/3 );
 ${\mathrm{b2}}{≔}{⟨}{\text{RealBox:}}{0.666667}{±}{5.82077ⅇ-11}{⟩}$ (9)
 • The resulting radius is sufficient to ensure that the exact value $\frac{2}{3}$ is contained within the resulting box.
 ${5.82076609134674}{×}{{10}}^{{-11}}$ (10)
 > evalb( Center( b2 ) - Radius( b2 ) <= 2/3 );
 ${\mathrm{true}}$ (11)
 > evalb( 2/3 <= Center( b2 ) + Radius( b2 )  );
 ${\mathrm{true}}$ (12)
 • Increasing the precision results in a box with smaller radius.
 > RealBox( 2/3, precision = 100 );
 ${⟨}{\text{RealBox:}}{0.666667}{±}{7.88861ⅇ-31}{⟩}$ (13) Special Constants

 • There are several special values and constants implemented that can be passed as an argument to the RealBox object constructor. For some of these, such as infinities, it is not meaningful to specify a nonzero radius. For special constants, the implemented algorithms by default return a RealBox object with a radius determined by the precision.
 > RealBox( Pi );
 ${⟨}{\text{RealBox:}}{3.14159}{±}{1.16415ⅇ-10}{⟩}$ (14)
 > RealBox( Pi, 0.001 );
 ${⟨}{\text{RealBox:}}{3.14159}{±}{0.001}{⟩}$ (15)
 > RealBox( Pi, 'precision' = 1000 );
 ${⟨}{\text{RealBox:}}{3.14159}{±}{1.86653ⅇ-301}{⟩}$ (16)
 > RealBox( sqrt( Pi ) );
 ${⟨}{\text{RealBox:}}{1.77245}{±}{1.16415ⅇ-10}{⟩}$ (17)
 > RealBox( ln( sqrt( 2*Pi ) ) );
 ${⟨}{\text{RealBox:}}{0.918939}{±}{3.40258ⅇ-10}{⟩}$ (18)
 > RealBox( log( 2 ), 'precision' = 100 );
 ${⟨}{\text{RealBox:}}{0.693147}{±}{3.94430ⅇ-31}{⟩}$ (19)
 > RealBox( log( 10 ) );
 ${⟨}{\text{RealBox:}}{2.30259}{±}{2.32831ⅇ-10}{⟩}$ (20)
 > RealBox( exp( 1 ) );
 ${⟨}{\text{RealBox:}}{2.71828}{±}{2.32831ⅇ-10}{⟩}$ (21)
 > RealBox( Catalan );
 ${⟨}{\text{RealBox:}}{0.915966}{±}{5.82077ⅇ-11}{⟩}$ (22)
 > RealBox( gamma );
 ${⟨}{\text{RealBox:}}{0.577216}{±}{5.82077ⅇ-11}{⟩}$ (23)
 > RealBox( Zeta( 3 ) );
 ${⟨}{\text{RealBox:}}{1.20206}{±}{1.16415ⅇ-10}{⟩}$ (24)
 > RealBox( infinity );
 ${⟨}{\text{RealBox:}}{Inf}{±}{0}{⟩}$ (25)
 > RealBox( -infinity );
 ${⟨}{\text{RealBox:}}{-Inf}{±}{0}{⟩}$ (26)
 > RealBox( undefined );
 ${⟨}{\text{RealBox:}}{nan}{±}{0}{⟩}$ (27)
 • Note the following raises an exception.
 > RealBox( infinity, 0.0001 ); Predicates

 • A number of predicates are implemented for RealBox objects. Typically, a predicate returns true if the result is certainly true for all real numbers in the box. If a predicate returns the value false, then the result may or may not be true for all values lying within the box. Thus, to determine whether a predicate is certainly false, you must also test whether the negated predicate is true. Predicates

 compare two RealBox objects for inequality compare two RealBox objects for strict inequality test whether a RealBox object is contained in another test whether two RealBox objects are mathematically equal test whether two RealBox objects are equal as objects test whether a RealBox contains an integer test whether a RealBox contains a negative value test whether a RealBox contains a non-negative value test whether a RealBox contains a non-positive value test whether a RealBox contains a positive value test whether a RealBox contains zero test whether a RealBox is exact test whether a RealBox is finite test whether a RealBox represents infinity test whether a RealBox is an integer test whether a RealBox is negative test whether a RealBox represents negative infinity test whether a RealBox is non-negative test whether a RealBox is non-positive test whether a RealBox is nonzero test whether a RealBox is one test whether a RealBox is positive test whether a RealBox represents an undefined value test whether a RealBox is zero compare two RealBox objects for inequality compare two RealBox objects for strict inequality test whether two RealBox objects are not equal test whether two RealBox objects have a nonempty nntersection Elementary Functions

 • Many of the elementary functions are implemented as RealBox methods. A list of the available functions appears below. Elementary

 calculate the absolute value of a RealBox object calculate the ceiling of a RealBox object calculate the exponential of a RealBox object calculate the exponential and reciprocal exponential of a RealBox object calculate the exponential minus one of a RealBox object calculate the floor of a RealBox object calculate the hypotenuse of a pair of real boxes calculate the logarithm of a RealBox object calculate the logarithm of one plus a RealBox object calculate the reciprocal square root of a RealBox object calculate the sign of a RealBox object calculate the square root of a RealBox object calculate the positive square root of a RealBox object Circular and Hyperbolic Functions

 • The following circular and hyperbolic functions are available as methods for RealBox objects. Circular

 compute arccos of a RealBox compute arccot of a RealBox compute arccsc of a RealBox compute arcsec of a RealBox compute arcsin of a RealBox compute arctan of a RealBox compute cos of a RealBox compute cospi of a RealBox compute cot of a RealBox compute cotpi of a RealBox compute csc of a RealBox compute sec of a RealBox compute sin of a RealBox compute sinc of a RealBox compute sincpi of a RealBox compute sinpi of a RealBox compute tan of a RealBox compute tanpi of a RealBox Hyperbolic

 compute the inverse hyperbolic cosine of a RealBox object compute the inverse hyperbolic cotangent of a RealBox object compute the inverse hyperbolic cosecant of a RealBox object compute the inverse hyperbolic secant of a RealBox object compute the inverse hyperbolic sine of a RealBox object compute the inverse hyperbolic tangent of a RealBox object compute the hyperbolic cosine of a RealBox object compute the hyperbolic cotangent of a RealBox object compute the hyperbolic cosecant of a RealBox object compute the hyperbolic secant of a RealBox object compute the hyperbolic sine of a RealBox object compute the hyperbolic sine and hyperbolic cosine of a RealBox object compute the hyperbolic tangent of a RealBox object Special Functions

 • Many special and hypergeometric functions have been provided as RealBox object methods, as listed below. Special

 compute the Airy Ai wave function of a RalBox compute the Airy Bi wave function of a RealBox compute the Bessel I function of a RealBox compute the Bessel J function of a RealBox compute the Bessel K function of a RealBox compute the Bessel Y function of a RealBox Chebyshev T function of a RealBox Chebyshev U function of a RealBox compute the hyperbolic cosine integral of a RealBox compute the cosine integral of a RealBox Coulomb's F function of a RealBox Coulomb's G function of a RealBox compute the dilogarithm function of a RealBox compute the exponential intergral of a RealBox compute the error function of a RealBox compute the complementary error function of a RealBox compute the imaginary error function of a RealBox compute the GAMMA function of a RealBox Gegenbauer C function of a RealBox Hermite H function of a RealBox general hypergeometric function of a RelaBox Jacobi U function of a RealBox Kummer M function of a RealBox Kummer U function of a RealBox Laguerre L function of a RealBox compute the Lambert W function of a RealBox Legendre P function of a RealBox compute the log-GAMMA function of a RealBox compute the Digamma function of a RealBox compute the reciprocal GAMMA function of a RealBox compute the hyperbolic sine integral of a RealBox compute the sine integral of a RealBox compute the Riemann Zeta function of a RealBox Compatibility

 • The RealBox command was introduced in Maple 2022.