boundlab.ops.unary_fn_opt.spline3_ibp#

boundlab.ops.unary_fn_opt.spline3_ibp(fn, lb, ub, quartic_bound, nintvl=8)[source]#

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

Each interval is split into nintvl subintervals of width h. On each one, fn is interpolated by the cubic matching the values and derivatives (via torch.func.jvp) at both endpoints; the exact extrema of that cubic (endpoints and real roots of its derivative) are candidates for the extrema of fn. The interpolation error is covered by the two-point Hermite remainder

fn(x) - p(x) = fn’’’’(xi) / 4! * (x - x0)^2 * (x - x1)^2,

whose magnitude is at most M4 * h**4 / 384. quartic_bound supplies M4 >= max |fn''''|: either an array bounding it over the whole [lb, ub], or a callable evaluated per subinterval at its endpoints, so each subinterval carries its own (tighter) remainder.

fn (and a callable quartic_bound) are evaluated under torch.vmap over the sample axis, so they always receive arrays of exactly lb’s shape and may therefore implement a different scalar function per element (e.g. selected by a mask or per-element parameters of that shape).

Returns sound elementwise (lower, upper) bounds on fn over [lb, ub] (exact for polynomials of degree <= 3 with M4 = 0).