Skip to content

Rigorous floating-point calculations using interval arithmetic in Julia

License

Notifications You must be signed in to change notification settings

gwater/IntervalArithmetic.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntervalArithmetic.jl

Build Status coverage

docs

IntervalArithmetic.jl is a Julia package for performing Validated Numerics in Julia, i.e. rigorous computations with finite-precision floating-point arithmetic.

All calculations are carried out using interval arithmetic: all quantities are treated as intervals, which are propagated throughout a calculation. The final result is an interval that is guaranteed to contain the correct result, starting from the given initial data.

The aim of the package is correctness over speed, although performance considerations are also taken into account.

This Fork

This fork aims to reduce the complexity of the code base by

  • restricting the scope of the implementation,
  • intentionally making IEEE 1788 not subtypes of Julia's Number type,
  • making invalid data unrepresentable, and
  • using Julia's multiple dispatch more extensively.

As a side-effect of these changes, the manageability, reliability and performance of the code should increase, for the internal code base and for user code.

Scope

The following elements are removed from scope:

  • interval construction from strings (for now)
  • multi-dimensional intervals
  • complex intervals
  • intervals as a drop-in replacement for numbers (for this feature, see NumberIntervals.jl)
  • interval decoration
  • interval construction using macros
  • support for the Windows operating system
  • intervals with Rational and Int boundaries (only floating point)

As a result, many operations are simplified.

Intervals as Numbers

IEEE 1788 definitions for interval comparison (equals, larger-than, etc) are inconsistent with Base Julia specifications for Number-comparisons. As a result, IEEE 1788 intervals are not suitable as drop-in replacements for Numbers in third-party numeric algorithms. NumberIntervals.jl provides a non-IEEE 1788-compliant interval type which is a subtype of Real and can be safely used in third-party numeric algorithms.

Invalid data

In this fork Intervals are restricted to non-empty, IEEE 1788-compliant values. As a result, no validity or emptiness checks need to be performed on Interval arguments of methods.

Multiple Dispatch

This fork represents empty intervals and invalid intervals using separate types. As a result, many trivial cases can be handled in specialized methods. Due to Julia's 'small union' optimizations, there is no negative impact on performance. In fact, in cases where emptiness can be inferred during compilation, performance may increase substantially. Furthermore, IEEE 1788-invalid intervals (not-an-interval) cause a MethodError in almost any context which makes invalid input easy to detect and locate in user code.

Authorship

Original Authors

  • Luis Benet, Instituto de Ciencias Físicas, Universidad Nacional Autónoma de México (UNAM)
  • David P. Sanders, Departamento de Física, Facultad de Ciencias, Universidad Nacional Autónoma de México (UNAM)

Contributors to Upstream

  • Oliver Heimlich
  • Nikolay Kryukov
  • John Verzani

This fork includes contributions from Josua Grawitter.

Documentation for Upstream

Documentation for the package is available here.

The best way to learn how to use the package is to look at the tutorial, available in the organisation webpage here.

Installation

To install the package, from within Julia do

julia> Pkg.add("https://github.com/gwater/IntervalArithmetic.jl.git")

Please note that this fork is not registered.

Standard for Interval Arithmetic: IEEE 1788-2015

The IEEE Std 1788-2015 - IEEE Standard for Interval Arithmetic was published in June 2015. We are working towards having IntervalArithmetic.jl be conformant with this standard.

To do so, we have incorporated tests from the excellent ITF1788 test suite, originally written by Marco Nehmeier and Maximilian Kiesner, and converted to a common format and to output tests for Julia by Oliver Heimlich.

Bibliography

  • Validated Numerics: A Short Introduction to Rigorous Computations, W. Tucker, Princeton University Press (2010)
  • Introduction to Interval Analysis, R.E. Moore, R.B. Kearfott & M.J. Cloud, SIAM (2009)

Related packages

  • MPFI.jl, a Julia wrapper around the MPFI C library, a multiple-precision interval arithmetic library based on MPFR
  • Intervals.jl, an alternative implementation of basic interval functions.
  • Intervals.jl, an alternative implementation of basic interval functions by Invenia Technical Computing.
  • Unums.jl, an implementation of interval arithmetic with variable precision ("ubounds")

History

This project was begun during a masters' course in the postgraduate programs in Physics and in Mathematics at UNAM during the second semester of 2013 (in Python), and was reinitiated -- now in Julia -- in the first semester of 2015. We thank the participants of the courses for putting up with the half-baked material and contributing energy and ideas.

Acknowledgements

This project was developed in a masters' course in the postgraduate programs in Physics and in Mathematics at UNAM during the second semester of 2013 and the first semester of 2015. We thank the participants of the courses for putting up with the half-baked material and contributing energy and ideas.

Financial support is acknowledged from DGAPA-UNAM PAPIME grants PE-105911 and PE-107114, and DGAPA-UNAM PAPIIT grant IN-117214. LB acknowledges support through a Cátedra Marcos Moshinsky (2013). DPS acknowledges a sabbatical fellowship from CONACYT and thanks Alan Edelman and the Julia group at MIT for hosting his sabbatical visit.

About

Rigorous floating-point calculations using interval arithmetic in Julia

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%