Workspace Documentation Command Window For more information, visit http://www.octave.org/get-involved.html Read http://www.octave.org/bugs.html to learn how to submit bug reports. For information about changes from previous versions, type 'news'. >> pkg load interval >> sum (infsupdec (magic (3))) ans = 1×3 interval vector [15]_com [15]_com [15]_com >>
33
Embed
)B :I % : B ' B ) (ES,B I · +1 ' + **; % B BF: < 1 N )B2-'0 B % K B )B% B-
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Interval arithmetic in
GNU Octave
Workspace DocumentationCommand Window
For more information, visit http://www.octave.org/get-involved.html
Read http://www.octave.org/bugs.html to learn how to submit bug reports.For information about changes from previous versions, type 'news'.
The interval package for real-valued interval arithmetic allows one to evaluatefunctions over subsets of their domain. All results are verified, because intervalcomputations automatically keep track of any errors. These concepts can beused to handle uncertainties, estimate arithmetic errors and produce reliableresults. Also it can be applied to computer-assisted proofs, constraintprogramming, and verified computing. The implementation is based on intervalboundaries represented by binary64 numbers and is conforming to IEEE Std1788-2015, IEEE standard for interval arithmetic.
Details
Dependencies: Octave (>= 3.8.0)
Runtime system dependencies: mpfr (>= 3.1.0) [Debian] libmpfr4 (>= 3.1.0)
Abstract. Libraries implementing the interval arithmetic standardIEEE 1788 have to be tested for errors. Although the standard is lan-guage agnostic, the different implementations are not. Therefore the sametests must be implemented in many different languages. Hence it is usefulto only have to formulate the tests once – in a domain-specific language– and to subsequently generate the language-specific test code automat-ically. To save time and encourage test-driven development, we presenta language for testing interval arithmetic libraries and a correspondingsource code generator which produces language-specific unit tests.
Keywords: domain-specific language, IEEE1788, interval arithmetic,ITF1788, source code generation, test-driven development, unit test
1 Introduction
Floating point numbers are widely used in computer science to approximate realnumbers. Due to their limited precision, complex calculations may however leadto poor results. Interval arithmetic tackles this problem by representing a realvalue x as a tuple of floating point numbers [a , b], called an interval, wherea ≤ x ≤ b. Real-valued functions are adapted accordingly, requiring an interval-valued input and evaluating to an interval-valued output. The Fundamental The-orem of Interval Arithmetic then guarantees that the result of evaluating thisfunction produces an interval which encloses the real-valued result of the originalfunction.The IEEE Interval Standard Working Group 1788 [7] is working on a compre-hensive standard for interval arithmetic, which includes methods and algorithms,whose validity can be proven by mathematical methods. In practice the differentlanguage-specific implementations are prone to a variety of errors. These mayoccur in the implementation’s source code, the compiler or the CPU. It is thusreasonable to spotcheck an implementation with unit tests.
Several arithmetic errors #11oheim opened this issue on 22 Nov 2015 · 2 comments
Edit New issueNew issue
oheim commented on 22 Nov 2015
The following errors have been found using pyIbex 1.1.3 and are probably derived from IBEX.
Interval.ALL_REALS.contains(∞) should be false, because an interval is a subset of the reals and ∞ isno real number (same is true for -∞).
1.
pyIbex.atan2([0, 0], [entire]) should contain [0, π], but is [empty].2. pyIbex.atan2([-2, -0.1], [entire]) should contain [-π, 0], but is [empty].3. pyIbex.atan2([-2, 0], [entire]) should contain [-π, π], but is [empty].4. pyIbex.atan2([-2, 0], [-2, 1]) should contain [-π, π], but is [-π, 0].5. pyIbex.atan2([0, 1], [entire]) should contain [0, π], but is [empty].6. pyIbex.atan2([0.1, 1], [entire]) should contain [0, π], but is [empty].7. pyIbex.atanh([1, ∞]) and pyIbex.atanh([1, 1]) return [+∞], which is not an interval, should be [empty].8. pyIbex.atanh([-∞, -1]) and pyIbex.atanh([-1, -1]) return [-∞], which is not an interval, should be [empty].9. pyIbex.sin(Interval(float.fromhex('-0X1.921FB54442D18P+1'), 0.0)) does not cover 0 as a
possible result.10.
pyIbex.bwd_abs([-1.9, 0.2], [-0.2, 0.2]) increases the size of x, which should never happen forbackward arithmetics.
11.
pyIbex.bwd_pow([-1, 5], 0, [-51, 12]) reduces the size of x, which is wrong.12. pyIbex.bwd_pow([1, 1], 0, [entire]) should produce x = [entire], but is x = [-1, 1].13.
Labels
Milestone
No milestone
Assignees
No one assigned
2 participants
None yet
Notifications
You’re receiving notifications becauseyou were mentioned.
The following cases of poor accuracy could be improved:
pow([empty], 0) returns [1, 1], should be [empty].1. pyIbex.sqrt([entire]), pyIbex.sqrt([0, 1]) and other values for x produce a negative lower boundary,should be zero.
2.
pyIbex.tan(Interval(0.0, float.fromhex('0X1.921FB54442D18P+0'))) returns [entire], should be[0, 1.63312e+16].
Interval.ALL_REALS) should produce x = [empty]. Also this function call modifies the content ofInterval.ALL_REALS, which is bad.
4.
pyIbex.bwd_abs([-1, 0], [entire]) should produce x = [0, 0], but is [-1, 1].5. pyIbex.bwd_abs([-∞, 0], [entire]) should produce x = [0, 0], but is [entire].6. pyIbex.bwd_abs([-∞, -1], [entire]) should produce x = [empty], but is [entire].7. pyIbex.bwd_abs([-∞, 1], [entire]) should produce x = [-1, 1], but is [entire].8. Interval(float.fromhex('-0X0.0000000000002P-1022'), float.fromhex('0X0.0000000000001P-1022')).mid() should use IEEE 754 rounding mode “to nearest, ties to even” and produce 0.
9.
pyIbex.bwd_cosh([empty], [0, ∞]) should produce x = [empty], but is x = [0, ∞].10. pyIbex.bwd_cosh([empty], [entire]) should produce x = [empty], but is x = [entire].11. pyIbex.bwd_pow([-1, 0], 0, [-1, 1]) should produce x = [empty], but is x = [-1, 1].12. pyIbex.bwd_pow([0, 0], -1, [-5.1, 55.5]) should produce x = [empty], but is x = [0, 0].13. pyIbex.bwd_pow([-∞, 0], -3, [5.1, 55.5]) should produce x = [empty], but is x = [5.1, 55.5].14. pyIbex.bwd_pow([0, ∞], 3, [entire]) should not produce a negative lower boundary.15. pyIbex.bwd_pow([-∞, 0], 3, [entire]) should not produce a positive upper boundary.16. pyIbex.bwd_pow([-10, 0], -2, [entire]) should produce x = [empty], but is x = [entire].17. pyIbex.bwd_pow([-∞, 0], -7, [entire]) should produce x = [-∞, 0], but is [entire].18.