Open main menu


772 bytes added ,  09:43, 18 January 2015
→‎What to expect: Added runtime information
''Why is the interval package slow?''
All arithmetic interval operations are simulated in high-level octave language using C99 floating-point routines or multi-precision floating-point routines, which is a lot slower than a hardware implementations implementation []. Building interval arithmetic operations from floating-point routines is easy for simple monotonic functions, e. g., addition and subtraction, but is complex for others, e. g., [ interval power function], atan2, or [[#Reverse_arithmetic_operations|reverse functions]]. For some interval operations it is not even possible to rely on floating-point routines, since not all required routines are available in C99 or BLAS.
Great algorithms and optimizations exist for floating-point matrix arithmetic in GNU octaveOctave. Good interval versions of these still have to be found and implemented.For example, multiplication of matrices with many elements becomes unfeasible as it takes a lot of time. (For that purpose one could use the [[#Related work|INTLAB toolbox]], which uses a less accurate arithmetic) {| class="wikitable" style="margin: auto; align:right"|+align="bottom" | Approximate runtime (wall clock time in seconds) on an Intel® Core™ i5-4340M CPU!Matrix dimension!Interval <code>plus</code>!Interval <code>log</code>!Interval <code>mtimes</code>!Interval <code>inv</code>|-|align="right"| 10|align="right"| < 0.1|align="right"| < 0.1|align="right"| 0.4|align="right"| 3.3|-|align="right"| 20|align="right"| < 0.1|align="right"| < 0.1|align="right"| 2.3|style="text-align:right; font-weight: bold; color:orange"| 32.3|-|align="right"| 30|align="right"| < 0.1|align="right"| < 0.1|align="right"| 7.0|style="text-align:right; font-weight: bold; color:red"| 142.1|-|align="right"| 40|align="right"| < 0.1|align="right"| 0.1|align="right"| 15.6|-|align="right"| 50|align="right"| 0.1|align="right"| 0.2|style="text-align:right; font-weight: bold; color:orange"| 29.1|}
''Why is the interval package accurate?''
Some basic operations are provided by the C library on common platforms with directed rounding and correctly rounded result: plus, minus, division, multiplication and square root. All other The GNU Octave arithmetic functions are not guaranteed to produce accurate results, because they are based on C99 builtin floating-point routines [httpare not useful for interval arithmetic://]. Their results depend on hardware, system libraries and compilation options.
The interval package handles all arithmetic functions with the help of the [ GNU MPFR library]. With MPFR it is possible to compute system-independent, valid and tight enclosures of the correct results.