csqrtl.c revision 25c28e83beb90e7c80452a7c818c5e6f73a07dc8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "complex_wrapper.h"
#include "longdouble.h"
/* INDENT OFF */
static const long double
twom9001 = 2.6854002716003034957421765100615693043656e-2710L,
twom4500 = 2.3174987687592429423263242862381544149252e-1355L,
two8999 = 9.3095991180122343502582347372163290310934e+2708L,
two4500 = 4.3149968987270974283777803545571722250806e+1354L,
zero = 0.0L,
half = 0.5L,
two = 2.0L;
/* INDENT ON */
x = LD_RE(z);
y = LD_IM(z);
/* x or y is Inf or NaN */
if (isinfl(y))
else if (isinfl(x)) {
if (hx > 0) {
} else {
}
} else
} else if (y == zero) {
if (hx >= 0) {
} else {
}
#if defined(__x86) /* 64 significant bits */
if (n >= 35)
#else /* 113 significant bits */
if (n >= 60)
#endif
y *= twom9001;
y *= two8999;
} else
if (hx >= 0) {
} else {
}
} else {
#if defined(__x86) /* 64 significant bits */
if (n >= 35) { /* } */
#else /* 113 significant bits */
if (n >= 60) {
#endif
if (n >= 120)
else if (iy >= 0x7ffe0000)
else if (ix <= 0x00010000)
else
y *= twom9001;
} else if (ix <= 0x20bf0000) {
y *= two8999;
} else
if (hx >= 0) {
} else {
}
}
if (hy < 0)
return (ans);
}