1@c This is part of the GNU Octave Interval Package Manual. 2@c Copyright 2015-2016 Oliver Heimlich. 3@c See the file manual.texinfo for copying conditions. 4@documentencoding UTF-8 5@include macros.texinfo 6 7@appendix IEEE Std 1788-2015 8 9The IEEE standard for interval arithmetic is an important asset for the general use of interval arithmetic. Several interval arithmetic libraries have been created (most popular for the language C++), which vary greatly in their philosophy, completeness and—most important—mathematical definition of certain functions and arithmetic evaluation. The standard grants support for several interval arithmetic flavors, but fights incompatibilities on many layers: Interval arithmetic applications shall be portable, predictable, and reproducible. This is especially important since interval arithmetic shall lead to reliable results. Also a common standard is necessary to catalyze the availability of (fast) interval operations in hardware. 10 11For all conforming implementations certain accuracy constraints must be satisfied and a good amount of interval functions must be implemented. It is defined how to handle functions that are not globally defined or have limiting values. Also such basic things like interval representation, many useful constructors, and interchange encoding are addressed. 12 13The interval package for GNU Octave is the first complete implementation that claims to be standard conforming. 14 15@menu 16* Function Names:: List of functions defined by IEEE Std 1788-2015@*and how they have been implemented in GNU Octave 17* Conformance Claim:: Official statement and some@*implementation specific details regarding the standard 18@end menu 19 20 21@node Function Names 22@appendixsec Function Names 23 24In terms of a better integration into the GNU Octave language, several operations use a function name which is different from the name proposed in the standard document. The following table translates and lists the implemented function names of the IEEE standard for interval arithmetic. 25 26The implementation provides several additional functions, but this section lists only functions that are mentioned in IEEE Std 1788-2015. 27 28 29 30@appendixsubsec Interval constants 31 32See @funref{empty} and @funref{entire}. 33 34 35 36@appendixsubsec Constructors 37 38The operations textToInterval (@var{S}), numsToInterval (@var{l}, @var{u}), and setDec (@var{x}) are implemented by the class constructors @funref{@@infsup/infsup} for bare intervals and @funref{@@infsupdec/infsupdec} for decorated intervals. 39 40 41 42@appendixsubsec Required functions 43 44@float Table,tab:required-forward-functions 45@caption{Required forward elementary functions} 46@shortcaption{Required forward elementary functions} 47 48@multitable {roundTiesToAway (x)} {@@infsupdec/iscommoninterval} {Tightness (and comments...)} 49@headitem 50 Operation 51 @tab Implementation 52 @tab Tightness 53@ifnottex 54@headitem 55 @tab @r{@emph{Basic operations}} @tab 56@end ifnottex 57@item neg (@var{x}) 58 @tab@funref{@@infsup/uminus} 59 @tab tightest 60@item add (@var{x}, @var{y}) 61 @tab@funref{@@infsup/plus} 62 @tab tightest 63@item sub (@var{x}, @var{y}) 64 @tab@funref{@@infsup/minus} 65 @tab tightest 66@item mul (@var{x}, @var{y}) 67 @tab@funref{@@infsup/times} 68 @tab tightest 69@item div (@var{x}, @var{y}) 70 @tab@funref{@@infsup/rdivide} 71 @tab tightest 72@item recip (@var{x}) 73 @tab@code{1 ./ @var{x}} 74 @tab tightest 75@item sqr (@var{x}) 76 @tab@code{@var{x} .^ 2} 77 @tab tightest 78@item sqrt (@var{x}) 79 @tab@funref{@@infsup/realsqrt} 80 @tab tightest 81@item fma (@var{x}, @var{y}, @var{z}) 82 @tab@funref{@@infsup/fma} 83 @tab tightest 84@ifnottex 85@headitem 86 @tab @r{@emph{Power functions}} @tab 87@end ifnottex 88@item pown (@var{x}, @var{p}) 89 @tab@funref{@@infsup/pown} 90 @tab tightest 91@item pow (@var{x}, @var{y}) 92 @tab@funref{@@infsup/pow} 93 @tab tightest 94@item exp (@var{x}) 95 @tab@funref{@@infsup/exp} 96 @tab tightest 97@item exp2 (@var{x}) 98 @tab@funref{@@infsup/pow2} 99 @tab tightest 100@item exp10 (@var{x}) 101 @tab@funref{@@infsup/pow10} 102 @tab tightest 103@item log (@var{x}) 104 @tab@funref{@@infsup/log} 105 @tab tightest 106@item log2 (@var{x}) 107 @tab@funref{@@infsup/log2} 108 @tab tightest 109@item log10 (@var{x}) 110 @tab@funref{@@infsup/log10} 111 @tab tightest 112@ifnottex 113@headitem 114 @tab @r{@emph{Trigonometric / hyperbolic}} @tab 115@end ifnottex 116@item sin (@var{x}) 117 @tab@funref{@@infsup/sin} 118 @tab tightest 119@item cos (@var{x}) 120 @tab@funref{@@infsup/cos} 121 @tab tightest 122@item tan (@var{x}) 123 @tab@funref{@@infsup/tan} 124 @tab tightest 125@item asin (@var{x}) 126 @tab@funref{@@infsup/asin} 127 @tab tightest 128@item acos (@var{x}) 129 @tab@funref{@@infsup/acos} 130 @tab tightest 131@item atan (@var{x}) 132 @tab@funref{@@infsup/atan} 133 @tab tightest 134@item atan2 (@var{y}, @var{x}) 135 @tab@funref{@@infsup/atan2} 136 @tab tightest 137@item sinh (@var{x}) 138 @tab@funref{@@infsup/sinh} 139 @tab tightest 140@item cosh (@var{x}) 141 @tab@funref{@@infsup/cosh} 142 @tab tightest 143@item tanh (@var{x}) 144 @tab@funref{@@infsup/tanh} 145 @tab tightest 146@item asinh (@var{x}) 147 @tab@funref{@@infsup/asinh} 148 @tab tightest 149@item acosh (@var{x}) 150 @tab@funref{@@infsup/acosh} 151 @tab tightest 152@item atanh (@var{x}) 153 @tab@funref{@@infsup/atanh} 154 @tab tightest 155@ifnottex 156@headitem 157 @tab @r{@emph{Integer functions}} @tab 158@end ifnottex 159@item sign (@var{x}) 160 @tab@funref{@@infsup/sign} 161 @tab tightest 162@item ceil (@var{x}) 163 @tab@funref{@@infsup/ceil} 164 @tab tightest 165@item floor (@var{x}) 166 @tab@funref{@@infsup/floor} 167 @tab tightest 168@item trunc (@var{x}) 169 @tab@funref{@@infsup/fix} 170 @tab tightest 171@item roundTiesToEven (@var{x}) 172 @tab@funref{@@infsup/roundb} 173 @tab tightest 174@item roundTiesToAway (@var{x}) 175 @tab@funref{@@infsup/round} 176 @tab tightest 177@ifnottex 178@headitem 179 @tab @r{@emph{Absmax functions}} @tab 180@end ifnottex 181@item abs (@var{x}) 182 @tab@funref{@@infsup/abs} 183 @tab tightest 184@item min (@var{x}, @var{y}) 185 @tab@funref{@@infsup/min} 186 @tab tightest 187@item max (@var{x}, @var{y}) 188 @tab@funref{@@infsup/max} 189 @tab tightest 190@end multitable 191@end float 192 193@float Table,tab:required-reverse-functions 194@caption{Required reverse functions} 195@shortcaption{Required reverse functions} 196 197@multitable {roundTiesToAway (x)} {@@infsupdec/iscommoninterval} {Tightness (and comments...)} 198@headitem 199 Operation 200 @tab Implementation 201 @tab Tightness 202@ifnottex 203@headitem 204 @tab @r{@emph{From unary functions}} @tab 205@end ifnottex 206@item sqrRev (@var{c}, @var{x}) 207 @tab@funref{@@infsup/sqrrev} 208 @tab tightest 209@item absRev (@var{c}, @var{x}) 210 @tab@funref{@@infsup/absrev} 211 @tab tightest 212@item pownRev (@var{c}, @var{x}, @var{p}) 213 @tab@funref{@@infsup/pownrev} 214 @tab valid (tightest for @var{p} ≥ @minus{}2) 215@item sinRev (@var{c}, @var{x}) 216 @tab@funref{@@infsup/sinrev} 217 @tab valid 218@item cosRev (@var{c}, @var{x}) 219 @tab@funref{@@infsup/cosrev} 220 @tab valid 221@item tanRev (@var{c}, @var{x}) 222 @tab@funref{@@infsup/tanrev} 223 @tab valid 224@item coshRev (@var{c}, @var{x}) 225 @tab@funref{@@infsup/coshrev} 226 @tab tightest 227@ifnottex 228@headitem 229 @tab @r{@emph{From binary functions}} @tab 230@end ifnottex 231@item mulRev (@var{b}, @var{c}, @var{x}) 232 @tab@funref{@@infsup/mulrev} 233 @tab tightest 234@item powRev1 (@var{b}, @var{c}, @var{x}) 235 @tab@funref{@@infsup/powrev1} 236 @tab valid 237@item powRev2 (@var{a}, @var{c}, @var{x}) 238 @tab@funref{@@infsup/powrev2} 239 @tab valid 240@item atan2Rev1 (@var{b}, @var{c}, @var{x}) 241 @tab@funref{@@infsup/atan2rev1} 242 @tab valid 243@item atan2Rev2 (@var{a}, @var{c}, @var{x}) 244 @tab@funref{@@infsup/atan2rev2} 245 @tab valid 246@ifnottex 247@headitem 248 @tab @r{@emph{Two-output division}} @tab 249@end ifnottex 250@item mulRevToPair (@var{b}, @var{c}) 251 @tab@funref{@@infsup/mulrev} 252 @tab tightest 253@ifnottex 254@headitem 255 @tab @r{@emph{Cancellative addition@*and subtraction}} @tab 256@end ifnottex 257@item cancelMinus (@var{x}, @var{y}) 258 @tab@funref{@@infsup/cancelminus} 259 @tab tightest 260@item cancelPlus (@var{x}, @var{y}) 261 @tab@funref{@@infsup/cancelplus} 262 @tab tightest 263@end multitable 264@end float 265 266@float Table,tab:required-set-operations 267@caption{Required set operations} 268@shortcaption{Required set operations} 269 270@multitable {roundTiesToAway (x)} {@@infsupdec/iscommoninterval} {Tightness (and comments...)} 271@headitem 272 Operation 273 @tab Implementation 274 @tab Tightness 275@item intersection (@var{x}, @var{y}) 276 @tab@funref{@@infsup/intersect} 277 @tab tightest 278@item convexHull (@var{x}, @var{y}) 279 @tab@funref{@@infsup/union} 280 @tab tightest 281@end multitable 282@end float 283 284 285@float Table,tab:required-numeric-functions 286@caption{Required numeric functions of intervals} 287@shortcaption{Required numeric functions of intervals} 288 289@multitable {roundTiesToAway (x)} {@@infsupdec/iscommoninterval} {Tightness (and comments...)} 290@headitem 291 Operation 292 @tab Implementation 293 @tab Rounding mode 294@item inf (@var{x}) 295 @tab@funref{@@infsup/inf} 296 @tab 297@item sup (@var{x}) 298 @tab@funref{@@infsup/sup} 299 @tab 300@item mid (@var{x}) 301 @tab@funref{@@infsup/mid} 302 @tab to nearest, ties to even 303@item wid (@var{x}) 304 @tab@funref{@@infsup/wid} 305 @tab toward +∞ 306@item rad (@var{x}) 307 @tab@funref{@@infsup/rad} 308 @tab toward +∞ 309@item mag (@var{x}) 310 @tab@funref{@@infsup/mag} 311 @tab 312@item mig (@var{x}) 313 @tab@funref{@@infsup/mig} 314 @tab 315@end multitable 316@end float 317 318 319@float Table,tab:required-boolean-functions 320@caption{Required boolean functions of intervals} 321@shortcaption{Required boolean functions of intervals} 322 323@multitable {roundTiesToAway (x)} {@@infsupdec/iscommoninterval} {Tightness (and comments...)} 324@headitem 325 Operation 326 @tab Implementation 327 @tab Description 328@item isEmpty (@var{x}) 329 @tab@funref{@@infsup/isempty} 330 @tab @var{x} is the empty set 331@item isEntire (@var{x}) 332 @tab@funref{@@infsup/isentire} 333 @tab @var{x} is the whole line 334@item equal (@var{a}, @var{b}) 335 @tab@funref{@@infsup/eq} 336 @tab @var{a} equals @var{b} 337@item subset (@var{a}, @var{b}) 338 @tab@funref{@@infsup/subset} 339 @tab @var{a} is a subset of @var{b} 340@item less (@var{a}, @var{b}) 341 @tab@funref{@@infsup/le} 342 @tab @var{a} is weakly less than @var{b} 343@item precedes (@var{a}, @var{b}) 344 @tab@funref{@@infsup/precedes} 345 @tab @var{a} is left of but may touch @var{b} 346@item interior (@var{a}, @var{b}) 347 @tab@funref{@@infsup/interior} 348 @tab @var{a} is interior to @var{b} 349@item strictLess (@var{a}, @var{b}) 350 @tab@funref{@@infsup/lt} 351 @tab @var{a} is strictly less than @var{b} 352@item strictPrecedes (@var{a}, @var{b}) 353 @tab@funref{@@infsup/strictprecedes} 354 @tab @var{a} is strictly left of @var{b} 355@item disjoint (@var{a}, @var{b}) 356 @tab@funref{@@infsup/disjoint} 357 @tab @var{a} and @var{b} are disjoint 358@end multitable 359@end float 360 361 362@appendixsubsec Recommended functions 363 364@float Table,tab:recommended-functions 365@caption{Recommended functions} 366@shortcaption{Recommended functions} 367 368@multitable {roundTiesToAway (x)} {@@infsupdec/iscommoninterval} {Tightness (and comments...)} 369@headitem 370 Operation 371 @tab Implementation 372 @tab Tightness / Comments 373@ifnottex 374@headitem 375 @tab @r{@emph{Elementary functions}} @tab 376@end ifnottex 377@item rootn (@var{x}, @var{q}) 378 @tab@funref{@@infsup/nthroot} 379 @tab valid (tightest for @var{q} ≥ @minus{}2) 380@item expm1 (@var{x}) 381 @tab@funref{@@infsup/expm1} 382 @tab tightest 383@item logp1 (@var{x}) 384 @tab@funref{@@infsup/log1p} 385 @tab tightest 386@item hypot (@var{x}, @var{y}) 387 @tab@funref{@@infsup/hypot} 388 @tab tightest 389@item rSqrt (@var{x}) 390 @tab@funref{@@infsup/rsqrt} 391 @tab tightest 392@ifnottex 393@headitem 394 @tab @r{@emph{Boolean functions}} @tab 395@end ifnottex 396@item isCommonInterval (@var{x}) 397 @tab@funref{@@infsup/iscommoninterval} 398 @tab (=bound and non-empty) 399@item isSingleton (@var{x}) 400 @tab@funref{@@infsup/issingleton} 401 @tab (=single real) 402@item isMember (@var{m}, @var{x}) 403 @tab@funref{@@infsup/ismember} 404 @tab 405@ifnottex 406@headitem 407 @tab @r{@emph{Extended comparison}} @tab 408@end ifnottex 409@item overlap (@var{a}, @var{b}) 410 @tab@funref{@@infsup/overlap} 411 @tab 412 413@end multitable 414@end float 415 416 417 418@appendixsubsec Operations on/with decorations 419 420See @funref{@@infsup/newdec}, @funref{@@infsupdec/intervalpart}, and @funref{@@infsupdec/decorationpart}. The operation setDec is implemented by @funref{@@infsupdec/infsupdec}. 421 422For comparison of decorations with respect to the propagation order @code{com > dac > def > trv > ill} use the numeric value returned by @code{decorationpart (@var{x}, "uint8")}. 423 424@appendixsubsec Reduction operations 425 426See @funref{mpfr_vector_sum_d} and @funref{mpfr_vector_dot_d}. The operations @code{sumAbs} and @code{sumSquare} can be computed with @code{mpfr_vector_sum_d (@var{rounding mode}, abs (@var{x}))} and @code{mpfr_vector_dot_d (@var{rounding mode}, @var{x}, @var{x})} respectively. 427 428@appendixsubsec Input 429 430The operation @code{textToInterval} is implemented by the class constructors @funref{@@infsup/infsup} for bare intervals and @funref{@@infsupdec/infsupdec} for decorated intervals. Both are able to operate on interval literals provided as strings. 431 432@appendixsubsec Output 433 434See @funref{intervaltotext}. 435 436@appendixsubsec Exact text representation 437 438See @funref{exacttointerval} and @funref{@@infsup/intervaltoexact}. 439 440@appendixsubsec Interchange representation and encoding 441 442See @funref{interval_bitpack} and @funref{@@infsup/bitunpack}. 443 444 445@node Conformance Claim 446@appendixsec Conformance Claim 447 448The inverval package version @value{version} for GNU Octave is conforming to IEEE Std 1788-2015, IEEE Standard for Interval Arithmetic. It is conforming to the set-based flavor with IEEE 754 conformance for the infsup binary64 interval type and without compressed arithmetic. Additionally it provides no further flavors. 449 450@appendixsec Conformance Questionnaire 451 452@html 453<div class="alpha-list"></div> 454@end html 455@enumerate a 456@item Implementation-defined behavior 457@enumerate 1 458@item 459 What status flags or other means to signal the occurrence of certain decoration values in computations does the implementation provide if any? 460 461 The implementation does not signal the occurrence of decoration values. 462@end enumerate 463 464@item Documentation of behavior 465@enumerate 1 466@item 467 If the implementation supports implicit interval types, how is the interval hull operation realized? 468 469 The implementation supports explicit interval types only. 470 471@item 472 What accuracy is achieved (i.e., tightest, accurate, or valid) for each of the implementation’s interval operations? 473 474 The accuracy requirements of IEEE Std 1788-2015 are fulfilled. Most operations achieve tightest accuracy, some operations (especially reverse operations) do not. The tightness of each operation is documented in the function's documentation string and can be displayed with the @command{help} command. 475 476@item 477 Under what conditions is a constructor unable to determine whether a Level 1 value exists that corresponds to the supplied inputs? 478 479 When two different string boundaries for an interval both lie between the same two subsequent binary64 numbers, a PossiblyUndefined warning is created. 480 481@item 482 How are ties broken in rounding numbers if multiple numbers qualify as the rounded result? 483 484 Tie-breaking uses the IEEE Std 754 default: round ties to even. 485 486@item 487 How are interval datums converted to their exact text representations? 488 489 The binary64 boundaries are converted into hexadecimal-significand form as required by the standard. It is also possible to convert interval datums to exact interval literals in decimal form, see optional arguments of function @funref{intervaltotext} for that purpose. 490@end enumerate 491 492@item Implementation-defined behavior 493@enumerate 1 494 Does the implementation include the interval overlapping function? If so, how is it made available to the user? 495 496 Yes, the interval overlapping function is implemented under the name @funref{@@infsup/overlap}. 497 498@item 499 Does the implementation store additional information in a NaI? What functions are provided for the user to set and read this information? 500 501 No additional information is stored in a NaI. 502 503@item 504 What means if any does the implementation provide for an exception to be signaled when a NaI is produced? 505 506 The creation of a NaI is signaled with GNU Octave's warning mechanism. 507 508@item 509 What interval types are supported besides the required ones? 510 511 None. 512 513@item 514 What mechanisms of exception handling are used in exception handlers provided by the implementation? What additional exception handling is provided by the implementation? 515 516 The exceptions described by IEEE Std 1788-2015 raise a warning, which can be handled with GNU Octave's warning mechanism. The warning may be customized to produce an error instead and interrupt computation. The implementation provides no additional exception handling. 517 518@item 519 [Question does not apply to IEEE 754 conforming types.] 520 521@item 522 Does the implementation include different versions of the same operation for a given type and how are these provided to the user? 523 524 The interval matrix multiplication (see @funref{@@infsup/mtimes}) offers two implementations, with either @option{tightest} or @option{valid} accuracy. The user may chose the desired version with an optional argument during the function call. 525 526@item 527 What combinations of formats are supported in interval constructors? 528 529 Any reasonable combination of the formats described in the standard document is supported. 530 531@item 532 [Question does not apply to IEEE 754 conforming types.] 533 534@item 535 What methods are used to read or write strings from or to character streams? Does the implementation employ variations in locales (such as specific character case matching)? This includes the syntax used in the strings for reading and writing. 536 537 Input and output is implemented with GNU Octave string variables in UTF-8 encoding. There is no discrimination between different locales. Character case is ignored during input. The syntax for interval literals is used as described by the standard document. 538 539@item 540 What is the tightness for the interval to string conversion for all interval types? 541 542 The general-purpose interval to string conversion produces the tightest decimal infsup form which has no more digits than are necessary to separate two binary64 numbers. 543 544@item 545 What is the result of Level 3 operations for invalid inputs? 546 547 Interval constructors prevent the creation of invalid Level 3 interval datums. 548 549 Any non-interval input to Level 3 operations is implicitly converted into an interval and the operation silently continues on interval inputs. 550 551 If at least one input is a decorated interval, bare interval inputs are implicitly decorated as described by @command{newDec} in the standard document. Implicit promotion from a bare interval to a decorated interval is signaled with GNU Octave's warning mechanism. 552 553 If implicit conversion fails (e.g., illegal interval literals), bare interval operations produce empty intervals, whereas the decorated interval operations continue on NaI inputs. 554 555@item 556 [Question does not apply to IEEE 754 conforming types.] 557 558@item 559 What decorations does the implementation provide and what is their mathematical definition? How are these decorations mapped when converting an interval to the interchange format? 560 561 The implementation provides the decorations com, dac, def, trv, and ill as described by the standard document. 562 563@item 564 [Question does not apply to IEEE 754 conforming types.] 565@end enumerate 566 567@item [Question applies to compressed arithmetic only, which is not supported.] 568 569@item [Questions apply to non-standard flavors only, which are not supported.] 570@end enumerate 571