Arithmetic - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

Calling Sequence

-b

1/b

a + b

s + b

a * b

s * b

a ^ b

a ^ s

s ^ b

Parameters

a

-

RealBox object

b

-

RealBox object

s

-

numeric; a real constant

Description

• 

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.

-b

the negation of b

1/b

the reciprocal of b

a + b

the sum of a and b

a * b

the product of a and b

a / b

the quotient of a and b

a ^ b

the b-th power of a

a ^ s

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].

Examples

Negation and reciprocation are unary operators for RealBox objects.

RealBox2.3

RealBox: -2.3±2.32831ⅇ-10

(1)

1RealBox2.3

RealBox: 0.434783±7.31179ⅇ-11

(2)

Note that unlike Maple floats, the reciprocal of 0 yields an undefined RealBox, rather than an infinity.

1RealBox0.

RealBox: nan±0

(3)

RealBox2.3+RealBox4.7

RealBox: -2.4±6.98492ⅇ-10

(4)

RealBox2.3+55.55

RealBox: 57.85±7.68341ⅇ-09

(5)

RealBox2.3RealBox4.7

RealBox: -10.81±3.09665ⅇ-09

(6)

17.41RealBox4.7

RealBox: -81.827±2.43122ⅇ-08

(7)

RealBox2.3RealBox4.7

RealBox: -0.489362±1.60597ⅇ-10

(8)

RealBox2.3RealBox4.7

RealBox: 0.0199471±2.91557ⅇ-11

(9)

RealBox2.33.1415

RealBox: 13.6889±1.36337ⅇ-08

(10)

RealBox2.32

RealBox: 5.29±1.53668ⅇ-09

(11)

RealBox2.310

RealBox: 4142.65±4.40901ⅇ-06

(12)

p7x5+22x455x394x2+87x56

p7x5+22x455x394x2+87x56

(13)

evalp,x=RealBox2.3

RealBox: -857.239±1.30933ⅇ-06

(14)

evalp,x=2.3

−857.23881

(15)

q62x4+97x373x24x83

q62x4+97x373x24x83

(16)

evalpq,x=RealBox2.3

RealBox: 0.829705±2.97047ⅇ-09

(17)

evalpq,x=2.3

0.8297048874

(18)

Let's try a bivariate polynomial.

p40x3y2+42xy47x410x2y75xy17x

p40x3y2+42xy47x410x2y75xy17x

(19)

First evaluate x

qevalp,x=RealBox2.3

qRealBox: -234.989±1.35785ⅇ-07+RealBox: -486.68±2.3488ⅇ-07y2+RealBox: 96.6±1.72295ⅇ-08y4+RealBox: -52.9±1.90921ⅇ-08y+RealBox: -172.5±3.23635ⅇ-08y

(20)

Then evaluate at y

evalq,y=RealBox0.55

RealBox: -497.34±4.13754ⅇ-07

(21)

Now let's check that we get the same result if we first evaluate at y and then evaluate the result at x.

qevalp,y=RealBox0.55

qRealBox: -12.1±4.65661ⅇ-09x3+RealBox: 3.84326±1.99043ⅇ-09x7x4+RealBox: -5.5±1.04774ⅇ-09x2+RealBox: -41.25±8.09086ⅇ-09x17x

(22)

evalq,x=RealBox2.3

RealBox: -497.34±4.05442ⅇ-07

(23)

Compatibility

• 

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]

RealBox