{
  "capability_id": "math.tan",
  "tool_id": "tan",
  "engine": "tan",
  "calculation_version": "1.0.4",
  "generated_at": "2026-09-16T22:03:43.779Z",
  "engine_build": "2026-09-10",
  "test_count": 25,
  "passed": 25,
  "failed": 0,
  "tests_summary": {
    "golden": {
      "total": 15,
      "passed": 15
    },
    "boundary": {
      "total": 10,
      "passed": 10
    },
    "property": {
      "total": 0,
      "passed": 0
    }
  },
  "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/tan",
  "api": "https://www.calculatorx.com/api/v1/calc/tan",
  "schema_input": "https://www.calculatorx.com/schemas/math.tan.input.json",
  "schema_output": "https://www.calculatorx.com/schemas/math.tan.output.json",
  "assumptions": [
    "Real tangent only. Inverse is Arctan, not this published engine.",
    "Documented pole classification: UNDEFINED when distance to 90° + 180°k is < 1e-12°. That threshold is a numerical classification policy, not a claim that those inputs are mathematically exact odd multiples of 90°. |cos(θ)| is not used as a pole test.",
    "If the input is not classified as a pole and distance-to-pole < 0.01°, the engine returns a finite tan(θ) with warnings: [{ code: NEAR_SINGULARITY }]. status remains ok.",
    "Documented common-angle snap: after reducing mod 360°, an input within 1e-12° of a listed common angle (0, ±30, ±45, ±60, …) is replaced by the algebraic value (0, ±1/√3, ±1, ±√3). This is a snap policy, not mathematical exactness. Nearby inputs such as 60.00000005° keep IEEE-754 Math.tan.",
    "Documented cleanup: if no snap applies and |y| < 1e-12, the engine rewrites y to 0. That changes the IEEE-754 result for some non-zero inputs; it is a cleanup policy, not a mathematical identity."
  ],
  "limitations": [
    "Exact poles (90° + 180°k) → UNDEFINED",
    "Within 0.01° of a pole → finite value with warnings NEAR_SINGULARITY",
    "Missing theta → MISSING_REQUIRED_INPUT"
  ],
  "boundary_conditions": [
    "Missing θ returns MISSING_REQUIRED_INPUT. Invalid unit returns INVALID_UNIT. Malformed numbers return INVALID_NUMBER.",
    "tan(0°) = 0; tan(45°) = 1; tan(30°) = 1/√3; tan(60°) = √3; tan(−45°) = −1; tan(180°) = 0; tan(225°) = 1; tan(360°) = 0.",
    "tan(90°), tan(270°), tan(−90°), tan(π/2 rad) return UNDEFINED.",
    "tan(89°) and tan(91°) are large finite values, not UNDEFINED.",
    "Periodicity: tan(θ + 180°) = tan(θ), e.g. tan(405°) = tan(45°) = 1."
  ],
  "sources": [
    {
      "title": "NIST Digital Library of Mathematical Functions, Chapter 4",
      "section": "Elementary Functions",
      "url": "https://dlmf.nist.gov/4",
      "supports": "Tangent as sin/cos with period π and poles where cos = 0",
      "kind": "reference"
    },
    {
      "title": "NIST DLMF §4.14",
      "section": "Trigonometric functions",
      "url": "https://dlmf.nist.gov/4.14",
      "supports": "tan(θ) undefined at odd multiples of π/2; degree input converted via θ° × π/180",
      "kind": "reference"
    },
    {
      "title": "CalculatorX mathematical conventions",
      "section": "Poles are UNDEFINED, not Infinity; inverse is Arctan",
      "supports": "Published engine is forward tan(θ) only. Pole classification, common-angle snap, and |y| cleanup are documented numerical policies, not mathematical exactness. Near-pole values stay finite with NEAR_SINGULARITY.",
      "kind": "definition"
    }
  ],
  "methods": [],
  "fingerprint": "sha256:672b0a252bc3ec1ae680516503c13aaddd3a8e304d3c94d640505752aa2b42cd",
  "tests": [
    {
      "id": "deg-45",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 45,
        "unit": "deg"
      },
      "expect": 1,
      "expectWarning": null,
      "actual": 1,
      "tol": 0
    },
    {
      "id": "deg-30",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 30,
        "unit": "deg"
      },
      "expect": 0.5773502691896257,
      "expectWarning": null,
      "actual": 0.5773502691896258,
      "tol": 1e-12
    },
    {
      "id": "deg-60",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 60,
        "unit": "deg"
      },
      "expect": 1.7320508075688772,
      "expectWarning": null,
      "actual": 1.7320508075688772,
      "tol": 1e-12
    },
    {
      "id": "deg-0",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 0,
        "unit": "deg"
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 0
    },
    {
      "id": "deg-neg-45",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": -45,
        "unit": "deg"
      },
      "expect": -1,
      "expectWarning": null,
      "actual": -1,
      "tol": 0
    },
    {
      "id": "deg-180",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 180,
        "unit": "deg"
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 0
    },
    {
      "id": "deg-225",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 225,
        "unit": "deg"
      },
      "expect": 1,
      "expectWarning": null,
      "actual": 1,
      "tol": 0
    },
    {
      "id": "deg-360",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 360,
        "unit": "deg"
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 0
    },
    {
      "id": "periodicity-405",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 405,
        "unit": "deg"
      },
      "expect": 1,
      "expectWarning": null,
      "actual": 1,
      "tol": 0
    },
    {
      "id": "deg-89-finite",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 89,
        "unit": "deg"
      },
      "expect": 57.289961630759876,
      "expectWarning": null,
      "actual": 57.289961630759876,
      "tol": 1e-12
    },
    {
      "id": "deg-91-finite",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 91,
        "unit": "deg"
      },
      "expect": -57.28996163075955,
      "expectWarning": null,
      "actual": -57.28996163075955,
      "tol": 1e-12
    },
    {
      "id": "deg-90",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 90,
        "unit": "deg"
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "tan(θ) is undefined when cos(θ) = 0 (odd multiples of 90°)."
    },
    {
      "id": "deg-270",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 270,
        "unit": "deg"
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "tan(θ) is undefined when cos(θ) = 0 (odd multiples of 90°)."
    },
    {
      "id": "deg-neg-90",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": -90,
        "unit": "deg"
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "tan(θ) is undefined when cos(θ) = 0 (odd multiples of 90°)."
    },
    {
      "id": "rad-pi-4",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 0.7853981633974483,
        "unit": "rad"
      },
      "expect": 1,
      "expectWarning": null,
      "actual": 1,
      "tol": 0
    },
    {
      "id": "rad-pi-2",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 1.5707963267948966,
        "unit": "rad"
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "tan(θ) is undefined when cos(θ) = 0 (odd multiples of 90°)."
    },
    {
      "id": "rad-neg-pi-4",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": -0.7853981633974483,
        "unit": "rad"
      },
      "expect": -1,
      "expectWarning": null,
      "actual": -1,
      "tol": 0
    },
    {
      "id": "rad-pi",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 3.141592653589793,
        "unit": "rad"
      },
      "expect": 0,
      "expectWarning": null,
      "actual": 0,
      "tol": 1e-12
    },
    {
      "id": "near-pole-89.99999995",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 89.99999995,
        "unit": "deg"
      },
      "expect": 1145915534.482307,
      "expectWarning": "NEAR_SINGULARITY",
      "actual": {
        "value": 1145915534.482307,
        "warnings": [
          {
            "code": "NEAR_SINGULARITY",
            "severity": "warning",
            "detail": "θ is extremely close to an odd multiple of 90°. Small changes in θ cause very large changes in tan(θ).",
            "suggestion": "UNDEFINED is the documented 1e-12° pole classification around 90° + 180°k. This result is a large finite value, not a classified pole."
          }
        ]
      },
      "tol": 1e-9
    },
    {
      "id": "near-pole-90.00000005",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 90.00000005,
        "unit": "deg"
      },
      "expect": -1145915695.2934453,
      "expectWarning": "NEAR_SINGULARITY",
      "actual": {
        "value": -1145915695.2934453,
        "warnings": [
          {
            "code": "NEAR_SINGULARITY",
            "severity": "warning",
            "detail": "θ is extremely close to an odd multiple of 90°. Small changes in θ cause very large changes in tan(θ).",
            "suggestion": "UNDEFINED is the documented 1e-12° pole classification around 90° + 180°k. This result is a large finite value, not a classified pole."
          }
        ]
      },
      "tol": 1e-9
    },
    {
      "id": "no-silent-snap-60.00000005",
      "ok": true,
      "kind": "golden",
      "inputs": {
        "theta": 60.00000005,
        "unit": "deg"
      },
      "expect": 1.7320508110595352,
      "expectWarning": null,
      "actual": 1.7320508110595352,
      "tol": 1e-12
    },
    {
      "id": "missing-theta",
      "ok": true,
      "kind": "boundary",
      "inputs": {},
      "expectError": "MISSING_REQUIRED_INPUT",
      "code": "MISSING_REQUIRED_INPUT",
      "error": "Enter a finite angle θ."
    },
    {
      "id": "theta-abc",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": "abc"
      },
      "expectError": "INVALID_NUMBER",
      "code": "INVALID_NUMBER",
      "error": "Enter a finite number."
    },
    {
      "id": "invalid-unit",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 45,
        "unit": "grad"
      },
      "expectError": "INVALID_UNIT",
      "code": "INVALID_UNIT",
      "error": "unit must be deg or rad."
    },
    {
      "id": "boundary-tan-pole",
      "ok": true,
      "kind": "boundary",
      "inputs": {
        "theta": 90
      },
      "expectError": "UNDEFINED",
      "code": "UNDEFINED",
      "error": "tan(θ) is undefined when cos(θ) = 0 (odd multiples of 90°)."
    }
  ],
  "tier": "engine_tested",
  "verification": {
    "tests": {
      "passed": 25,
      "total": 25,
      "golden": 15,
      "boundary": 10,
      "property": 0
    },
    "contract_checks": {
      "passed": 3,
      "total": 3
    }
  },
  "evidence_core_generated_at": "2026-09-10T22:48:17.762Z",
  "rendered_at": "2026-09-16T22:03:43.779Z",
  "release_integrity": {
    "status": "verified",
    "scope": "workspace",
    "production_attestation_required": true,
    "calculation_version": "1.0.4",
    "artifacts": {
      "engine": "1.0.4",
      "page": "1.0.4",
      "capability": "1.0.4",
      "evidence": "1.0.4",
      "input_schema": "1.0.4",
      "output_schema": "1.0.4",
      "mcp_contract": "1.0.4"
    },
    "digests": {
      "input_schema_sha256": "a145c86bf4295643a515b07cddf823049424a88c3a7fc25e463dfc92773671b6",
      "output_schema_sha256": "c6e4f75fa48f8b655778eb2014eee65632aa82db1d919d28c89fbd08e417449c",
      "evidence_sha256": "53f72a91409597d9673f8724949d14e2c13611e55d3178f2af5e319da56a195d",
      "evidence_core_sha256": "53f72a91409597d9673f8724949d14e2c13611e55d3178f2af5e319da56a195d",
      "capability_sha256": "0a51c4380a87c4a4fd5a3a9caf2c5b705a33363f3fae3f1db0d069bb56f406d9",
      "engine_sha256": "c8d4ccdbfeaf61d7b024d4e1babb0c2ba3b324c1b37bd0cb456a526d8d2b1bd1",
      "mcp_contract_sha256": "863098b311a7b17dc4b229a6302b90b3545b175f716e5d84772c7be8e9716b86"
    },
    "contract_checks": {
      "total": 3,
      "passed": 3,
      "failed": 0,
      "items": [
        {
          "id": "release-artifacts-aligned",
          "status": "pass",
          "detail": "1.0.4"
        },
        {
          "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"
  }
}
