~ubuntu-branches/ubuntu/precise/eglibc/precise-201308281639

« back to all changes in this revision

Viewing changes to math/s_csqrtl.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Complex square root of long double value.
2
 
   Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
 
2
   Copyright (C) 1997, 1998, 2005, 2011 Free Software Foundation, Inc.
3
3
   This file is part of the GNU C Library.
4
4
   Based on an algorithm by Stephen L. Moshier <moshier@world.std.com>.
5
5
   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
21
21
 
22
22
#include <complex.h>
23
23
#include <math.h>
24
 
 
25
 
#include "math_private.h"
 
24
#include <math_private.h>
26
25
 
27
26
 
28
27
__complex__ long double
32
31
  int rcls = fpclassify (__real__ x);
33
32
  int icls = fpclassify (__imag__ x);
34
33
 
35
 
  if (rcls <= FP_INFINITE || icls <= FP_INFINITE)
 
34
  if (__builtin_expect (rcls <= FP_INFINITE || icls <= FP_INFINITE, 0))
36
35
    {
37
36
      if (icls == FP_INFINITE)
38
37
        {
61
60
    }
62
61
  else
63
62
    {
64
 
      if (icls == FP_ZERO)
 
63
      if (__builtin_expect (icls == FP_ZERO, 0))
65
64
        {
66
65
          if (__real__ x < 0.0)
67
66
            {
75
74
              __imag__ res = __copysignl (0.0, __imag__ x);
76
75
            }
77
76
        }
78
 
      else if (rcls == FP_ZERO)
 
77
      else if (__builtin_expect (rcls == FP_ZERO, 0))
79
78
        {
80
79
          long double r = __ieee754_sqrtl (0.5 * fabsl (__imag__ x));
81
80