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]
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 #pragma weak __csinhf = csinhf
32 #include "complex_wrapper.h"
34 #if defined(__i386) && !defined(__amd64)
35 extern int __swapRP(int);
38 static const float zero
= 0.0F
, half
= 0.5F
;
44 int hx
, ix
, hy
, iy
, n
;
57 if (ix
>= 0x41600000) { /* |x| > 14 = prec/2 (14,28,34,60) */
58 if (ix
>= 0x42B171AA) { /* |x| > 88.722... ~ log(2**128) */
59 if (ix
>= 0x7f800000) { /* |x| is inf or NaN */
63 } else if (iy
>= 0x7f800000) {
71 #if defined(__i386) && !defined(__amd64)
72 int rp
= __swapRP(fp_extended
);
74 /* return (C, S) * exp(x) / 2 */
75 t
= __k_cexp((double)x
, &n
);
76 F_RE(ans
) = (float)scalbn(C
* t
, n
- 1);
77 F_IM(ans
) = (float)scalbn(S
* t
, n
- 1);
78 #if defined(__i386) && !defined(__amd64)
79 if (rp
!= fp_extended
)
89 if (ix
== 0) { /* x = 0, return (0,S) */
93 F_RE(ans
) = C
* sinhf(x
);
94 F_IM(ans
) = S
* coshf(x
);
98 F_RE(ans
) = -F_RE(ans
);
100 F_IM(ans
) = -F_IM(ans
);