RealBox
Arithmetic
arithmetic for RealBox objects
+
compute a sum involving RealBox objects
*
compute a product involving RealBox objects
^
compute a power involving RealBox objects
-
compute the negative of RealBox object
/
compute the reciprocal of RealBox object
Calling Sequence
Parameters
Description
Examples
Compatibility
-b
1/b
a + b
s + b
a * b
s * b
a ^ b
a ^ s
s ^ b
a
RealBox object
b
s
numeric; a real constant
RealBox objects have been provided with methods implementing the standard arithmetic operators in Maple. This means that you can form arithmetic expressions using real boxes and they will evaluate to RealBox objects representing the result of those operations.
Note that addition (`+`) and multiplication (`*`) are, in fact, n-ary operators that may have one or more operands, while negation (`-`) and reciprocation (`/`) are unary. See object/operators for more details on the semantics of operator methods for objects in Maple.
These are the arithmetic operators available for RealBox objects.
the negation of b
the reciprocal of b
the sum of a and b
the product of a and b
a / b
the quotient of a and b
the b-th power of a
the s-th power of a
In most cases, these are defined when one argument is a (Maple) real numeric value, provided at least one operand is a RealBox object. (Otherwise, Maple's standard arithmetic applies as box objects are not involved.)
For information about using arithmetic operators with ComplexBox operands, see ComplexBox[Arithmetic].
Negation and reciprocation are unary operators for RealBox objects.
−RealBox⁡2.3
⟨RealBox: -2.3±2.32831ⅇ-10⟩
1RealBox⁡2.3
⟨RealBox: 0.434783±7.31179ⅇ-11⟩
Note that unlike Maple floats, the reciprocal of 0 yields an undefined RealBox, rather than an infinity.
1RealBox⁡0.
⟨RealBox: nan±0⟩
RealBox⁡2.3+RealBox⁡−4.7
⟨RealBox: -2.4±6.98492ⅇ-10⟩
RealBox⁡2.3+55.55
⟨RealBox: 57.85±7.68341ⅇ-09⟩
RealBox⁡2.3⁢RealBox⁡−4.7
⟨RealBox: -10.81±3.09665ⅇ-09⟩
17.41⁢RealBox⁡−4.7
⟨RealBox: -81.827±2.43122ⅇ-08⟩
RealBox⁡2.3RealBox⁡−4.7
⟨RealBox: -0.489362±1.60597ⅇ-10⟩
⟨RealBox: 0.0199471±2.91557ⅇ-11⟩
RealBox⁡2.33.1415
⟨RealBox: 13.6889±1.36337ⅇ-08⟩
RealBox⁡2.32
⟨RealBox: 5.29±1.53668ⅇ-09⟩
RealBox⁡2.310
⟨RealBox: 4142.65±4.40901ⅇ-06⟩
p≔−7⁢x5+22⁢x4−55⁢x3−94⁢x2+87⁢x−56
eval⁡p,x=RealBox⁡2.3
⟨RealBox: -857.239±1.30933ⅇ-06⟩
eval⁡p,x=2.3
−857.23881
q≔−62⁢x4+97⁢x3−73⁢x2−4⁢x−83
eval⁡pq,x=RealBox⁡2.3
⟨RealBox: 0.829705±2.97047ⅇ-09⟩
eval⁡pq,x=2.3
0.8297048874
Let's try a bivariate polynomial.
p≔−40⁢x3⁢y2+42⁢x⁢y4−7⁢x4−10⁢x2⁢y−75⁢x⁢y−17⁢x
First evaluate x
q≔eval⁡p,x=RealBox⁡2.3
q≔⟨RealBox: -234.989±1.35785ⅇ-07⟩+⟨RealBox: -486.68±2.3488ⅇ-07⟩⁢y2+⟨RealBox: 96.6±1.72295ⅇ-08⟩⁢y4+⟨RealBox: -52.9±1.90921ⅇ-08⟩⁢y+⟨RealBox: -172.5±3.23635ⅇ-08⟩⁢y
Then evaluate at y
eval⁡q,y=RealBox⁡0.55
⟨RealBox: -497.34±4.13754ⅇ-07⟩
Now let's check that we get the same result if we first evaluate at y and then evaluate the result at x.
q≔eval⁡p,y=RealBox⁡0.55
q≔⟨RealBox: -12.1±4.65661ⅇ-09⟩⁢x3+⟨RealBox: 3.84326±1.99043ⅇ-09⟩⁢x−7⁢x4+⟨RealBox: -5.5±1.04774ⅇ-09⟩⁢x2+⟨RealBox: -41.25±8.09086ⅇ-09⟩⁢x−17⁢x
eval⁡q,x=RealBox⁡2.3
⟨RealBox: -497.34±4.05442ⅇ-07⟩
The RealBox[Arithmetic], RealBox:-+, RealBox:-*, RealBox:-^, RealBox:-- and RealBox:-/ commands were introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
ComplexBox
ComplexBox[Arithmetic]
Download Help Document