Guth
NewsDocs
Page actions
View as Markdown ↗
Explore MCP tools ↗

instrument implementation / implementation-contract

Derivative Calculator (symbolic + numeric) implementation

A source-bound implementation contract for Derivative Calculator (symbolic + numeric); deployment and executable qualification remain separate.

Status: VERIFIED_WITH_ERRATALifecycle: implementation-contract

Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

Record owner
Guth Instruments
Lifecycle
verified-with-binding-errata
Evidence ID
t8-020
Effect
Computation or source lookup only

Input and validation requirements

The numeric path accepts h=0 unless it explicitly validates the step size; the central-difference formula then evaluates 0/0. The branch-switch probe also exposes a semantic hazard: abs(x) at x=0 yields a finite central estimate even though the true derivative is undefined.

Required corrections

[
  {
    "vector": 1,
    "field": "spot_checks[0] (at x=0)",
    "wrong": "input_side=-0.9999999999",
    "correct": "-1.9999999999 (matches answer_side=-2.0 to 10 decimals)",
    "cause": "the numeric finite-difference at x=0 is off by almost exactly a factor of 2 from the correct derivative — consistent with dividing by h instead of 2h in the central-difference formula; the SAME vector's x=1 spot-check is computed correctly, so the error is local to this one point, not the whole method"
  }
]

Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

{
  "inputs": {
    "function": "x^3-2*x+1",
    "variable": "x",
    "point": 2,
    "order": 1,
    "h": 0.00001
  },
  "expected_outputs": {
    "symbolic_derivative": "3*x^2-2",
    "numeric_value": 10.0000000001,
    "spot_checks": [
      {
        "at": 0,
        "input_side": -0.9999999999,
        "answer_side": -2
      },
      {
        "at": 1,
        "input_side": 1.0000000001,
        "answer_side": 1
      }
    ]
  },
  "reference_data": {
    "method": "First-order central difference",
    "h": 0.00001
  },
  "working": "Symbolic: d(x^3-2x+1)/dx = 3x^2-2; at x=2, 3(2^2)-2 = 12-2 = 10. Numeric: f(2.00001) = 2.00001^3 - 2(2.00001) + 1; f(1.99999) = 1.99999^3 - 2(1.99999) + 1. Their difference divided by 2(0.00001) simplifies exactly for this cubic to 3(2^2)-2+(0.00001)^2 = 10+0.0000000001 = 10.0000000001. At x=0, central result = -2+0.0000000001 = -1.9999999999? Correction: for f=x^3-2x+1, the central derivative is 3x^2-2+h^2. Thus at x=0 it is -1.9999999999, and at x=1 it is 1.0000000001. At x=2 it is 10.0000000001."
}

Other records

Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

  • VERIFIED_LEDGER.json
  • evidence-tranche8/tranche8-results.json
  • tranche errata record