C asinh() Function

Definition
In C, asinh() returns the inverse hyperbolic sine of x. asinh(0) is 0. A negative input gives a negative result.
You pass one double. Any real number is allowed. The result is a double with the same sign as x. Include <math.h>.
Syntax
Pass any real number. Start with this call.
| Call | What it does |
|---|
asinh(0.0) | Returns 0. |
Include <math.h>. On GCC, link with -lm.
Library declarations
double asinh(double x);
float asinhf(float x);
long double asinhl(long double x);
Parameters
| Parameter | Description |
|---|
| x | Required. Any real double. |
Return Value
| Return Value | Description |
|---|
| Inverse hyperbolic sine | A double with the same sign as x. Zero stays zero. |
C Examples
Example 1 — Positive, Zero, and Negative
asinh works for the full real line and is an odd function.
#include <math.h>
#include <stdio.h>
int main(void) {
printf("asinh(0) = %.5f\n", asinh(0.0));
printf("asinh(2) = %.5f\n", asinh(2.0));
printf("asinh(-2) = %.5f\n", asinh(-2.0));
return 0;
}
asinh(0) = 0.00000
asinh(2) = 1.44364
asinh(-2) = -1.44364
How It Works
- Include math.h. Declares
asinh; link with -lm on GCC. - Zero.
asinh(0) is 0 because sinh(0) = 0. - Positive input.
asinh(2) ≈ 1.44364. - Odd symmetry.
asinh(-2) is the negation of asinh(2).
Example 2 — Verify with sinh
Round-trip a value: asinh then sinh should recover the original x.
#include <math.h>
#include <stdio.h>
int main(void) {
double x = -1.5;
double t = asinh(x);
printf("asinh(%.1f) = %.5f\n", x, t);
printf("sinh(t) = %.5f\n", sinh(t));
return 0;
}
asinh(-1.5) = -1.19476
sinh(t) = -1.50000
How It Works
- Pick any real x. Negatives are fine—no domain clamp like
asin. - Invert with asinh. You get the hyperbolic angle
t. - Apply sinh.
sinh(t) returns to -1.5. - Use as a check. Confirms the inverse pair on the whole real line.
Example 3 — Match the Log Formula
Compare the library result with ln(x + sqrt(x*x + 1)) using log and sqrt.
#include <math.h>
#include <stdio.h>
int main(void) {
double x = 2.0;
double lib = asinh(x);
double hand = log(x + sqrt(x * x + 1.0));
printf("asinh(2) = %.10f\n", lib);
printf("ln formula = %.10f\n", hand);
return 0;
}
How It Works
- Library call.
asinh(2) uses a carefully coded implementation. - Hand formula.
log + sqrt express the same identity. - They agree. For this value the digits match closely.
- Prefer asinh. Clearer, and better near extreme magnitudes than a naive formula.
Frequently Asked Questions
asinh() returns the inverse hyperbolic sine of x. asinh(0) is 0, and a negative x gives a negative result.
x is required. Any real double is allowed.
A double with the same sign as x.
Include <math.h>. On GCC, link with -lm.
No. Negative inputs are valid and return a negative result.
Next: atan()
Compute the inverse tangent and get an angle in radians.
atan() tutorial →About the author
Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
9 people found this page helpful