~ubuntu-branches/ubuntu/trusty/eglibc/trusty

« back to all changes in this revision

Viewing changes to math/s_ctan.c

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-01-10 18:39:35 UTC
  • mfrom: (1.5.2) (4.4.24 experimental)
  • Revision ID: package-import@ubuntu.com-20130110183935-afsgfxkmg7wk5eaj
Tags: 2.17-0ubuntu1
* Merge with Debian, bringing in a new upstream and many small fixes:
  - patches/any/cvs-malloc-deadlock.diff: Dropped, merged upstream.
  - patches/ubuntu/lddebug-scopes.diff: Rebase for upstream changes.
  - patches/ubuntu/local-CVE-2012-3406.diff: Rebased against upstream.
  - patches/ubuntu/no-asm-mtune-i686.diff: Fixed in recent binutils.
* This upstream merge fixes a nasty hang in pulseaudio (LP: #1085342)
* Bump MIN_KERNEL_SUPPORTED to 2.6.32 on ARM, now that we no longer
  have to support shonky 2.6.31 kernels on imx51 babbage builders.
* Drop patches/ubuntu/local-disable-nscd-host-caching.diff, as these
  issues were apparently resolved upstream a while ago (LP: #613662)
* Fix the compiled-in bug URL to point to launchpad.net, not Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
      double sinrx, cosrx;
54
54
      double den;
55
55
      const int t = (int) ((DBL_MAX_EXP - 1) * M_LN2 / 2);
 
56
      int rcls = fpclassify (__real__ x);
56
57
 
57
58
      /* tan(x+iy) = (sin(2x) + i*sinh(2y))/(cos(2x) + cosh(2y))
58
59
         = (sin(x)*cos(x) + i*sinh(y)*cosh(y)/(cos(x)^2 + sinh(y)^2). */
59
60
 
60
 
      __sincos (__real__ x, &sinrx, &cosrx);
 
61
      if (__builtin_expect (rcls != FP_SUBNORMAL, 1))
 
62
        {
 
63
          __sincos (__real__ x, &sinrx, &cosrx);
 
64
        }
 
65
      else
 
66
        {
 
67
          sinrx = __real__ x;
 
68
          cosrx = 1.0;
 
69
        }
61
70
 
62
71
      if (fabs (__imag__ x) > t)
63
72
        {
83
92
        }
84
93
      else
85
94
        {
86
 
          double sinhix = __ieee754_sinh (__imag__ x);
87
 
          double coshix = __ieee754_cosh (__imag__ x);
 
95
          double sinhix, coshix;
 
96
          if (fabs (__imag__ x) > DBL_MIN)
 
97
            {
 
98
              sinhix = __ieee754_sinh (__imag__ x);
 
99
              coshix = __ieee754_cosh (__imag__ x);
 
100
            }
 
101
          else
 
102
            {
 
103
              sinhix = __imag__ x;
 
104
              coshix = 1.0;
 
105
            }
88
106
 
89
 
          den = cosrx * cosrx + sinhix * sinhix;
 
107
          if (fabs (sinhix) > fabs (cosrx) * DBL_EPSILON)
 
108
            den = cosrx * cosrx + sinhix * sinhix;
 
109
          else
 
110
            den = cosrx * cosrx;
90
111
          __real__ res = sinrx * cosrx / den;
91
112
          __imag__ res = sinhix * coshix / den;
92
113
        }