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

Online Help

All Products    Maple    MapleSim


RealBox

  

Elementary

  

elementary and other basic functions for RealBox objects

  

abs

  

compute the absolute value of a RealBox

  

signum

  

compute the sign of a RealBox

  

log

  

compute the logarithm of a RealBox

  

log1p

  

compute the logarithm of one plus a RealBox

  

exp

  

compute the exponential of a RealBox

  

expm1

  

compute the exponential of a RealBox and subtract one

  

expinvexp

  

compute the exponential and its reciprocal of a RealBox

  

sqrt

  

compute the square root of a RealBox

  

rsqrt

  

compute the reciprocal square root of a RealBox

  

sqrtpos

  

compute the positive square root of a RealBox

  

floor

  

compute the positive floor of a RealBox

  

ceil

  

compute the positive ceiling of a RealBox

  

hypot

  

compute the hypotenuse of a pair of real boxes

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

abs( b )

signum( b )

log( b )

log1p( b )

exp( b )

expm1( b )

expinvexp( b )

sqrt( b )

rsqrt( b )

sqrtpos( b )

b :- floor( b )

ceil( b )

hypot( a, b )

Parameters

a

-

RealBox object

b

-

RealBox object

precopt

-

(optional) equation of the form precision = n, where n is a positive integer

Description

• 

These are the elementary and other basic mathematical functions defined for RealBox objects, such as logarithms and exponentials.

abs( b )

the absolute value of a RealBox object b

signum( b )

the signum (0, 1 or -1) of a RealBox object b

log( b )

the (natural) logarithm of a RealBox object b

log1p( b )

computes log( 1 + b ) accurately for b close to 0

exp( b )

the exponential (to base e) of b

expm1( b )

computes exp( b ) - 1 accurately for b close to 0

expinvexp( b )

computes the expression sequence representing exp( b ), exp( -b )

b:-sqrt( b )

the square root of b

sqrtpos( b )

the square root of b, ignoring any negative part of the box

rsqrt( b )

the reciprocal 1/sqrt( b ) of the square root of b

b:-floor( b )

the floor of b

ceil( b )

the ceiling of b

hypot( a, b )

computes sqrt( a^2 + b^2 )

• 

Use the 'precision' = n option to control the precision used in these methods. For more details on precision, see BoxPrecision.

Examples

bRealBox2.3

bRealBox: -2.3±2.32831ⅇ-10

(1)

absb

RealBox: 2.3±2.32831ⅇ-10

(2)

signumb

RealBox: -1±0

(3)

logb

RealBox: nan±0

(4)

The log1p method does not have a Maple equivalent. It computes log1p( x ) = log( 1 + x ) accurately, for x close to 0.

log1pb

RealBox: nan±0

(5)

bRealBox2.3

bRealBox: 2.3±2.32831ⅇ-10

(6)

logb

RealBox: 0.832909±1.59445ⅇ-10

(7)

log1pb

RealBox: 1.19392±1.87027ⅇ-10

(8)

Note the difference in the following three computations. In particular, for the last of the three, the expression 1+x is computed in Maple's regular floating point domain, where inaccuracies due to round off are not kept track of; and consequently, the final result does not contain the correct answer.

x1.×10−30

x1.×10−30

(9)

log1pRealBoxx

RealBox: 1e-30±1.83815ⅇ-40

(10)

log1+RealBoxx

RealBox: 0±1.16415ⅇ-10

(11)

logRealBox1+x

RealBox: 0±0

(12)

expb

RealBox: 9.97418±3.25726ⅇ-09

(13)

Again, there are different results depending upon how the following is computed.

expm1b

RealBox: 8.97418±3.25726ⅇ-09

(14)

expb1

RealBox: 8.97418±3.25726ⅇ-09

(15)

The sqrt function must be invoked as a fully qualified method from its argument b by using the b:- prefix.

b:-sqrtb

RealBox: 1.51658±1.93178ⅇ-10

(16)

sqrtb

Error, invalid input: sqrt expects its 1st argument, x, to be of type algebraic, but received RealBox(2.30000000004657,2.3283064365387e-010)

There is no Maple equivalent for the method rsqrt, which computes rsqrt( s ) = 1 / sqrt( s ).

bRealBox0.1,0.2

bRealBox: 0.1±0.2

(17)

This is undefined because the box contains negative values.

b:-sqrtb

RealBox: nan±0

(18)

HasNegativeb

true

(19)

However, there is an alternative method sqrtpos that can be used in such cases.

sqrtposRealBox0.1,0.2

RealBox: 0.273861±0.273861

(20)

rsqrtb

RealBox: nan±0

(21)

The expinvexp( b ) command returns a pair of RealBox objects, the first representing exp( b ) and the second one exp( -b ).

bRealBox2.3

bRealBox: -2.3±2.32831ⅇ-10

(22)

expinvexpb

RealBox: 0.100259±3.06477ⅇ-11,RealBox: 9.97418±3.9803ⅇ-09

(23)

Note that the expression above provides for a smaller radius for the second output.

expb,expb

RealBox: 0.100259±3.06477ⅇ-11,RealBox: 9.97418±3.25726ⅇ-09

(24)

expb

RealBox: 9.97418±3.25726ⅇ-09

(25)

b:-floorb

RealBox: -3±0

(26)

ceilb

RealBox: -2±0

(27)

aRealBox4.7

aRealBox: -4.7±4.65661ⅇ-10

(28)

hypota,b

RealBox: 5.23259±1.0113ⅇ-09

(29)

Note that the hypot( a, b ) command may produce a more accurate result than computing the result synthetically.

RealBox:-sqrta2+b2

RealBox: 5.23259±1.38675ⅇ-09

(30)

evalbRadiushypota&comma;b<RadiusRealBox:-sqrta2+b2

true

(31)

Compatibility

• 

The RealBox[Elementary], RealBox:-abs, RealBox:-signum, RealBox:-log, RealBox:-log1p, RealBox:-exp, RealBox:-expm1, RealBox:-expinvexp, RealBox:-sqrt, RealBox:-rsqrt, RealBox:-sqrtpos, RealBox:-floor, RealBox:-ceil and RealBox:-hypot commands were introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

See Also

ComplexBox

ComplexBox[Circular]

RealBox

RealBox[Circular]

RealBox[Hyperbolic]