Docs / nablatensor-ops / com.nablatensor.ops
final class
Smooth
Smoothed indicators: differentiable stand-ins for the discontinuous STEP / GT / 1{a<x<b} that path-dependent payoffs need for barrier monitoring and digital settlement.
Each takes a width in the same units as its argument. The functions are built entirely from the engine's primitive ops, so their adjoint is the exact derivative of the smoothed form (no special-cased reverse rule) and they run unchanged on every backend. As width -> 0 the smoothed value converges to the discontinuous limit; its derivative concentrates into a spike, so a barrier delta computed this way is a genuine (mollified) delta, not a bumped one.
Rule of thumb: width a fraction of a percent of the monitored quantity's scale (e.g. 0.01 * spot). Too small re-introduces the variance a discontinuity brings; too large biases the price.
Methods
Logistic step: ~1 for x >> 0, ~0 for x << 0, 0.5 at 0.
Smoothed 1{a > b}.
Smoothed 1{a > level}.
Smoothed 1{a < level}.
Smoothed 1{a < b}.
Smoothed band indicator 1{lo < x < hi}.
Numerically stable softplus: a smoothed max(x, 0). width -> 0 recovers the hockey-stick; useful for a smoothed option intrinsic when the whole payoff must stay differentiable.