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
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 )
a
-
RealBox object
b
precopt
(optional) equation of the form precision = n, where n is a positive integer
These are the elementary and other basic mathematical functions defined for RealBox objects, such as logarithms and exponentials.
the absolute value of a RealBox object b
the signum (0, 1 or -1) of a RealBox object b
the (natural) logarithm of a RealBox object b
computes log( 1 + b ) accurately for b close to 0
the exponential (to base e) of b
computes exp( b ) - 1 accurately for b close to 0
computes the expression sequence representing exp( b ), exp( -b )
b:-sqrt( b )
the square root of b
the square root of b, ignoring any negative part of the box
the reciprocal 1/sqrt( b ) of the square root of b
b:-floor( b )
the floor of b
the ceiling of 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.
b≔RealBox⁡−2.3
b≔⟨RealBox: -2.3±2.32831ⅇ-10⟩
abs⁡b
⟨RealBox: 2.3±2.32831ⅇ-10⟩
signum⁡b
⟨RealBox: -1±0⟩
log⁡b
⟨RealBox: nan±0⟩
The log1p method does not have a Maple equivalent. It computes log1p( x ) = log( 1 + x ) accurately, for x close to 0.
log1p⁡b
b≔RealBox⁡2.3
b≔⟨RealBox: 2.3±2.32831ⅇ-10⟩
⟨RealBox: 0.832909±1.59445ⅇ-10⟩
⟨RealBox: 1.19392±1.87027ⅇ-10⟩
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.
x≔1.×10−30
log1p⁡RealBox⁡x
⟨RealBox: 1e-30±1.83815ⅇ-40⟩
log⁡1+RealBox⁡x
⟨RealBox: 0±1.16415ⅇ-10⟩
log⁡RealBox⁡1+x
⟨RealBox: 0±0⟩
exp⁡b
⟨RealBox: 9.97418±3.25726ⅇ-09⟩
Again, there are different results depending upon how the following is computed.
expm1⁡b
⟨RealBox: 8.97418±3.25726ⅇ-09⟩
exp⁡b−1
The sqrt function must be invoked as a fully qualified method from its argument b by using the b:- prefix.
b:-sqrt⁡b
⟨RealBox: 1.51658±1.93178ⅇ-10⟩
sqrt⁡b
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 ).
b≔RealBox⁡0.1,0.2
b≔⟨RealBox: 0.1±0.2⟩
This is undefined because the box contains negative values.
HasNegative⁡b
true
However, there is an alternative method sqrtpos that can be used in such cases.
sqrtpos⁡RealBox⁡0.1,0.2
⟨RealBox: 0.273861±0.273861⟩
rsqrt⁡b
The expinvexp( b ) command returns a pair of RealBox objects, the first representing exp( b ) and the second one exp( -b ).
expinvexp⁡b
⟨RealBox: 0.100259±3.06477ⅇ-11⟩,⟨RealBox: 9.97418±3.9803ⅇ-09⟩
Note that the expression above provides for a smaller radius for the second output.
exp⁡b,exp⁡−b
⟨RealBox: 0.100259±3.06477ⅇ-11⟩,⟨RealBox: 9.97418±3.25726ⅇ-09⟩
exp⁡−b
b:-floor⁡b
⟨RealBox: -3±0⟩
ceil⁡b
⟨RealBox: -2±0⟩
a≔RealBox⁡−4.7
a≔⟨RealBox: -4.7±4.65661ⅇ-10⟩
hypot⁡a,b
⟨RealBox: 5.23259±1.0113ⅇ-09⟩
Note that the hypot( a, b ) command may produce a more accurate result than computing the result synthetically.
RealBox:-sqrt⁡a2+b2
⟨RealBox: 5.23259±1.38675ⅇ-09⟩
evalb⁡Radius⁡hypot⁡a,b<Radius⁡RealBox:-sqrt⁡a2+b2
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[Circular]
RealBox[Hyperbolic]
Download Help Document