Description
contribution = abs(first-second)*weight.
Weighted coordinate distances depend on whether weights multiply absolute differences or squared differences. Zero weights can make different vectors equivalent, and derivatives at a zero distance or absolute-value corner need explicit treatment.
contribution = abs(first-second)*weight.
When to use this tool
Use Weighted Absolute Gap Term when checking one weighted-axis contribution, support rule or derivative.
How to use the tool and how it works
- Enter first, second, weight. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read contribution. Use the output convention below.
Require nonnegative weight. contribution = abs(first-second)*weight.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| first | First | Required. Finite number. |
| second | Second | Required. Finite number. |
| weight | Weight | Required. Finite number; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| contribution | This operation’s local contribution, to be combined only under the same larger-model convention. | Required. Finite number. |
{
"input": {
"first": 2,
"second": 5,
"weight": 0.5
},
"output": {
"contribution": 1.5
}
} Limitations and assumptions
- This is one weighted absolute-difference term on matching coordinate units, not the sum over all axes. Zero weight discards that axis under the supplied convention.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a complete distance implementation with an explicit weighting and missing-coordinate convention for vector comparison and optimization.
References
Similar or alternative tools
- Weighted Distance Zero Support
positiveSupport counts comparable positive-weight axes; totalWeight sums comparable weights; defined is true when at least one such weight is positive.
- Weighted Distance Zeroaxis Equivalence Flag
equivalent is true when every positive-weight coordinate matches exactly; differingIgnoredAxes lists zero-weight indexes whose values differ.