4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
30 #pragma weak __cexpl = cexpl
32 #include "libm.h" /* expl/isinfl/iszerol/scalbnl/sincosl */
33 #include "complex_wrapper.h"
35 extern int isinfl(long double);
36 extern int iszerol(long double);
39 static const long double zero
= 0.0L;
45 long double x
, y
, t
, c
, s
;
46 int n
, ix
, iy
, hx
, hy
;
54 if (iszerol(y
)) { /* y = 0 */
57 } else if (isinfl(x
)) { /* x is +-inf */
59 if (iy
>= 0x7fff0000) {
64 LD_RE(ans
) = zero
* c
;
65 LD_IM(ans
) = zero
* s
;
68 if (iy
>= 0x7fff0000) {
72 (void) sincosl(y
, &s
, &c
);
78 (void) sincosl(y
, &s
, &c
);
79 if (ix
>= 0x400C62E4) { /* |x| > 11356.52... ~ log(2**16384) */
81 LD_RE(ans
) = scalbnl(t
* c
, n
);
82 LD_IM(ans
) = scalbnl(t
* s
, n
);