boundlab.ops.unary_fn_opt#

Certified elementwise function ranges via cubic Hermite splines.

spline3_ibp() bounds an arbitrary differentiable scalar function over a box by interpolating it piecewise with cubics (values and derivatives at the subinterval endpoints) and covering the interpolation error with the two-point Hermite remainder

\[f(x) - p(x) = \frac{f^{(4)}(\xi)}{4!}\,(x - x_0)^2 (x - x_1)^2, \qquad |f - p| \le \frac{M_4\, h^4}{384},\]

where \(M_4\) bounds the fourth derivative. The cubic’s exact extrema (endpoints plus the real roots of its derivative) are closed-form, so the whole bound is differentiable and vectorized — the residual oracle behind the Legendre relaxations. The quartic_bound_* helpers supply \(M_4\) for the standard activations.

Module Attributes

QuarticBoundFn

(lb, ub) -> M4 >= max |f|.

Functions

quartic_bound_exp

Elementwise bound on |exp''''| over [lb, ub].

quartic_bound_reciprocal_pos

Elementwise bound on |reciprocal''''| over [lb, ub]; +inf where the interval is not strictly positive (1/x is unbounded there).

quartic_bound_tanh

Elementwise bound on |tanh''''| over [lb, ub].

spline3_ibp

Bound fn over the elementwise interval [lb, ub] via cubic Hermite spline interpolation.