{
  "category": "Math and trigonometry functions",
  "display_name": "COSH",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.COSH",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 33550,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 33550,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 33,550 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 33,553 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#L63-L65"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/math::raw",
        "ported/cosh::cosh_kernel",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_x87_add",
        "ported/excel_numeric/x87::add"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/math.rs#L63-L65",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 33,553 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.COSH.json",
  "name": "COSH",
  "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- **`SINH`** — the odd partner. `SINH` has a cancellation problem near zero that `COSH` does\n  not have, and the same overflow problem at large arguments. `EV-MATH-0008` names both.\n- **`TANH`** — `sinh/cosh`, bounded by 1, and the numerically well-behaved member.\n- **`SECH`** — the reciprocal `1/COSH`, which *underflows* smoothly to zero where `COSH`\n  overflows: the reciprocal pair is not symmetric in difficulty.\n- **[COTH](FUNC.COTH.md), [CSCH](FUNC.CSCH.md)** — the 2013-generation hyperbolic reciprocals,\n  with documented magnitude constraints that `COSH` does not carry.\n- **`ACOSH`** — the inverse on `[1, ∞)`, principal branch. `ACOSH(COSH(x)) = |x|`, which is\n  the useful metamorphic identity here precisely because it exposes the evenness.\n- **[EXP](FUNC.EXP.md)** — the substrate in every plausible implementation, and the surface\n  whose evaluation route has actually been identified. Anything learned about `EXP` transfers\n  here.\n- **[COS](FUNC.COS.md)** — `cosh x = cos(ix)`. Related in name and in theory; opposite in every\n  computational respect.\n- **`IMCOSH`** — the complex version.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\nHyperbolic cosine has no cancellation problem — the two terms of `(e^x + e^-x)/2` are both\npositive — and no reduction problem. Its whole difficulty is **range**.\n\nThe standard branch structure, essentially as in fdlibm's `e_cosh.c` and Cephes' `cosh.c`:\n\n1. **Tiny `|x|`** (below about `2^-27`): return 1. The correction term is below half an ulp.\n2. **Small `|x|`** (up to about `ln 2 / 2`): use `t = expm1(|x|)` and evaluate\n   `cosh x = 1 + t²/(2(1+t))`. The point is accuracy in the *correction*, not in the result:\n   computing `(e^x + e^-x)/2` directly here is stable in the result but computes the deviation\n   from 1 poorly, and the deviation is what a caller who then subtracts 1 actually wants.\n   (Excel has no `COSHM1`, so a spreadsheet user computing `COSH(x)-1` for small `x` gets the\n   cancellation regardless of how good `COSH` is. The remedy in a worksheet is the series\n   `x²/2 + x⁴/24`, not a better `COSH`.)\n3. **Moderate `|x|`** (up to about 22): `t = e^{|x|}`; return `(t + 1/t)/2`.\n4. **Large `|x|`** (up to the overflow threshold of `e`): return `e^{|x|}/2`; the reciprocal\n   term is below the rounding of the result.\n5. **Near the top** (`|x|` between `ln(DBL_MAX)` and `ln(2·DBL_MAX)`): `e^{|x|}` itself\n   overflows even though `cosh x` does not. The standard trick is `w = e^{|x|/2}`, return\n   `(w/2)·w` — two representable halves multiplied at the end. Skipping this step costs the\n   function its top `ln 2` of range, which is the band named above.\n\nA&S chapter 4.5 gives the identity set; 4.5.64 onwards gives the classical polynomial\napproximations. The accuracy of any of these branches is inherited from `EXP`, which is why\n`EV-MATH-0001`'s identification of the exponential's substrate (on the [EXP](FUNC.EXP.md) page)\nis the most relevant external fact about this surface — even though `EV-MATH-0001` does not\nname `COSH` and nothing from it may be attributed here.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number` in `[1, ∞)`.\n\n- **Zero** — `COSH(0) = 1`, exactly, and this is the function's minimum.\n- **Sign** — the result never depends on the sign of the argument.\n- **Never below 1.** An implementation that returns a value slightly under 1 for a tiny\n  argument has a cancellation bug; the correct evaluation cannot do it. This is the cheapest\n  self-check on the whole page.\n- **The gap between `e^709` and `cosh(710)`.** A naive implementation that computes `EXP(x)`\n  first overflows about `ln 2` earlier than the true function does. There is a narrow band of\n  arguments where the mathematically representable answer is lost to the algorithm rather than\n  to the format. Whether Excel's answer covers that band is unchecked.\n\n\n\n### Errors\n\n\nMicrosoft's `COSH` page documents no error conditions.\n\n| Error | Condition | Source |\n|---|---|---|\n| `#VALUE!` | Non-numeric argument | Shared call model, not this page |\n| `#NUM!` | The true result is not finite | `EV-MATH-0008`, which names `COSH` — kind and error-code convention, no count |\n\nThat second row is the honest statement of what is known: the FINITE convention is on record\nwith witnesses, and the boundary between the last `#NUM!`-free argument and the first `#NUM!`\nargument has not been located.\n\n\n",
    "sources": "- Handbook evidence record `EV-MATH-0008` — the FINITE error-code convention with named\n  witnesses across a nine-surface family including `COSH`, and its explicit statement that it\n  publishes no count. Read its reader warning.\n- Abramowitz & Stegun, chapter 4.5 — hyperbolic functions, identities, series and\n  approximations.\n- fdlibm `e_cosh.c` and Cephes `cosh.c` — the standard branch structures.\n- Handbook, [EXP](FUNC.EXP.md) — the substrate every branch above depends on.\n- Handbook, [Coercion and lifting](../model/02-coercion-and-lifting.md).\n- Handbook projections `data/functions/FUNC.COSH.json` (the `arg_domain_guard=none` and\n  `non_finite=num` axis values) and `data/presence/FUNC.COSH.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 | 44 |\n| 20430 | Windows, 64-bit, CPU not recorded | 33,550 |\n\n- XC-COSH-001: build 19929 versus build 20430; 2 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.COSH.json).",
    "what-it-does": "\n`COSH(number)` returns the hyperbolic cosine. Microsoft's page gives the defining formula:\n\n    cosh x = (e^x + e^-x) / 2\n\nIt is the even part of the exponential function; `sinh` is the odd part, and `e^x = cosh x +\nsinh x` is the decomposition.\n\n| Property | Statement |\n|---|---|\n| Domain | all real `x` |\n| Range | `[1, ∞)`, with the minimum `cosh 0 = 1` attained only at 0 |\n| Parity | even: `cosh(-x) = cosh(x)` |\n| Series | `1 + x²/2! + x⁴/4! + …`, convergent for all `x` |\n| Fundamental identity | `cosh²x - sinh²x = 1` |\n| Relation to circular | `cosh x = cos(ix)` and `cos x = cosh(ix)` |\n| Derivative | `d/dx cosh x = sinh x` |\n| Addition | `cosh(x+y) = cosh x cosh y + sinh x sinh y` |\n| Asymptotics | `cosh x ~ e^abs(x) / 2` as `abs(x) → ∞` |\n| Entire | no poles, no branch cuts; periodic with period `2πi` in the complex plane |\n\nThe catenary is the physical reading: a uniform chain hanging under gravity takes the shape\n`y = a·cosh(x/a)`. That is also why `COSH` shows up in engineering spreadsheets far more often\nthan its siblings.\n\nTwo numbers fix the practical boundary. `cosh x` exceeds the largest finite binary64 when\n`|x|` passes roughly `709.78 + ln 2 ≈ 710.4758`; and `cosh x` is indistinguishable from\n`e^{|x|}/2` in binary64 once `|x|` is above about 22, because the `e^{-|x|}` term has fallen\nbelow half an ulp of the result.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Notes |\n|---|---|---|\n| `number` | Any real number. Required. | Microsoft documents no magnitude constraint |\n\nNote the contrast with the newer hyperbolic surfaces: [COTH](FUNC.COTH.md) and\n[CSCH](FUNC.CSCH.md) carry a documented `|number| < 2^27` constraint on their pages, and\n`COSH` — a much older function — carries none.\n\n\n"
  },
  "signature": {
    "display": "COSH(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": "NumToNum",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Hyperbolic cosine",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the hyperbolic cosine of a number",
        "microsoft_url": "https://support.microsoft.com/en-us/office/cosh-function-e460d426-c471-43e8-9540-a57ff3b70555"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "COSH"
        },
        {
          "locale": "bg-BG",
          "name": "COSH"
        },
        {
          "locale": "cs-CZ",
          "name": "COSH"
        },
        {
          "locale": "da-DK",
          "name": "COSH"
        },
        {
          "locale": "de-DE",
          "name": "COSH"
        },
        {
          "locale": "el-GR",
          "name": "COSH"
        },
        {
          "locale": "en-AU",
          "name": "COSH"
        },
        {
          "locale": "en-GB",
          "name": "COSH"
        },
        {
          "locale": "en-US",
          "name": "COSH"
        },
        {
          "locale": "es-ES",
          "name": "COSH"
        },
        {
          "locale": "et-EE",
          "name": "COSH"
        },
        {
          "locale": "fi-FI",
          "name": "COSH"
        },
        {
          "locale": "fr-FR",
          "name": "COSH*"
        },
        {
          "locale": "he-IL",
          "name": "COSH"
        },
        {
          "locale": "hr-HR",
          "name": "COSH"
        },
        {
          "locale": "hu-HU",
          "name": "COSH"
        },
        {
          "locale": "id-ID",
          "name": "COSH"
        },
        {
          "locale": "it-IT",
          "name": "COSH"
        },
        {
          "locale": "ja-JP",
          "name": "COSH"
        },
        {
          "locale": "ko-KR",
          "name": "COSH"
        },
        {
          "locale": "lt-LT",
          "name": "COSH"
        },
        {
          "locale": "lv-LV",
          "name": "COSH"
        },
        {
          "locale": "nb-NO",
          "name": "COSH"
        },
        {
          "locale": "nl-NL",
          "name": "COSH"
        },
        {
          "locale": "pl-PL",
          "name": "COSH"
        },
        {
          "locale": "pt-BR",
          "name": "COSH"
        },
        {
          "locale": "pt-PT",
          "name": "COSH"
        },
        {
          "locale": "ro-RO",
          "name": "COSH"
        },
        {
          "locale": "ru-RU",
          "name": "COSH"
        },
        {
          "locale": "sk-SK",
          "name": "COSH"
        },
        {
          "locale": "sl-SI",
          "name": "COSH"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "COSH"
        },
        {
          "locale": "sv-SE",
          "name": "COSH"
        },
        {
          "locale": "th-TH",
          "name": "COSH"
        },
        {
          "locale": "tr-TR",
          "name": "COSH işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "COSH"
        },
        {
          "locale": "vi-VN",
          "name": "COSH"
        },
        {
          "locale": "zh-CN",
          "name": "COSH"
        },
        {
          "locale": "zh-HK",
          "name": "COSH"
        },
        {
          "locale": "zh-TW",
          "name": "COSH"
        }
      ],
      "signature": {
        "display": "COSH(number)",
        "parameters": [
          {
            "description": null,
            "name": "number",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "COSH",
      "version_marker": null,
      "xlcall": {
        "code": "230",
        "symbol": "xlfCosh"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/cosh-function-e460d426-c471-43e8-9540-a57ff3b70555"
  },
  "try_it": {
    "formula": "=COSH(1)"
  },
  "url": "https://handbook.dnacalc.com/functions/COSH.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "44 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.COSH.json"
      ]
    },
    {
      "behaviour": "33,550 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.COSH.json"
      ]
    }
  ]
}