Squared-error scores for finite sign tests #
Approximate values within 1 / (4 * (m + 1)) of their true signs give a score
separated from zero by at least one half. The score is positive exactly when
all m target signs agree with the true signs. The empty family is included.
For weighted signs, a separate score tests equality with the integer fingerprint and
positivity of a qualifying test. Its tolerance is 1 / (4 * (M + 1)) for total weight at
most M, and 1 / 4 for the qualifying test.
Adapted from RootLabelScore and RationalSignMargin in lean-canny at commit
970f28a5ecefc1327402ade16c068aa4b1b2c183. The larger tolerance still gives
the same score margin and permits fewer repetitions of the dyadic product.
The weighted score adapts FingerprintLabelScore at the same commit.
With uniformly accurate approximations, the score is at least one half on agreement and at most minus one half on mismatch. Its sign characterizes agreement.
Subtract four times the squared errors from the integer fingerprint target and the
qualifying target 1. The inputs are the approximate weighted sum and qualifying sign.
With approximations accurate to the total-weight tolerance, the fingerprint score has margin at least one half. It is positive exactly when the weighted integer signs match the target and the qualifying sign is positive.