{
  "capability_id": "math.polynomial.roots",
  "tool_id": "polynomial-roots",
  "engine": "polynomial-roots",
  "calculation_version": "1.2.0",
  "generated_at": "2026-09-20T09:07:29.787Z",
  "engine_build": "2026-09-19",
  "test_count": 21,
  "passed": 21,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 7,
      "passed": 7
    },
    "boundary": {
      "total": 6,
      "passed": 6
    },
    "property": {
      "total": 8,
      "passed": 8
    }
  },
  "engine_tested": true,
  "expert_reviewed": false,
  "internally_reviewed": false,
  "review_kind": null,
  "source_checked": true,
  "reviewed_by": null,
  "reviewer_role": null,
  "last_reviewed": null,
  "expert_review": {
    "status": "optional_not_performed",
    "reviewer": null,
    "scope": [
      "formula",
      "input semantics",
      "assumptions",
      "limitations",
      "sources",
      "tests"
    ],
    "note": "Domain expert review is optional under CVP (CVP-EXP-01). Absence does not block CVP Verified. See Review policy for supplemental domain assurance."
  },
  "internal_review": {
    "status": "not_applicable",
    "reviewer": null
  },
  "page": "https://www.calculatorx.com/calc/math/polynomial-roots",
  "api": "https://www.calculatorx.com/api/v1/calc/polynomial-roots",
  "schema_input": "https://www.calculatorx.com/schemas/math.polynomial.roots.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.polynomial.roots.output.json",
  "assumptions": [
    "Real coefficients",
    "Leading coefficient nonzero",
    "Degree ≤ 8",
    "Not a second quadratic page",
    "Not Ferrari quartic",
    "Not CAS factoring"
  ],
  "limitations": [
    "Not /calc/math/quadratic (discriminant / vertex / parabola)",
    "Not Ferrari quartic closed form",
    "Not a single numerical root",
    "Not symbolic CAS factoring",
    "Not polynomial expansion",
    "Degree ≤ 8",
    "Leading coefficient must be nonzero",
    "method=evaluate requires x"
  ],
  "boundary_conditions": [
    "degree 0 or one coefficient → INVALID_INPUT",
    "leading coefficient 0 → INVALID_INPUT",
    "degree > 8 → VALUE_OUT_OF_RANGE",
    "method quadratic / cas / ferrari / newton / eigen / factor → INVALID_MODE"
  ],
  "sources": [
    "ISO 80000-2:2019 Quantities and units — Mathematics"
  ],
  "methods": [],
  "fingerprint": "sha256:40fcf2aa9a7d68d99caf6407235c97f4a3bf06a25d0b47bd7f9698f17195006c",
  "tests": [
    {
      "id": "golden-linear",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "coeffs": [
          -2,
          2
        ]
      },
      "expect": {
        "degree": 1,
        "n": 1,
        "solver": "linear"
      },
      "expectWarning": null,
      "actual": {
        "method": "all_roots",
        "solver": "linear",
        "degree": 1,
        "n": 1,
        "coeffs": [
          -2,
          2
        ],
        "roots": [
          {
            "re": 1,
            "im": 0,
            "kind": "real"
          }
        ],
        "residual_max": 0,
        "polynomial": "2x − 2",
        "formula": "x = −c0/c1"
      },
      "tol": null
    },
    {
      "id": "golden-quadratic",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "coeffs": [
          8,
          -6,
          1
        ]
      },
      "expect": {
        "degree": 2,
        "n": 2,
        "solver": "quadratic"
      },
      "expectWarning": null,
      "actual": {
        "method": "all_roots",
        "solver": "quadratic",
        "degree": 2,
        "n": 2,
        "coeffs": [
          8,
          -6,
          1
        ],
        "roots": [
          {
            "re": 2,
            "im": 0,
            "kind": "real"
          },
          {
            "re": 4,
            "im": 0,
            "kind": "real"
          }
        ],
        "residual_max": 0,
        "polynomial": "x² − 6x + 8",
        "formula": "x = (−b ± √(b² − 4ac)) / (2a)"
      },
      "tol": null
    },
    {
      "id": "golden-cubic-123",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "coeffs": [
          -6,
          11,
          -6,
          1
        ]
      },
      "expect": {
        "degree": 3,
        "n": 3,
        "solver": "cardano",
        "cubic_case": "three_real"
      },
      "expectWarning": null,
      "actual": {
        "method": "all_roots",
        "solver": "cardano",
        "degree": 3,
        "n": 3,
        "coeffs": [
          -6,
          11,
          -6,
          1
        ],
        "roots": [
          {
            "re": 1,
            "im": 0,
            "kind": "real"
          },
          {
            "re": 2,
            "im": 0,
            "kind": "real"
          },
          {
            "re": 3,
            "im": 0,
            "kind": "real"
          }
        ],
        "residual_max": 0,
        "polynomial": "x³ − 6x² + 11x − 6",
        "cubic_case": "three_real",
        "delta": -0.037037037037,
        "formula": "t_k = 2√(−p/3) cos(θ/3 − 2πk/3)"
      },
      "tol": null
    },
    {
      "id": "golden-cardano-abcd",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "method": "cardano",
        "a": 1,
        "b": -6,
        "c": 11,
        "d": -6
      },
      "expect": {
        "degree": 3,
        "n": 3,
        "solver": "cardano",
        "cubic_case": "three_real"
      },
      "expectWarning": null,
      "actual": {
        "method": "cardano",
        "solver": "cardano",
        "degree": 3,
        "n": 3,
        "coeffs": [
          -6,
          11,
          -6,
          1
        ],
        "roots": [
          {
            "re": 1,
            "im": 0,
            "kind": "real"
          },
          {
            "re": 2,
            "im": 0,
            "kind": "real"
          },
          {
            "re": 3,
            "im": 0,
            "kind": "real"
          }
        ],
        "residual_max": 0,
        "polynomial": "x³ − 6x² + 11x − 6",
        "cubic_case": "three_real",
        "delta": -0.037037037037,
        "formula": "t_k = 2√(−p/3) cos(θ/3 − 2πk/3)"
      },
      "tol": null
    },
    {
      "id": "golden-cardano-one-real",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "method": "cardano",
        "coeffs": [
          -1,
          0,
          0,
          1
        ]
      },
      "expect": {
        "degree": 3,
        "n": 3,
        "solver": "cardano",
        "cubic_case": "one_real"
      },
      "expectWarning": null,
      "actual": {
        "method": "cardano",
        "solver": "cardano",
        "degree": 3,
        "n": 3,
        "coeffs": [
          -1,
          0,
          0,
          1
        ],
        "roots": [
          {
            "re": -0.5,
            "im": -0.866025403784,
            "kind": "complex"
          },
          {
            "re": -0.5,
            "im": 0.866025403784,
            "kind": "complex"
          },
          {
            "re": 1,
            "im": 0,
            "kind": "real"
          }
        ],
        "residual_max": 1.31607134029e-12,
        "polynomial": "x³ − 1",
        "cubic_case": "one_real",
        "delta": 0.25,
        "formula": "t = u + v (Cardano)"
      },
      "tol": null
    },
    {
      "id": "boundary-leading-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "coeffs": [
          1,
          0
        ]
      },
      "expectError": "INVALID_INPUT",
      "code": "INVALID_INPUT",
      "error": "Leading coefficient must be nonzero."
    },
    {
      "id": "boundary-degree-zero",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "coeffs": [
          5
        ]
      },
      "expectError": "INVALID_INPUT",
      "code": "INVALID_INPUT",
      "error": "Need at least two coefficients (degree ≥ 1)."
    },
    {
      "id": "boundary-quadratic-method",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "method": "quadratic",
        "coeffs": [
          8,
          -6,
          1
        ]
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "method must be all_roots, cardano, or evaluate. Not CAS, not factoring, not a second quadratic page, not Ferrari, not a single Newton root."
    },
    {
      "id": "boundary-cas",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "method": "cas",
        "coeffs": [
          -6,
          11,
          -6,
          1
        ]
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "method must be all_roots, cardano, or evaluate. Not CAS, not factoring, not a second quadratic page, not Ferrari, not a single Newton root."
    },
    {
      "id": "golden-horner-17",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "method": "evaluate",
        "coeffs": [
          1,
          2,
          3
        ],
        "x": 2
      },
      "expect": {
        "solver": "horner",
        "value": 17,
        "n_mul": 2
      },
      "expectWarning": null,
      "actual": {
        "method": "evaluate",
        "solver": "horner",
        "degree": 2,
        "coeffs": [
          1,
          2,
          3
        ],
        "x": 2,
        "value": 17,
        "n_mul": 2,
        "polynomial": "3x² + 2x + 1",
        "formula": "p(x) = ((cₙ x + cₙ₋₁) x + … ) x + c₀"
      },
      "tol": null
    },
    {
      "id": "golden-horner-root",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "method": "horner",
        "coeffs": [
          -6,
          11,
          -6,
          1
        ],
        "x": 2
      },
      "expect": {
        "solver": "horner",
        "value": 0
      },
      "expectWarning": null,
      "actual": {
        "method": "evaluate",
        "solver": "horner",
        "degree": 3,
        "coeffs": [
          -6,
          11,
          -6,
          1
        ],
        "x": 2,
        "value": 0,
        "n_mul": 3,
        "polynomial": "x³ − 6x² + 11x − 6",
        "formula": "p(x) = ((cₙ x + cₙ₋₁) x + … ) x + c₀"
      },
      "tol": null
    },
    {
      "id": "boundary-evaluate-missing-x",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "method": "evaluate",
        "coeffs": [
          1,
          2,
          3
        ]
      },
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "Enter x."
    },
    {
      "id": "boundary-factor",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "method": "factor",
        "coeffs": [
          1,
          2,
          3
        ],
        "x": 2
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "method must be all_roots, cardano, or evaluate. Not CAS, not factoring, not a second quadratic page, not Ferrari, not a single Newton root."
    },
    {
      "id": "property-poly-linear",
      "ok": true,
      "kind": "property",
      "detail": "2x−2=0 → 1",
      "expect": 1,
      "actual": 1
    },
    {
      "id": "property-poly-quadratic",
      "ok": true,
      "kind": "property",
      "detail": "x²−6x+8",
      "expect": "2,4",
      "actual": "2,4"
    },
    {
      "id": "property-poly-cubic",
      "ok": true,
      "kind": "property",
      "detail": "(x−1)(x−2)(x−3)",
      "expect": "1,2,3",
      "actual": "1,2,3"
    },
    {
      "id": "property-poly-i",
      "ok": true,
      "kind": "property",
      "detail": "x²+1 → ±i",
      "expect": "±i",
      "actual": "[{\"re\":0,\"im\":-1,\"kind\":\"complex\"},{\"re\":0,\"im\":1,\"kind\":\"complex\"}]"
    },
    {
      "id": "property-poly-vieta",
      "ok": true,
      "kind": "property",
      "detail": "Vieta sum",
      "expect": 6,
      "actual": 6
    },
    {
      "id": "property-poly-cardano",
      "ok": true,
      "kind": "property",
      "detail": "x³−1 Cardano",
      "expect": 1,
      "actual": 1
    },
    {
      "id": "property-poly-horner",
      "ok": true,
      "kind": "property",
      "detail": "1+2x+3x² at 2",
      "expect": 17,
      "actual": 17
    },
    {
      "id": "property-poly-horner-naive",
      "ok": true,
      "kind": "property",
      "detail": "Horner matches monomial sum",
      "expect": 17,
      "actual": 17
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 21,
      "total": 21,
      "golden": 7,
      "boundary": 6,
      "property": 8
    },
    "contract_checks": {
      "passed": 1,
      "total": 1
    }
  },
  "evidence_core_generated_at": "2026-09-19T22:24:04.594Z",
  "rendered_at": "2026-09-20T09:07:29.787Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.2.0",
    "artifacts": {
      "engine": "1.2.0",
      "page": "1.2.0",
      "capability": "1.2.0",
      "evidence": "1.2.0",
      "input_schema": "1.2.0",
      "output_schema": "1.2.0",
      "mcp_contract": "1.2.0"
    },
    "digests": {
      "input_schema_sha256": "65d482d3a36aa5453cecffa17353a93c971964d4c0b7180f151dc0a3a6e6e16e",
      "output_schema_sha256": "3e0d7e31c5d09b7cccfa1770bfb7f726f6233642226cbec5d42011e03ca9f36c",
      "evidence_sha256": "c77fd3135a048e16e140c6a5d5594c723f7ce16eefbf2d85f7c5bcc5649bef95",
      "evidence_core_sha256": "c77fd3135a048e16e140c6a5d5594c723f7ce16eefbf2d85f7c5bcc5649bef95",
      "capability_sha256": "aba8ec916113efe0f7fe211f2901e3789d2954cf8adb3f6782817567176b461a",
      "engine_sha256": "43bbc25ec362b3f78daa612fef9a96df34206649b79e753faa7f17441d59b17a",
      "mcp_contract_sha256": "bf0dcfcfd80680efd201a229fab7f7a80ba9abbff3bea07815672d1d5cb2435a"
    },
    "contract_checks": {
      "total": 1,
      "passed": 1,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.2.0"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
