boundlab.ops.unary_fn_opt.spline3_ibp#
- boundlab.ops.unary_fn_opt.spline3_ibp(fn, lb, ub, quartic_bound, nintvl=8)[source]#
Bound
fnover the elementwise interval[lb, ub]via cubic Hermite spline interpolation.Each interval is split into
nintvlsubintervals of widthh. On each one,fnis interpolated by the cubic matching the values and derivatives (viatorch.func.jvp) at both endpoints; the exact extrema of that cubic (endpoints and real roots of its derivative) are candidates for the extrema offn. The interpolation error is covered by the two-point Hermite remainderfn(x) - p(x) = fn’’’’(xi) / 4! * (x - x0)^2 * (x - x1)^2,
whose magnitude is at most
M4 * h**4 / 384.quartic_boundsuppliesM4 >= 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 callablequartic_bound) are evaluated undertorch.vmapover the sample axis, so they always receive arrays of exactlylb’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 onfnover[lb, ub](exact for polynomials of degree <= 3 withM4 = 0).