C complex.h casin,casinf and casinl


The C <complex.h> casin,casinf and casinl functions compute the arc sine of a complex number.The declaration of the functions is given below.

1 double complex casin(double complex z);
2 float complex casinf(float complex z);
3 long double complex casinl(long double complex z);

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

i)The ‘casin’ return the arc sine as double complex type.
ii)The ‘casinf’ return the arc sine as float complex type and
iii)The ‘casinl’ return the arc sine as long double complex type.

Some points to note:

i) The arc sine function is computed using the formula(‘x’ is any complex number).
C complex.h casin, casinf and casinl function

ii)The real number of an arc sine computed complex number is outputted in the interval -[π/2 , π/2].But the imaginary value is unbound.

double complex casin(double complex z);

Parameters:
z – A complex number for which arc sine is to be computed.

Return type
double complex -The arc sine of ‘x’ complex number.

Code example

double complex c1=2.34 +I* 4.56 , c2 ;

c2=casin( c1 ) ;

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

Output,

Real part of c2=0.466515
Imaginary part of c2=2.332936





float complex casinf(float complex z);

This function compute the arc sine and return it as float complex number type.

Parameters:
z – A complex number for which arc sine is to be computed.

Return type
float complex -The arc sine of ‘z’ complex number as float type.

Code example

float complex c1=3.7744 +I* .36356 , c2 ;

c2=casinf( c1 ) ;

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

Output,

Real part of c1=1.471271
Imaginary part of c2=2.008503


long double complex casinl(long double complex z);

This function compute the arc sine of the complex number and return it as long double type.

Parameters:
z – A complex number for which arc sine is to be computed.

Return type
long double complex -The arc sine of ‘z’ complex number as long double type.

Code example

float complex c1=46 +I*782.34 , c2 ;

c2=casinf( c1 ) ;

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

Output ,

Real part of c2=0.058730
Imaginary part of c2=7.357163

Link : C complex.h creal,crealf and creall
Link : C complex.h cimag,cimagf and cimagl


*Side Note

Some cases of casin function (also holds true for casinf and casinl),

  ➥casin( conj(z) )=conj( casin(z) )

  ➥casin(±0 + i(±0)) ,returns (±0 , i(±0)).

  ➥casin(±0 + iNaN) ,returns (±0 , inan).

  ➥casin(x + i(±∞) ) , returns 0 + i(±∞) ,for finite x.

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

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

  ➥casin(±∞ + i∞) ,returns ±π/4 +i∞.

  ➥casin(±∞ + iNaN) ,returns NAN+i∞

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

  ➥casin(NaN + i(±)∞) ,returns NaN + i(±∞) .

  ➥casin(NaN + iNaN) ,returns NaN+iNaN.

Link :C complex.h conj ,conjf and conjl