123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #include <openlibm_complex.h>
- #include <openlibm_math.h>
- static void
- cchshl(long double x, long double *c, long double *s)
- {
- long double e, ei;
- if(fabsl(x) <= 0.5L) {
- *c = coshl(x);
- *s = sinhl(x);
- } else {
- e = expl(x);
- ei = 0.5L/e;
- e = 0.5L * e;
- *s = e - ei;
- *c = e + ei;
- }
- }
- long double complex
- csinl(long double complex z)
- {
- long double complex w;
- long double ch, sh;
- cchshl(cimagl(z), &ch, &sh);
- w = sinl(creall(z)) * ch + (cosl(creall(z)) * sh) * I;
- return (w);
- }
|