~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to doug/new_complex/src/ccosh.def.h

  • Committer: tpaxatb
  • Date: 2010-06-22 17:54:08 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:2597
Copy from experimental branch in preparation for trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
__FLT_TYPE __complex__ __cdecl
 
2
__FLT_ABI(ccosh) (__FLT_TYPE __complex__ z)
 
3
{
 
4
  __complex__ __FLT_TYPE ret;
 
5
  __FLT_TYPE s_x, c_x;
 
6
  int r_class = fpclassify (__real__ z);
 
7
  int i_class = fpclassify (__imag__ z);
 
8
 
 
9
  if (r_class == FP_NAN)
 
10
  {
 
11
    __real__ ret = __FLT_NAN;
 
12
    __imag__ ret = __imag__ z == __FLT_CST(0.0) ? __imag__ z : __FLT_NAN;
 
13
    return ret;
 
14
  }
 
15
 
 
16
  if (r_class == FP_INFINITE)
 
17
  {
 
18
    if (i_class == FP_ZERO)
 
19
    {
 
20
      __real__ ret = __FLT_HUGE_VAL;
 
21
      __imag__ ret = __imag__ z * __FLT_ABI(copysign) (__FLT_CST(1.0), __real__ z);
 
22
      return ret;
 
23
    }
 
24
 
 
25
    if (i_class == FP_NAN || i_class == FP_INFINITE)
 
26
    {
 
27
      __real__ ret = __FLT_HUGE_VAL;
 
28
      __imag__ ret = __FLT_NAN + __FLT_NAN;
 
29
      return ret;
 
30
    }
 
31
 
 
32
    __FLT_ABI(sincos) (__imag__ z, &s_x, &c_x);
 
33
 
 
34
    __real__ ret = __FLT_ABI(copysign) (__FLT_HUGE_VAL, c_x);
 
35
    __imag__ ret = (__FLT_ABI(copysign) (__FLT_HUGE_VAL, s_x) * __FLT_ABI(copysign) (__FLT_CST(1.0), __real__ z));
 
36
    return ret;
 
37
  }
 
38
 
 
39
  if (i_class == FP_NAN || i_class == FP_INFINITE)
 
40
  {
 
41
    __imag__ ret = __real__ z == __FLT_CST(0.0) ? __FLT_CST(0.0) : __FLT_NAN;
 
42
    __real__ ret = __FLT_NAN + __FLT_NAN;
 
43
    return ret;
 
44
  }
 
45
 
 
46
  __FLT_ABI(sincos) (__imag__ z, &s_x, &c_x);
 
47
 
 
48
  __real__ ret = __FLT_ABI(cosh) (__real__ z) * c_x;
 
49
  __imag__ ret = __FLT_ABI(sinh) (__real__ z) * s_x;
 
50
  return ret;
 
51
}