Name

csinh

Synopsis

Calculates the hyperbolic sine of a complex number

#include <complex.h>
double complexcsinh( double complex z );
float complex csinhf( float complex z );
long double complex csinhl( long double complex z );

The hyperbolic sine of a complex number z is equal to (exp(z) − exp(−z)) / 2. The csinh functions return the hyperbolic sine of their complex argument.

Example

double complex v, w, z = -1.2 + 3.4 * I;

v = csinh( z );
w = 0.5 * ( cexp(z) − cexp(−z) );

printf( "The csinh() function returns %.2f %+.2f*I.\n",
        creal(v), cimag(v) );
printf( "Using the cexp() function, the result is %.2f %+.2f*I.\n",
        creal(w), cimag(w) );

This code produces the following output:

The csinh() function returns 1.46 -0.46*I.
Using the cexp() function, the result is 1.46 -0.46*I.

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.