# C complex.h catanh,catanhf and catanhl

The C <complex.h> catanh,catanhf and catanhl function compute the arc hyperbolic tangent of the complex number.The declaration of the function is given below.

1 double complex catanh(double complex z);
2 float complex catanhf(float complex z);
3 long double complex catanhl(long double complex z);

All the three functions compute the same value,the only difference between them is in their return type:

i)The ‘catanh’ return the arc hyperbolic tangent as double complex type.
ii)The ‘catanhf’ return the arc hyperbolic tangent as float complex type and
iii)The ‘catanhl’ return the arc hyperbolic tangent as long double complex type.

Some points to note:

i)The arc hyperbolic tangent is computed using the formula.

ii)The function compute the complex arc hyperbolic tangent of x,with branch cuts outside the interval [−1,+1] along the real axis.

iii)The function returns a complex whose value is in the range of a strip mathematically unbounded along the real axis and in the interval [−iπ/2 , + iπ/2] along the imaginary axis.

#### double complex cacosh(double complex z);

Parameters:
z – A complex number whose arc hyperbolic tangent is to be computed.

Return type
double complex -The complex arc hyperbolic tangent of ‘z’ as double type.

Code example

double complex c1=900.0009 + I*1122.2211 , c2 ;

c2=catanh( c1 ) ;

printf( “Real part of c2=%lf”, creal(c2) ) ;
printf( “\nImaginary part of c2=%lf”, cimag(c2) ) ;

Output,

Real part of c2=0.000435
Imaginary part of c2=0.000435

#### float complex cacoshf(float complex z);

This function return the arc hyperbolic tangent as float type.

Parameters:
z – A complex number whose arc hyperbolic tangent is to be computed.

Return type
float complex -The complex arc hyperbolic tangent of ‘z’ as float type.

Code example

float complex c1=900.0009 + I*1122.2211 , c2 ;

c2=catanhf( c1 ) ;

printf( “Real part of c2=%f”, crealf(c2) ) ;
printf( “\nImaginary part of c2=%f”, cimagf(c2) ) ;

Output,

Real part of c2=0.000435
Imaginary part of c2=0.000435

#### long double complex cacoshl(long double complex z);

This function return the arc hyperbolic tangent as long double type.

Parameters:
z – A complex number whose arc hyperbolic tangent is to be computed.

Return type
long double complex -The complex arc hyperbolic tangent of ‘z’ as long double type.

Code example

long double complex c1=900.0009 + I*1122.2211 , c2 ;

c2=catanhl( c1 ) ;

printf( “Real part of c2=%Lf”, creall(c2) ) ;
printf( “\nImaginary part of c2=%Lf”, cimagl(c2) ) ;

Output,

Real part of c2=0.000435
Imaginary part of c2=0.000435

*Side Note

Some cases of catanh function (also holds true for catanhf and catanhl),

➥catanh( conj(z) )=conj( catanh(z) ).

➥catanh(+0 + i0) returns +0+i0.

➥catanh(+0 + iNaN) returns +0+iNaN.

➥catanh(+1 + i0) returns +∞+i0 and raises the “divide-by-zero” floating-point exception.

➥catanh(x + i∞) returns +0+iπ/2, for finite positive-signed ‘x’.

➥catanh(x + iNaN) returns NaN+iNaN and optionally raises the “invalid” floating-point exception, for nonzero finite x.

➥catanh(+∞ +iy) returns +0+iπ/2, for finite positive-signed y.

➥catanh(+∞ + i∞) returns +0 + π/2

➥catanh(+∞ + iNaN) returns +0+iNaN.

➥catanh(NaN + iy) returns NaN+iNaN and optionally raises the “invalid” floating-point exception, for finite y.

➥catanh(NaN + i∞) returns ±0+iπ/2 (where the sign of the real part of the result is unspecified).

➥catanh(NaN + iNaN) returns NaN+iNaN.