Hyperbolic functions calculator
At 1.5 you get a hyperbolic sine of 2.12927945509, a cosine of 2.35240961524 and a tangent of 0.905148253645, all three from the same number. Handy for checking a hanging cable or a tanh activation. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X
- 1.5
- Sinh
- 2.1292794551
- Cosh
- 2.3524096152
- Tanh
- 0.9051482536
Hyperbolic functions appear wherever exponential growth and decay combine: the curve of a hanging cable, the shape of a soap film, relativistic velocity composition, the transfer function of a neural network layer.
What sinh, cosh and tanh actually measure
The hyperbolic functions are the exponential analogues of the trigonometric ones. Hyperbolic sine is defined as sinh(x) = (e^x − e^−x) / 2, hyperbolic cosine as cosh(x) = (e^x + e^−x) / 2, and hyperbolic tangent as their quotient, tanh(x) = sinh(x) / cosh(x). Where sine and cosine parametrize a circle, sinh and cosh parametrize a hyperbola, which is why they surface in physics and engineering whenever a system is governed by exponential behaviour rather than rotation.
The most famous example is the catenary: a chain or cable hanging under its own weight follows exactly the graph of cosh, not a parabola as is commonly assumed.
The hyperbolic functions calculator evaluates all three from the same input value, so the identity cosh²(x) − sinh²(x) = 1 holds for the numbers you receive, up to ordinary floating-point rounding. tanh deserves special mention because it squashes any real input into the open interval (−1, 1), which is precisely why it became a classic activation function in machine learning: it is smooth, symmetric around zero, and bounded.
When having all three values together helps
Anywhere a pipeline, a spreadsheet-free check or an automated report needs hyperbolic values without shipping a math library. Civil engineers verifying a catenary approximation want cosh and sinh side by side at the same span parameter; data scientists sanity-checking a custom layer want tanh evaluated on logits straight from production logs; physicists composing rapidities in special relativity add them linearly and then convert back through these very functions.
Because the three results come from one input in one call, there is no risk of mixing values computed from slightly different numbers — a real failure mode when sinh, cosh and tanh are fetched separately.
What you can do with it
Verify a catenary approximation
Check the cosh and sinh values behind a hanging-cable design at the exact span parameter, with both functions returned from the same input.
FAQ
What input does it accept?
A single finite real number, passed as x. Numeric strings are accepted too. NaN, infinities and non-numeric text are rejected with an invalid-input error.
Why do I get an out-of-range error for very large inputs?
Because sinh(x) and cosh(x) grow like e^x/2 and overflow double precision beyond |x| ≈ 710.
Are the results deterministic?
Yes. Each value is rounded to twelve significant digits, so the same input produces byte-identical output on every machine and every run.
Does it support inverse hyperbolic functions?
No. This capability computes sinh, cosh and tanh only. Inverse functions (asinh, acosh, atanh) are a separate concern with their own domain rules.
Is my input stored anywhere?
No. The number is evaluated and discarded; only the three function values are returned.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/hyperbolic-functions \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x":1.5}'const res = await fetch("https://api.kit.forhosting.com/math/hyperbolic-functions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x": 1.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/hyperbolic-functions",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x": 1.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/hyperbolic-functions", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x":1.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x":1.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/hyperbolic-functions", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x": 1.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.hyperbolic_functions",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The hyperbolic functions API takes a single finite real number and returns its hyperbolic sine, hyperbolic cosine and hyperbolic tangent together, computed from the same input so the three values are always consistent with each other. Instead of calling three separate endpoints or reaching for a scientific calculator three times, you send one number and receive sinh(x), cosh(x) and tanh(x) in a single JSON object, deterministic and reproducible on every run.
How the values are computed and why they are stable
One honest limitation follows from the mathematics itself: cosh(x) and sinh(x) grow like e^x / 2, so for inputs larger in magnitude than roughly 710 the true values exceed what a double can hold. The endpoint validates that the input is a finite real number, rejecting text that does not parse, NaN, and positive or negative infinity with a clear invalid-input error that is never billed. It then applies the native double-precision implementations of sinh, cosh and tanh and rounds each result to twelve significant digits before returning it. That rounding is deliberate: the IEEE-754 specifications of these functions allow a one-ulp difference between CPU vendors, and a reproducible API should not change its answer depending on which machine happened to serve the request. Rather than returning an infinity that would serialize as null and break your JSON parser downstream, the endpoint reports that the input is out of range. tanh never overflows — it saturates towards ±1 — but the three values are computed and validated together, so the range check applies to the whole response.
Where a combined hyperbolic endpoint earns its place
The capability runs on our global edge with nothing stored after the response, and the same deterministic code runs free in your browser on this page, so you can verify a single value interactively and only pay $0.002 per request when you automate the call inside a script, a CI step or a scheduled job.
Integration use cases
Sanity-check a tanh activation layer
Feed real logits from production logs through the endpoint and compare them with what your custom neural network layer produces.
Teach or learn hyperbolic identities
Confirm numerically that cosh²(x) − sinh²(x) = 1 and tanh(x) = sinh(x)/cosh(x) for any x, directly from the response object.
Technical questions
What does it cost?
$0.002 per request. It is also free to run in your browser on this page with the same code.