Rate This Document
Findability
Accuracy
Completeness
Readability

csin

Compute the sine of a complex number.

Interface Definition

C interface:

float complex csinf(float complex x);

double complex csin(double complex x);

Parameters

Parameter

Type

Description

Input/Output

x

  • For csinf, x is of single-precision floating-point complex type.
  • For csin, x is of double-precision floating-point complex type.

Floating-point value of the input data.

Input

Return Value

  • Normal range: The sine of the complex number x is returned.
  • Special values: See the following table.

    Real Part of the Input (x.real)

    Imaginary Part of the Input (x.imag)

    Real Part of the Output (y.real)

    Imaginary Part of the Output (y.imag)

    -inf

    -inf

    nan

    -inf

    -inf

    < +0

    nan

    nan

    -inf

    -0

    nan

    -0

    -inf

    +0

    nan

    +0

    -inf

    > +0

    nan

    nan

    -inf

    inf

    nan

    inf

    -inf

    -nan

    nan

    nan

    -inf

    nan

    nan

    nan

    < +0

    -nan

    nan

    nan

    < +0

    nan

    nan

    nan

    -0

    -inf

    -0

    -inf

    -0

    -0

    -0

    -0

    -0

    +0

    -0

    +0

    -0

    inf

    -0

    inf

    -0

    -nan

    -0

    nan

    -0

    nan

    -0

    nan

    +0

    -inf

    0

    -inf

    +0

    -0

    0

    -0

    +0

    +0

    0

    +0

    +0

    inf

    0

    inf

    +0

    -nan

    0

    nan

    +0

    nan

    0

    nan

    > +0

    -nan

    nan

    nan

    > +0

    nan

    nan

    nan

    inf

    -inf

    nan

    -inf

    inf

    < +0

    nan

    nan

    inf

    -0

    nan

    -0

    inf

    +0

    nan

    +0

    inf

    > +0

    nan

    nan

    inf

    inf

    nan

    inf

    inf

    -nan

    nan

    nan

    inf

    nan

    nan

    nan

    -nan

    -inf

    nan

    -inf

    -nan

    < +0

    nan

    nan

    -nan

    -0

    nan

    -0

    -nan

    +0

    nan

    +0

    -nan

    > +0

    nan

    nan

    -nan

    inf

    nan

    inf

    -nan

    -nan

    nan

    nan

    -nan

    nan

    nan

    nan

    nan

    -inf

    nan

    -inf

    nan

    < +0

    nan

    nan

    nan

    -0

    nan

    -0

    nan

    +0

    nan

    +0

    nan

    > +0

    nan

    nan

    nan

    inf

    nan

    inf

    nan

    -nan

    nan

    nan

    nan

    nan

    nan

    nan

Dependency

C: "kc.h"

Example

C interface:
    // typical usage
    double x1 = 1.0, x2 = 2.0, x3 = 3.0, x4 = -4.0;
    double complex cx1 = __builtin_complex(x1, x2);
    double complex cx2 = __builtin_complex(x3, x4);
    double complex cx3 = __builtin_complex(INFINITY, -INFINITY);

    // print result
    double ry;
    double iy;
    ry = __real__ csin(cx1);
    iy = __imag__ csin(cx1);
    printf("csin(cx1) = %.15f, %.15f\n", ry, iy);
    ry = __real__ csin(cx2);
    iy = __imag__ csin(cx2);
    printf("csin(cx2) = %.15f, %.15f\n", ry, iy);
    ry = __real__ csin(cx3);
    iy = __imag__ csin(cx3);
    printf("csin(cx3) = %.15f, %.15f\n", ry, iy);


result
    /*
     * csin(cx1) = 3.165778513216168, 1.959601041421606
     * csin(cx2) = 3.853738037919377, 27.016813258003936
     * csin(cx3) = nan, -inf
     * */