boundlab.zono.linearizers.Reciprocal#

class boundlab.zono.linearizers.Reciprocal[source]#

Bases: OpHandler

Tangent-line enclosure of \(1/x\) on positive intervals.

A tangent at \(t\) has slope \(-1/t^2\) and, by convexity, lower bounds \(1/x\) after its own offset; the geometric mean \(t = \sqrt{lu}\) equalizes the gap at both endpoints (the classical minimal-\(\beta\) choice), guarded by \(t \ge u/2 + 0.01\) against collapse. The upper offset is the endpoint maximum of \(1/x - \lambda x\); centering the two offsets gives \(\mu, \beta\). Degenerate (point) intervals return the exact value.

Methods

__init__

apply_bound

condition

Whether this handler applies to these operands (default: always).

handle

Transform the operands; sub-operations go through interp.<op> so the enclosing domain's handlers apply to them too.

override_handler

A copy of this handler that takes precedence over other when both are ready for the same call.

__call__(l, u, x=None)#

Call self as a function.

__init__(op='reciprocal', apply_bound=<function linearizer_fn.<locals>.decorator.<locals>.LinearizerHandler.<lambda>>)#
apply_bound(x)#
condition(x, **kwargs)#

Whether this handler applies to these operands (default: always).

handle(interp, x, **kwargs)#

Transform the operands; sub-operations go through interp.<op> so the enclosing domain’s handlers apply to them too.

op: str = 'reciprocal'#
override_handler(other)#

A copy of this handler that takes precedence over other when both are ready for the same call.

overrides: list[type[OpHandler]] = []#