{
  "capability_id": "math.complex",
  "tool_id": "complex",
  "engine": "complex",
  "calculation_version": "1.1.0",
  "generated_at": "2026-09-19T02:14:29.319Z",
  "engine_build": "2026-09-19",
  "test_count": 18,
  "passed": 18,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 6,
      "passed": 6
    },
    "boundary": {
      "total": 4,
      "passed": 4
    },
    "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/complex-number",
  "api": "https://www.calculatorx.com/api/v1/calc/complex",
  "schema_input": "https://www.calculatorx.com/schemas/math.complex.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.complex.output.json",
  "assumptions": [
    "atan2 argument in degrees",
    "Not a CAS"
  ],
  "limitations": [
    "Not symbolic simplify or complex analysis",
    "Division by 0+0i → DIVISION_BY_ZERO",
    "Integer n only for power/root; not i^i",
    "Argument uses atan2, degrees"
  ],
  "boundary_conditions": [
    "divide by 0+0i → DIVISION_BY_ZERO",
    "unknown mode (including simplify) → INVALID_MODE"
  ],
  "sources": [
    "ISO 80000-2:2019 Quantities and units — Mathematics"
  ],
  "methods": [],
  "fingerprint": "sha256:933db0a6c85a1e68a54041b715593b584d20e12d4a85bc25db3f0509e2896082",
  "tests": [
    {
      "id": "golden-add",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "add",
        "re": 1,
        "im": 2,
        "re2": 3,
        "im2": 4
      },
      "expect": {
        "re": 4,
        "im": 6
      },
      "expectWarning": null,
      "actual": {
        "mode": "add",
        "re": 4,
        "im": 6,
        "r": 7.21110255093,
        "arg_deg": 56.309932474,
        "euler": "7.21110255093 e^{i 56.309932474°}",
        "cis": "7.21110255093 (cos 56.309932474° + i sin 56.309932474°)",
        "formula": "(re₁+re₂) + (im₁+im₂)i"
      },
      "tol": null
    },
    {
      "id": "golden-polar",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "rect_to_polar",
        "re": 3,
        "im": 4
      },
      "expect": {
        "r": 5
      },
      "expectWarning": null,
      "actual": {
        "mode": "rect_to_polar",
        "re": 3,
        "im": 4,
        "r": 5,
        "arg_deg": 53.1301023542,
        "euler": "5 e^{i 53.1301023542°}",
        "cis": "5 (cos 53.1301023542° + i sin 53.1301023542°)",
        "formula": "r = |z|, θ = atan2(im, re)"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-mul-i",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "mul",
        "re": 0,
        "im": 1,
        "re2": 0,
        "im2": 1
      },
      "expect": {
        "re": -1,
        "im": 0
      },
      "expectWarning": null,
      "actual": {
        "mode": "mul",
        "re": -1,
        "im": 0,
        "r": 1,
        "arg_deg": 180,
        "euler": "1 e^{i 180°}",
        "cis": "1 (cos 180° + i sin 180°)",
        "formula": "(re₁re₂ − im₁im₂) + (re₁im₂ + im₁re₂)i"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-complex-div0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "div",
        "re": 1,
        "im": 0,
        "re2": 0,
        "im2": 0
      },
      "expectError": "DIVISION_BY_ZERO",
      "code": "DIVISION_BY_ZERO",
      "error": "Cannot divide by 0+0i."
    },
    {
      "id": "boundary-complex-mode",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "simplify",
        "re": 1,
        "im": 0
      },
      "expectError": "INVALID_MODE",
      "code": "INVALID_MODE",
      "error": "mode must be add, sub, mul, div, rect_to_polar, polar_to_rect, conjugate, modulus, power, root, or euler."
    },
    {
      "id": "golden-i-squared",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "power",
        "re": 0,
        "im": 1,
        "n": 2
      },
      "expect": {
        "re": -1,
        "im": 0
      },
      "expectWarning": null,
      "actual": {
        "mode": "power",
        "n": 2,
        "re": -1,
        "im": 0,
        "r": 1,
        "arg_deg": 180,
        "euler": "1 e^{i 180°}",
        "cis": "1 (cos 180° + i sin 180°)",
        "formula": "z^n = r^n (cos(nθ) + i sin(nθ))"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-cube-roots-unity",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "root",
        "re": 1,
        "im": 0,
        "n": 3
      },
      "expect": {
        "n_roots": 3,
        "re": 1
      },
      "expectWarning": null,
      "actual": {
        "mode": "root",
        "n": 3,
        "k": 0,
        "re": 1,
        "im": 0,
        "r": 1,
        "arg_deg": 0,
        "euler": "1 e^{i 0°}",
        "cis": "1 (cos 0° + i sin 0°)",
        "roots": [
          {
            "k": 0,
            "re": 1,
            "im": 0,
            "r": 1,
            "arg_deg": 0,
            "euler": "1 e^{i 0°}",
            "cis": "1 (cos 0° + i sin 0°)"
          },
          {
            "k": 1,
            "re": -0.5,
            "im": 0.866025403784,
            "r": 1,
            "arg_deg": 120,
            "euler": "1 e^{i 120°}",
            "cis": "1 (cos 120° + i sin 120°)"
          },
          {
            "k": 2,
            "re": -0.5,
            "im": -0.866025403784,
            "r": 1,
            "arg_deg": -120,
            "euler": "1 e^{i -120°}",
            "cis": "1 (cos -120° + i sin -120°)"
          }
        ],
        "n_roots": 3,
        "formula": "z^{1/n} = r^{1/n} cis((θ + 360° k)/n), k = 0…n−1"
      },
      "tol": 1e-12
    },
    {
      "id": "golden-euler-identity",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "mode": "euler",
        "from": "polar",
        "r": 1,
        "arg_deg": 180
      },
      "expect": {
        "re": -1,
        "im": 0
      },
      "expectWarning": null,
      "actual": {
        "mode": "euler",
        "re": -1,
        "im": 0,
        "r": 1,
        "arg_deg": 180,
        "euler": "1 e^{i 180°}",
        "cis": "1 (cos 180° + i sin 180°)",
        "formula": "z = r e^{iθ} = r (cos θ + i sin θ)"
      },
      "tol": 1e-12
    },
    {
      "id": "boundary-complex-zero-pow0",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "power",
        "re": 0,
        "im": 0,
        "n": 0
      },
      "expectError": "INVALID_INPUT",
      "code": "INVALID_INPUT",
      "error": "0^0 is undefined."
    },
    {
      "id": "boundary-complex-root-n1",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "mode": "root",
        "re": 1,
        "im": 0,
        "n": 1
      },
      "expectError": "VALUE_MUST_BE_POSITIVE",
      "code": "VALUE_MUST_BE_POSITIVE",
      "error": "n must be an integer ≥ 2."
    },
    {
      "id": "property-cx-add",
      "ok": true,
      "kind": "property",
      "detail": "sum",
      "expect": "4+6i",
      "actual": "4+6i"
    },
    {
      "id": "property-cx-i2",
      "ok": true,
      "kind": "property",
      "detail": "i²=-1",
      "expect": -1,
      "actual": -1
    },
    {
      "id": "property-cx-mod",
      "ok": true,
      "kind": "property",
      "detail": "|3+4i|=5",
      "expect": 5,
      "actual": 5
    },
    {
      "id": "property-cx-roundtrip",
      "ok": true,
      "kind": "property",
      "detail": "polar round-trip",
      "expect": 3,
      "actual": 3
    },
    {
      "id": "property-cx-conj",
      "ok": true,
      "kind": "property",
      "detail": "conjugate",
      "expect": -5,
      "actual": -5
    },
    {
      "id": "property-cx-i2-power",
      "ok": true,
      "kind": "property",
      "detail": "power i²",
      "expect": -1,
      "actual": -1
    },
    {
      "id": "property-cx-roots3",
      "ok": true,
      "kind": "property",
      "detail": "cube roots of 1",
      "expect": 3,
      "actual": 3
    },
    {
      "id": "property-cx-euler",
      "ok": true,
      "kind": "property",
      "detail": "e^{iπ}=-1",
      "expect": -1,
      "actual": -1
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 18,
      "total": 18,
      "golden": 6,
      "boundary": 4,
      "property": 8
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-19T01:23:52.320Z",
  "rendered_at": "2026-09-19T02:14:29.319Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.1.0",
    "artifacts": {
      "engine": "1.1.0",
      "page": "1.1.0",
      "capability": "1.1.0",
      "evidence": "1.1.0",
      "input_schema": "1.1.0",
      "output_schema": "1.1.0",
      "mcp_contract": "1.1.0"
    },
    "digests": {
      "input_schema_sha256": "9e89cd81a307dbc4761ec4a28c1ba4ee64806b285173cebcc467c2200b0b2c7b",
      "output_schema_sha256": "1dc06d14d1da7351eb9d111c65babe633cc9932dea8fa623c3e97a86e67cf623",
      "evidence_sha256": "efff89caa9f98041fd632c01eed295fc60ca0d678bb3ae929fce96e7603f9ae3",
      "evidence_core_sha256": "efff89caa9f98041fd632c01eed295fc60ca0d678bb3ae929fce96e7603f9ae3",
      "capability_sha256": "09b35ea41ba2f3628c7e901709c3b874be2957427e5936fafbb4bcf2427e5f9e",
      "engine_sha256": "e2db0a7325e87d733eee5491a146d870677fe7b2ccb5d15ba36a8b5afbb17247",
      "mcp_contract_sha256": "312c860acede70764ad49c5e6180292fe8086ed8874884b9239465a80766d858"
    },
    "contract_checks": {
      "total": 3,
      "passed": 3,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.1.0"
        },
        {
          "id": "schema-valid-input-executes",
          "status": "pass"
        },
        {
          "id": "engine-success-output-validates-schema",
          "status": "pass"
        }
      ]
    },
    "report": "https://www.calculatorx.com/.well-known/calculatorx-release-integrity.json"
  }
}
