1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Interval arithmetic (validated numerics) for rigorous scientific computing.
//!
//! This module provides *validated numerics* — a technique where every
//! floating-point computation produces an *interval* that is guaranteed to
//! contain the mathematically exact result. It is the foundation for
//! *verified computing*, where software proofs replace error-prone manual
//! analysis.
//!
//! # Submodules
//!
//! | Module | Contents |
//! |--------|----------|
//! | [`interval`] | Core `Interval<T>` type and all arithmetic ops |
//! | [`vector`] | `IntervalVector`, `IntervalMatrix`, and verified linear solving |
//! | [`functions`] | Verified elementary functions and Taylor models |
//!
//! # Quick start
//!
//! ```rust,ignore
//! use scirs2_core::interval::{Interval, IntervalVector, IntervalMatrix};
//! use scirs2_core::interval::functions::{verified_exp, enclose_polynomial};
//!
//! // Arithmetic with outward rounding
//! let a = Interval::new(1.0_f64, 2.0);
//! let b = Interval::new(3.0_f64, 4.0);
//! let c = a + b;
//! assert!(c.contains(5.5)); // 1.5 + 3.5 = 5 — must be enclosed
//!
//! // Elementary functions
//! let e_interval = verified_exp(Interval::new(0.0, 1.0)).expect("should succeed");
//! assert!(e_interval.contains(std::f64::consts::E));
//!
//! // Polynomial range
//! // p(x) = x^2 on [-1, 2]
//! let range = enclose_polynomial(&[0.0, 0.0, 1.0], Interval::new(-1.0, 2.0)).expect("should succeed");
//! assert!(range.lo <= 0.0 && range.hi >= 4.0);
//! ```
//!
//! # Outward rounding
//!
//! Stable Rust does not expose IEEE-754 directed rounding modes. We instead
//! implement outward rounding conservatively by adjusting each result by one
//! ULP (unit in the last place) after the computation:
//!
//! * Lower bound decremented by one ULP (moves toward −∞).
//! * Upper bound incremented by one ULP (moves toward +∞).
//!
//! This guarantees containment at the cost of intervals that are slightly wider
//! than necessary. The widening per operation is exactly one ULP, so for
//! reasonably short computations the final interval width is still very tight.
//!
//! # References
//!
//! * Moore, R. E. (1966). *Interval Analysis*. Prentice-Hall.
//! * Neumaier, A. (1990). *Interval Methods for Systems of Equations*.
//! Cambridge University Press.
//! * Rump, S. M. (1999). INTLAB — INTerval LABoratory. In T. Csendes (Ed.),
//! *Developments in Reliable Computing*, pp. 77–104. Kluwer Academic.
// Re-export submodules
// Convenience re-exports at the `interval` crate level
pub use ;
pub use ;
pub use ;