packageinterval
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=a2807d7860a9f965a3f91b40de17b98321e5c3f7da9e69dccf3dc20f1ac77e96
sha512=76196b171a41ce1374cae946b7c7a1dea6d614db61743ead14d628a12dce30a0dbd82db1960ad17b58f1f65a6f3fc61aaa5eac42face474baf840efb670feee8
Description
README
README.md
Interval
This is aninterval arithmetic library for OCaml. Here is a small example in the REPL:
# #require "interval.top";;...# open Interval_crlibm;;# let v = I.singleton 1.;;val v : Interval_crlibm.I.t = [1, 1]# I.sin v;;- : Interval_crlibm.I.t = [0.841471, 0.841471]# I.Precision.set (Some 16);;- : unit = ()# I.sin v;;- : Interval_crlibm.I.t = [0.8414709848078965, 0.8414709848078966]
SeveralOPAM packages are provided by this repository:
interval_base
: basic interval library that defines the datatypeInterval.t
and uses Intel assembly if possible or C99 instructions to perform arithmetic operations (moduleInterval).interval_crlibm
: relies oncrlibm to implement the interval operations. CRlibm providesproved correctly-rounded operations, so this is the library of choice for computer assisted proofs.interval_intel
: use Intel FPU instructions with directed rounding to implement interval operations. However, the Intel FPU operations may not always be correctly rounded for, say, trigonometric functions.interval_intel
uses assembly code to compute all operations with proper rounding, and currentlyONLY works on Intel processors. The package has been developed for Linux systems but works on MacOSX and Windows when compiled with GCC.interval
is a meta-package installing all the packages above. It also providesinterval.top
used above.
Note thatocamlopt
does float constant propagation inround to the nearest mode which may invalidate interval computations. Use the compiler flag-no-float-const-prop
to deactivate it.
Happy interval programming...
Installation
The easier way to install this library is to useOPAM:
opam install interval
interval
is a meta-package that will install all packages mentioned above.
If you cloned this repository, first installdune and typemake
in the main directory. This will compile the libraries, the examples and run basic tests. You can compile the examples with The programs of the examples will be in_build/default/examples/
.
Documentation
To documentation is build usingdune build @doc
and will be in_build/default/_doc/
in HTML format. You can also consult the interfaces of
oronline. It is extremely wise to read the whole documentation, even if you intend to only use theInterval_intel
module.
Some examples are available in theexamples/
directory. There is aB_AND_B
sub-directory with an example of a branch-and-bound algorithm that uses interval arithmetics for function optimization (the example is for the Griewank function, but you can substitute any function you like).
Tests
Tests are available in thetests/
directory. They are mainly for debugging purpose and quite complicated. You may run them (make tests
) to check that everything is working properly for your machine. Thetest
program runs also a speed test for your particular architecture.
Bug reports should be open at https://github.com/Chris00/ocaml-interval/issues
Remark: This library was originally published on Jean-Marc Alliotwebsite but was moved to Github with the permission of the authors.
Dependencies (3)
- interval_crlibm
= version
- interval_intel
= version
- interval_base
= version
Dev Dependencies
None
Used by
None
Conflicts
None