PyInterval is a Python library for Interval Arithmetic, designed to handle numerical uncertainty by treating numbers as bounds
The package was developed as an exercise on solving problems in global optimization and uncertainty quantification.
Despite its age, the core logic demonstrates several advanced concepts relevant to quantitative development:
Directed Rounding: Uses ctypes to interface with the C standard math library (libm), manually controlling hardware rounding modes (Up/Down) to ensure strict containment of results.
Operator Overloading: Implements custom arithmetic behaviors for Interval and Box classes.
Automatic Differentiation: Includes a forward-mode AD implementation for calculating exact derivatives.
This code was written for an older Python environment.
Rounding: The hardware rounding controls are specific to macOS (darwin).
Division: Uses legacy __div__ operator overloading.