Skip to content
Jordan08Public
forked from goualard-f/GAOL

About

GAOL is not Just Another Interval Arithmetic Library

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

2,637 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GAOL

Not Just Another Interval Library

Linux macOS Windows Linux containers Autotools and meson Manual

GAOL is a C++ Interval Arithmetic library that strives to offer fast and reliable operators for constraint solvers.

Authors

GAOL v5 was written by Jordan Ninin, Associate Professor in Computer Science at ENSTA (Lab-STICC, UMR CNRS 6285), who has been its main developer since 2026. Its page is the repository Jordan08/GAOL, and lists his publications on webperso.ensta.fr/ninin.

GAOL v5 continues GAOL v4 as Frédéric Goualard developed it, from its version 4.2.2 (see What differs from GAOL).

GAOL was written by Frédéric Goualard, Associate Professor in Computing Science at Nantes Université (LS2N, UMR CNRS 6004), who has been its main developer since 2001. Its page is the GAOL section of Frédéric Goualard's site, and its original repository is goualard-f/GAOL. His publications, those related to GAOL among them, are in the full list of his site.

GAOL v5

GAOL v5, this version of GAOL, adds a CMake build, tests of the bounds GAOL computes, and the changes GAOL needs to compile and compute right on every system it can: Linux, macOS and Windows, on x86, x86_64, ARM, arm64 and the other processors of Debian. It was written for Codac and IBEX, whose intervals are built upon GAOL. The autotools and meson builds of GAOL are kept, and the three builds configure GAOL the same way (see The three builds).

GAOL v5 follows IEEE 1788-2015, the standard for interval arithmetic, in the operations GAOL provides: the empty set, infinite bounds, the domains of the functions, the comparisons, the interval literals, and the accuracy of each operation, which Accuracy of the operations documents.

Quick start

git clone https://github.com/Jordan08/GAOL.git
cd GAOL && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=<prefix> -DWITH_TESTS=ON ..
make
make test
make install

CMake 3.14 is enough to build GAOL. With another generator than make (Visual Studio, Xcode, Ninja), cmake --build . --config Release, ctest -C Release and cmake --build . --config Release --target install replace the three make commands.

To see the configuration options, see Build GAOL.

Each build compiles the sources of CORE-MATH, the mathematical library GAOL computes its elementary functions with (3rd/math-core, see 3rd/README.md), into libgaol itself: there is no mathematical library to install or to link along with GAOL. A CMake project then uses the installed GAOL with:

find_package(gaol REQUIRED)
target_link_libraries(my_target PRIVATE gaol::gaol)

gaol::gaol, and gaol.pc for pkg-config, carry the flags of interval arithmetic that the code including GAOL's headers has to be compiled with. A project can also build GAOL for itself, with FetchContent (see Using GAOL), or as a meson subproject (see Using GAOL).

A program calls gaol::cleanup() right after its last use of GAOL: GAOL's initialization, which runs by itself before main(), sets the rounding direction upward for the whole program (unless GAOL is built with GAOL_PRESERVE_ROUNDING), and gaol::cleanup() sets back the one the program started with (see Using GAOL).

A first program

Once GAOL is installed, this program encloses the values of x (1 − x) for x in [0.4, 0.6] (examples/tutorial.md goes on from it):

#include <iostream>
#include <gaol/gaol.h>
using namespace gaol;

int main()
{
  const interval x (0.4, 0.6);              // the interval [0.4, 0.6]
  std::cout << x * (1.0 - x) << '\n';       // [0.16, 0.36]
  std::cout << 0.25 - sqr(x - 0.5) << '\n'; // [0.2399999999999999, 0.25]
  gaol::cleanup();                          // right after the last use of GAOL
}
c++ -std=c++11 -O2 $(pkg-config --cflags gaol) first.cpp -o first $(pkg-config --libs gaol)

Each value printed is an interval that contains the exact one, whatever the rounding direction the program is in. The first, x written twice, is 20 times wider than the range of the function, [0.24, 0.25], because each occurrence of x ranges over [0.4, 0.6] on its own (the dependency problem); the second, the same function with x written once, encloses the range itself. The bounds are written rounded outward, so that the text encloses the interval: [0.2399999999999999, 0.25] encloses [0.24, 0.25]. The tutorial writes four algorithms of interval computing with GAOL: the range of a function by subdivision, the interval Newton method, a contractor and a branch and bound; the sixteen programs of examples/, which check what they print, go further, and Using GAOL gives the pitfalls and the names of IBEX, Codac, C-XSC and Boost.Interval next to GAOL's.

Two namespaces: gaol and gaol_ieee1788

A program uses GAOL v5 through one of two namespaces, which hold the same interval and compute with the same functions:

  • gaol, GAOL under its own names, to stay compatible with GAOL 4: a program written for GAOL 4, or for IBEX and Codac, keeps most of its names and, but for the results that change, its results (What differs from GAOL gives the names that are gone and the results that change);
  • gaol_ieee1788, GAOL under the names of IEEE 1788-2015 (numsToInterval, mulRev, sinPi, pown...), to follow the standard.

The main difference between the two is the power. The pow of gaol_ieee1788 is the real power of the standard, e^(y log x), defined for x > 0 only (and x = 0 when y > 0), and its pown(x, n) the integer power; the pow of gaol is GAOL's, which takes the integer power for an integer exponent, a negative base included, and the real power otherwise: pow([-4, -1], 2) is [1, 16] in gaol and the empty set in gaol_ieee1788, where pown([-4, -1], 2) is [1, 16]. The other few cases where gaol differs from the standard are listed in the special cases, and Using GAOL gives the powers of both namespaces side by side.

#include <gaol/gaol.h>

gaol::interval x(-4, -1);
gaol::interval a = gaol::pow(x, 2);           // [1, 16]
gaol::interval b = gaol_ieee1788::pow(x, 2);  // the empty set
gaol::interval c = gaol_ieee1788::pown(x, 2); // [1, 16]

Documentation

  • A short tutorial: four algorithms of interval computing written with GAOL, and the examples they come from: sixteen programs that use intervals as IBEX, Codac, C-XSC and the textbooks do, a review of how intervals are used with GAOL v5, and a comparison with other libraries.
  • Building GAOL: the CMake, autotools and meson builds, and their options.
  • Using GAOL: the flags of interval arithmetic, GAOL from CMake and from pkg-config, the call of gaol::cleanup() at the end of a program, the rounding direction, the names of other libraries next to GAOL's, and the common errors.
  • The three builds: what CMake, configure and meson agree on, and the compilers and options they refuse.
  • Tests: what the programs of tests/ check, and what they show of GAOL.
  • Accuracy of the operations: the tightness of each operation, from its algorithm, as IEEE 1788-2015 requires it to be documented (12.10.3).
  • SIMD, FMA and the rounding direction: what GAOL computes with vector instructions, where the time of a program goes, and what the other processors offer for a rounding direction carried by the instruction.
  • What differs from GAOL: each change GAOL v5 brings, and where it comes from.
  • Continuous integration: the systems, processors and compilers GAOL is built and tested on.
  • Comparison with libieeep1788, filib++, PROFIL/BIAS, Solaris Studio and Boost.Interval: the special cases of the six libraries against IEEE 1788-2015, the enclosure of the elementary functions of GAOL and Boost.Interval, and their performance, with the scripts to run the comparison again.
  • The manual of GAOL v5: manual/Manual_GAOLv5.pdf, with its LaTeX sources in manual/v5/: the layout in manual_gaolv5.tex, one file per chapter in manual/v5/chapters/. It keeps the text of the manual of GAOL 4 by Frédéric Goualard where GAOL v5 behaves as GAOL 4, takes up the content of the pages of doc/, and describes GAOL v5: the notions it relies on, its installation and use, each operation with examples, the names of IEEE 1788-2015, the accuracy of the operations, how the intervals are computed, the tests, and what a program written for GAOL 4 has to change.
  • The manual of GAOL 4, by Frédéric Goualard: manual/v4/Manual_GAOLv4.pdf, with its LaTeX sources in manual/v4/, kept as it was. It still describes the mathematical libraries and the options of GAOL 4.
  • make -C manual pdf after ./configure, cmake --build <build> --target pdf after cmake -S . -B <build> -DWITH_DOC=ON, or meson compile -C <build> pdf after meson setup <build> -Dwith-doc=true, builds the manual of GAOL v5 again (manual/build-pdf.sh) and writes it in manual/Manual_GAOLv5.pdf. The manual of GAOL 4 is built by none of them.

Licences

GAOL, by Frédéric Goualard and Jordan Ninin, is distributed under the GNU LGPL v2 (COPYING.LIB). CORE-MATH, whose sources are in 3rd/math-core and provide every elementary function of GAOL, is distributed under the MIT licence (3rd/math-core/LICENSE).

The files GAOL v5 adds, which are neither GAOL's nor CORE-MATH's, carry the copyright of ENSTA and are distributed under the same GNU LGPL v2 as GAOL. Most of them say so in a header, in the comment marks of their language:

Copyright (c) 2026 ENSTA, France

By: Jordan NININ (created 2026-09-20)

GAOL is a software distributed WITHOUT ANY WARRANTY. Read the associated
COPYING.LIB file for information.

The header of most C and C++ sources starts with GAOL -- not Just Another Interval Library between two lines of dashes, and a description of the file may come before the three fields. A file of GAOL 4 that GAOL v5 changes and that has a header keeps the copyright lines of its authors above that of ENSTA, and their names in the By: line (By: Frederic Goualard, Jordan NININ). A chapter of the manual of GAOL v5 that follows one of the manual of GAOL 4 without taking text of it names no author but Jordan NININ, and says in its comment that it is based on the manual of GAOL 4. The files of the meson build, by Raphaël Chenouard, name him there too. The files of CORE-MATH keep their own.

About

GAOL is not Just Another Interval Arithmetic Library

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages