ForHosting KIT · Math

Hyperbolic cosine calculator

Get the hyperbolic cosine of any number: cosh(1.5) is 2.352409615243247. It is the average of e^x and e^-x, the curve traced by a hanging chain or power line, and even very large inputs return a finite result. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
X
1.5
You get
Cosh
2.3524096152

Hyperbolic cosine is the function behind the catenary curve of a hanging chain, the relativistic rapidity of a moving particle, and the even part of the exponential function. You send one number, you get one number back: no units to configure, no angle mode to worry about, and no rounding surprises. It rejects non-numeric and infinite input with a clear error instead of silently returning NaN.

What the hyperbolic cosine actually is

The hyperbolic cosine is defined as cosh(x) = (e^x + e^-x) / 2: the average of the exponential function and its mirror image. That simple definition has far-reaching consequences. Because the negative and positive exponentials are averaged, cosh is an even function, so cosh(-x) = cosh(x), and its smallest possible value is cosh(0) = 1.

Unlike its circular cousin cos(x), which oscillates between -1 and 1, the hyperbolic cosine grows without bound in both directions, doubling roughly every time x increases by ln(2). It satisfies the identity cosh^2(x) - sinh^2(x) = 1, which makes it the natural parameterization of a hyperbola exactly as cosine parameterizes a circle.

How the value is computed and validated

The computation itself uses the closed-form definition (e^x + e^-x) / 2 for ordinary magnitudes. For large absolute values, where e^x alone would overflow double precision, the implementation switches to an algebraically identical but numerically safe rearrangement, factoring out e^|x| / 2 and folding the tiny correction term e^-2|x| into a finite product. The result is deterministic to the last bit of the platform's floating-point math: the same input always produces the same output, with no randomness, no time dependence, and no network access.

Where hyperbolic cosine shows up in practice

A rope, chain, or cable hanging between two supports traces a catenary, y = a·cosh(x/a), so structural engineers evaluating sag and tension reach for cosh constantly. In special relativity, velocity is expressed through rapidity, with the Lorentz factor gamma equal to cosh of the rapidity, which turns successive boosts into simple additions. Electrical engineers model lossless transmission lines with cosh and sinh of the propagation constant times length.

In statistics, the hyperbolic cosine appears in the hyperbolic secant distribution, and in machine learning, log(cosh(x)) is a smooth, twice-differentiable alternative to the absolute value for robust loss functions. Architects encounter the shape inversely: the Gateway Arch in St. Louis is a flattened, inverted catenary.

Model a hanging cable or chain

Evaluate the catenary y = a·cosh(x/a) to predict the sag and shape of power lines, suspension-bridge cables, or anchor chains between two supports.

Compute the Lorentz factor from rapidity

In relativistic physics, gamma = cosh(rapidity); feed the rapidity directly and get the time-dilation and length-contraction factor in one call.

Evaluate a robust loss function

Use cosh inside log(cosh(x)) as a smooth approximation of |x| when implementing or debugging regression losses outside your usual framework.

What does it cost?

The same computation runs free in your browser on this page.

Is the argument in degrees or radians?

Neither. Hyperbolic functions take a pure real number, not an angle. If you have degrees, convert your quantity first according to your own formula.

What happens for very large inputs?

An overflow-safe formulation keeps the result finite up to the limit of double precision (roughly |x| below 710); beyond that range no finite double can hold the answer.

Is the computation deterministic?

Yes. There is no randomness, no clock, and no network access; identical input always yields the identical floating-point result.

What is the smallest value cosh can take?

The smallest value is 1, reached when x is 0. Because cosh averages e^x and e^-x, it is symmetric, so cosh(-1.5) equals cosh(1.5), and it grows without limit in both directions.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/cosh

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/cosh \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"x":1.5}'
{
  "x": 1.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.cosh",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The hyperbolic cosine API computes cosh(x) = (e^x + e^-x) / 2 for any finite real number and returns the exact hyperbolic cosine value in a single call.

What the hyperbolic cosine actually is

When you feed a value into this endpoint you get back the raw hyperbolic cosine as a floating-point number, computed with an overflow-safe formulation so that even arguments in the hundreds return a finite, correct result instead of Infinity.

How the value is computed and validated

Input validation is deliberately strict: the endpoint accepts a single field x, which may be a JSON number or a numeric string, and rejects everything else — booleans, arrays, objects, empty strings, NaN, and the infinities — with an invalid_input error, so you never pay for a garbage call. That determinism is what makes the free browser version and the paid API version produce byte-identical answers.

Where hyperbolic cosine shows up in practice

Whatever your domain, if a formula contains cosh, this endpoint evaluates it in one request for $0.002 per call, and the same computation runs free in the browser on this page.

What input does it accept?

A single field x holding a finite number, either as a JSON number or a numeric string. Anything else is rejected with an invalid_input error.

Can the result ever be less than 1?

No. cosh(x) is always at least 1, with equality only at x = 0, and cosh(-x) = cosh(x).

Read the full KIT documentation →