Description
For weight*abs(difference), return lower = upper = -weight when difference < 0, +weight when positive, and the interval [-weight,+weight] at zero.
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.
For weight*abs(difference), return lower = upper = -weight when difference < 0, +weight when positive, and the interval [-weight,+weight] at zero.
When to use this tool
Use Weighted Manhattan Axis Subgradient when checking one weighted-axis contribution, support rule or derivative.
How to use the tool and how it works
- Enter difference, weight. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read lower, upper. Use the output convention below.
Require nonnegative weight. For weight*abs(difference), return lower = upper = -weight when difference < 0, +weight when positive, and the interval [-weight,+weight] at zero.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| difference | Difference | Required. Finite number. |
| weight | Weight | Required. Finite number; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| lower | Lower endpoint of the absolute-value axis subgradient. | Required. Finite number. |
| upper | Upper endpoint of that subgradient; endpoints differ at zero. | Required. Finite number. |
{
"input": {
"difference": 0,
"weight": 3
},
"output": {
"lower": -3,
"upper": 3
}
} Limitations and assumptions
- This is one axis's subgradient with respect to its difference coordinate, not a full vector distance or optimizer. At zero the derivative is set-valued.
- 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 Euclidean One Axis Gradient
Return one axis gradient of a supplied positively supported weighted Euclidean distance.
- Weighted Interval Gap Tool
Calculate weighted interval gap from explicit caller-supplied inputs.