{
  "category": "Math and trigonometry functions",
  "display_name": "CSC",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.CSC",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "20430",
        "?"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 2136,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 2136,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 2,136 in the answer bank and 3 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 2,139 recorded answers",
    "workbook_corpus": {
      "cells": 3,
      "matched": 3
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L68-L68",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/csc.rs#L4-L12"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/math::unary",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::sin_with",
        "ported/excel_numeric::excel_sin",
        "ported/excel_numeric::excel_x87_recip",
        "ported/excel_numeric/soft87::pack_raw",
        "ported/excel_numeric/soft87::zero",
        "ported/excel_numeric/soft87::inf",
        "ported/excel_numeric/soft87::pack",
        "ported/excel_numeric/soft87::ext_pi",
        "ported/excel_numeric/soft87::ext_chs",
        "ported/excel_numeric/x87::recip"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L68-L68",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 2,139 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.CSC.json",
  "name": "CSC",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **`SIN`** — the reciprocal, named by the documentation itself. `EV-MATH-0004` records that\n  the three reciprocal surfaces are built as `excel_x87_recip` of the *published* primaries,\n  which is exactly what the documented identity `CSC(n) = 1/SIN(n)` describes: the reciprocal\n  of the already-rounded binary64 sine, not an independently computed cosecant.\n- **`SEC`, [COT](FUNC.COT.md)** — the other two reciprocals from the same 2013 batch, sharing\n  the documentation template and the `2^27` bound.\n- **[COS](FUNC.COS.md), `TAN`** — the primaries. `csc x = sec(π/2 - x)`.\n- **`ASIN`** — there is no `ACSC` on the worksheet surface; `ASIN(1/x)` is the substitute.\n- **[CSCH](FUNC.CSCH.md)** — the hyperbolic partner, `csch x = -i·csc(ix)`, sharing the `1/x`\n  leading term and the pole at the origin.\n- **`IMCSC`** — the complex version.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\nThe documented identity is unusually informative, because it tells you what the error looks\nlike without needing an oracle.\n\n**Double rounding is structural here.** If `CSC(x)` really is `1/SIN(x)` evaluated on the\npublished binary64 sine, then the cosecant's error is the sine's *relative* error, inverted,\nplus the rounding of one division. Two consequences follow. The good one: the relative error of\n`CSC` is bounded by the relative error of `SIN` plus half an ulp, so `CSC` is never much worse\nthan `SIN` in relative terms. The bad one: it is never *better* either, and near the poles the\nsine's own relative error is at its worst, because that is where `sin` is small and its\nargument reduction dominates.\n\n**The reduction problem, inherited.** `EV-MATH-0004` identifies the substrate as the x87\n`FSIN`/`FPTAN` chain with `FPREM1` reduction against the 64-bit ROM `π`, rules out Cody–Waite\nreduction against extended `π`, and attaches a host-CPU microcode caveat to all six circular\nsurfaces. The record states each of the six was scored individually, so `CSC` is a measured\nsurface rather than one whose status was inherited from `SIN`. Its figures render in the\nevidence layer beside this page.\n\n**Where the amplification lives.** Near a pole `kπ`, write `x = kπ + δ`. Then\n`csc x ≈ (-1)^k / δ`. The reduced argument `δ` is computed by subtracting a stored multiple of\n`π` from `x`, so its *absolute* error is roughly `ABS(x) · 2^-p` for a `p`-bit reduction\nconstant. The relative error of the result is therefore about `ABS(x)·2^-p / ABS(δ)` — it grows\nwith the argument and blows up as the argument approaches a pole. This is the analysis that\nmakes a documented `2^27` bound a reasonable engineering decision rather than an arbitrary one:\npast that magnitude the reduced argument carries no reliable bits at all.\n\n**Near zero**, use `1/x + x/6 + 7x³/360` (A&S 4.3.68) rather than a division, both for speed and\nbecause it gives the deviation from `1/x` directly.\n\n**A `natural-best` implementation** would not use the published sine. It would perform one\nreduction, evaluate `sin r` in extended precision, and reciprocate before rounding — one\nrounding instead of two, and the pole located consistently with the reduction. That is a\ndifferent function from the documented one, which is exactly why the flavour distinction in\n[About implementation options](../model/07-implementation-options.md) exists.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number` with absolute value at least 1.\n\n- **`CSC(0)`** — `1/SIN(0)` is a division by zero. Microsoft's page **does not state the\n  resulting error**, where [COT](FUNC.COT.md)'s page states `#DIV/0!` for the analogous case.\n  `#DIV/0!` follows from the documented identity, but the identity is a definition, not an\n  error specification, and the Handbook has not checked it. Recorded as a documentation gap.\n- **Near other poles** — a large finite value, sign alternating with the parity of `k`.\n- **`ABS` result below 1** — impossible mathematically. A returned value in `(-1, 1)` would be\n  a defect, and this is the cheapest invariant to test.\n- **Beyond `2^27`** — documented `#NUM!`.\n- **Small arguments** — `csc x → 1/x`, a huge finite number, overflowing only in the subnormal\n  range.\n\n\n\n### Errors\n\n\nAs documented on Microsoft's `CSC` page:\n\n| Error | Condition |\n|---|---|\n| `#NUM!` | `ABS(number)` is not less than `2^27` |\n| `#VALUE!` | `number` is non-numeric |\n\nThe zero case is not documented on that page. See the note above.\n\n\n",
    "sources": "- Handbook evidence record `EV-MATH-0004` — the six-surface circular identification, the\n  `FPREM1`-against-ROM-`π` substrate, the reciprocal construction from published primaries, the\n  ruled-out Cody–Waite reduction, and the host-CPU microcode caveat. Read its reader warning.\n- Abramowitz & Stegun, chapter 4.3, in particular 4.3.68 — the cosecant expansion.\n- Payne & Hanek (1983); Muller, *Elementary Functions* — reduction and its error analysis.\n- Handbook, [COS](FUNC.COS.md) and [COT](FUNC.COT.md) — the shared reduction discussion;\n  [About implementation options](../model/07-implementation-options.md);\n  [Coercion and lifting](../model/02-coercion-and-lifting.md).\n- Handbook projections `data/functions/FUNC.CSC.json` (the\n  `arg_domain_guard=circular_trig_overflow` and `non_finite=num` axis values) and\n  `data/presence/FUNC.CSC.json`.\n\n",
    "version-differences": "The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 19929 | Windows, bitness not recorded, CPU not recorded | 31 |\n| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 912 |\n| 20430 | Windows, 64-bit, CPU not recorded | 1,224 |\n\n- XC-CSC-001: build 19929 versus build 20430; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n- XC-CSC-002: build 20131 versus build 20430; 1 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.\n\nAgreement on these compared inputs does not establish agreement on unmeasured inputs.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.CSC.json).",
    "what-it-does": "\n`CSC(number)` returns the cosecant of an angle in radians. Microsoft's page states the\nidentity outright: `CSC(n)` equals `1/SIN(n)`.\n\n    csc x = 1 / sin x\n\n| Property | Statement |\n|---|---|\n| Domain | all real `x` except `x = kπ`, `k ∈ ℤ` |\n| Range | `(-∞, -1] ∪ [1, ∞)` — `ABS(csc x) ≥ 1` everywhere |\n| Parity | odd: `csc(-x) = -csc(x)` |\n| Period | `2π` |\n| Poles | simple, at `x = kπ`, residue `(-1)^k` |\n| Extrema | `csc x = ±1` at `x = π/2 + kπ`; these are the local extrema, not zeros |\n| Laurent series at 0 | `csc x = 1/x + x/6 + 7x³/360 + …` (A&S 4.3.68) |\n| Derivative | `d/dx csc x = -csc x · cot x` |\n| Identity | `csc²x - cot²x = 1` |\n| Zeros | none — the cosecant is never zero |\n\nThat last row is the reader's most useful fact: **`CSC` has no zeros**, so a `CSC` result near\nzero is impossible and a `CSC` result of small magnitude is a bug. The function's values are\nbounded away from the origin and unbounded near every multiple of `π`.\n\nAs with [COT](FUNC.COT.md), the poles matter less than they look. `π` is irrational, so the\nonly pole that is a binary64 value is `x = 0`; at every other multiple of `π` the function\nreturns a large finite number whose magnitude is roughly the reciprocal of the distance from\nthe argument to the true pole.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Constraint (as documented) |\n|---|---|---|\n| `number` | The angle in radians. Required. | `ABS(number) < 2^27` |\n\nThe slot takes ordinary to-number coercion; the surface is declared an elementwise scalar\nkernel. See [Coercion and lifting](../model/02-coercion-and-lifting.md).\n\n\n"
  },
  "signature": {
    "display": "CSC(number)",
    "parameters": [
      {
        "description": null,
        "name": "number",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Math and trigonometry functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "UnaryNumericScalarOrArrayElementwise",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Cosecant of an angle in radians",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the cosecant of an angle",
        "microsoft_url": "https://support.microsoft.com/en-us/office/csc-function-07379361-219a-4398-8675-07ddc4f135c1"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "CSC"
        },
        {
          "locale": "bg-BG",
          "name": "CSC"
        },
        {
          "locale": "cs-CZ",
          "name": "CSC"
        },
        {
          "locale": "da-DK",
          "name": "CSC"
        },
        {
          "locale": "de-DE",
          "name": "CSC"
        },
        {
          "locale": "el-GR",
          "name": "CSC"
        },
        {
          "locale": "en-AU",
          "name": "CSC"
        },
        {
          "locale": "en-GB",
          "name": "CSC"
        },
        {
          "locale": "en-US",
          "name": "CSC"
        },
        {
          "locale": "es-ES",
          "name": "CSC"
        },
        {
          "locale": "et-EE",
          "name": "CSC"
        },
        {
          "locale": "fi-FI",
          "name": "KOSEK"
        },
        {
          "locale": "fr-FR",
          "name": "CSC*"
        },
        {
          "locale": "he-IL",
          "name": "CSC"
        },
        {
          "locale": "hr-HR",
          "name": "CSC"
        },
        {
          "locale": "hu-HU",
          "name": "CSC"
        },
        {
          "locale": "id-ID",
          "name": "CSC"
        },
        {
          "locale": "it-IT",
          "name": "CSC"
        },
        {
          "locale": "ja-JP",
          "name": "CSC"
        },
        {
          "locale": "ko-KR",
          "name": "CSC"
        },
        {
          "locale": "lt-LT",
          "name": "CSC"
        },
        {
          "locale": "lv-LV",
          "name": "CSC"
        },
        {
          "locale": "nb-NO",
          "name": "CSC"
        },
        {
          "locale": "nl-NL",
          "name": "COSEC"
        },
        {
          "locale": "pl-PL",
          "name": "CSC"
        },
        {
          "locale": "pt-BR",
          "name": "CSC"
        },
        {
          "locale": "pt-PT",
          "name": "CSC"
        },
        {
          "locale": "ro-RO",
          "name": "CSC"
        },
        {
          "locale": "ru-RU",
          "name": "CSC"
        },
        {
          "locale": "sk-SK",
          "name": "CSC"
        },
        {
          "locale": "sl-SI",
          "name": "CSC"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "CSC"
        },
        {
          "locale": "sv-SE",
          "name": "CSC"
        },
        {
          "locale": "th-TH",
          "name": "CSC"
        },
        {
          "locale": "tr-TR",
          "name": "CSC"
        },
        {
          "locale": "uk-UA",
          "name": "CSC"
        },
        {
          "locale": "vi-VN",
          "name": "CSC"
        },
        {
          "locale": "zh-CN",
          "name": "CSC"
        },
        {
          "locale": "zh-HK",
          "name": "CSC"
        },
        {
          "locale": "zh-TW",
          "name": "CSC"
        }
      ],
      "signature": {
        "display": "CSC(number)",
        "parameters": [
          {
            "description": null,
            "name": "number",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "CSC",
      "version_marker": null,
      "xlcall": {
        "code": "552",
        "symbol": "xlfCsc"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/csc-function-07379361-219a-4398-8675-07ddc4f135c1"
  },
  "try_it": {
    "formula": "=CSC(1)"
  },
  "url": "https://handbook.dnacalc.com/functions/CSC.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "31 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 19929",
      "platform": "Windows, bitness not recorded, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.CSC.json"
      ]
    },
    {
      "behaviour": "912 captured inputs are indexed for this environment. Capture dates: 2026-07-11 to 2026-07-11. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20131",
      "platform": "Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.CSC.json"
      ]
    },
    {
      "behaviour": "1,224 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.CSC.json"
      ]
    }
  ]
}