C asinh() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
math.h

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.

C
asinh(0.0);
CallWhat it does
asinh(0.0)Returns 0.

Include <math.h>. On GCC, link with -lm.

Library declarations
C
double asinh(double x);
float asinhf(float x);
long double asinhl(long double x);

Parameters

ParameterDescription
xRequired. Any real double.

Return Value

Return ValueDescription
Inverse hyperbolic sineA 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.

C
#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;
}

How It Works

  1. Include math.h. Declares asinh; link with -lm on GCC.
  2. Zero. asinh(0) is 0 because sinh(0) = 0.
  3. Positive input. asinh(2) ≈ 1.44364.
  4. 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.

C
#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;
}

How It Works

  1. Pick any real x. Negatives are fine—no domain clamp like asin.
  2. Invert with asinh. You get the hyperbolic angle t.
  3. Apply sinh. sinh(t) returns to -1.5.
  4. 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.

C
#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

  1. Library call. asinh(2) uses a carefully coded implementation.
  2. Hand formula. log + sqrt express the same identity.
  3. They agree. For this value the digits match closely.
  4. 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

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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