Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115411434
D28578.id83662.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D28578.id83662.diff
View Options
Index: lib/msun/src/s_ctanh.c
===================================================================
--- lib/msun/src/s_ctanh.c
+++ lib/msun/src/s_ctanh.c
@@ -111,11 +111,13 @@
}
/*
- * ctanh(x + I NaN) = d(NaN) + I d(NaN)
- * ctanh(x +- I Inf) = dNaN + I dNaN
+ * ctanh(+-0 + i NAN) = +-0 + i NaN
+ * ctanh(+-0 +- i Inf) = +-0 + i NaN
+ * ctanh(x + i NAN) = NaN + i NaN
+ * ctanh(x +- i Inf) = NaN + i NaN
*/
if (!isfinite(y))
- return (CMPLX(y - y, y - y));
+ return (CMPLX(x ? y - y : x, y - y));
/*
* ctanh(+-huge +- I y) ~= +-1 +- I 2sin(2y)/exp(2x), using the
Index: lib/msun/src/s_ctanhf.c
===================================================================
--- lib/msun/src/s_ctanhf.c
+++ lib/msun/src/s_ctanhf.c
@@ -61,7 +61,7 @@
}
if (!isfinite(y))
- return (CMPLXF(y - y, y - y));
+ return (CMPLXF(ix ? y - y : x, y - y));
if (ix >= 0x41300000) { /* |x| >= 11 */
float exp_mx = expf(-fabsf(x));
Index: lib/msun/tests/ctrig_test.c
===================================================================
--- lib/msun/tests/ctrig_test.c
+++ lib/msun/tests/ctrig_test.c
@@ -146,13 +146,6 @@
{
long double complex zero = CMPLXL(0.0, 0.0);
-#if defined(__amd64__)
-#if defined(__clang__) && \
- ((__clang_major__ >= 4))
- atf_tc_expect_fail("test fails with clang 4.x+ - bug 217528");
-#endif
-#endif
-
/* csinh(0) = ctanh(0) = 0; ccosh(0) = 1 (no exceptions raised) */
testall_odd(csinh, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH);
testall_odd(csin, zero, zero, ALL_STD_EXCEPT, 0, CS_BOTH);
@@ -179,8 +172,8 @@
* NaN,finite NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval]
* NaN,Inf NaN,NaN [inval] NaN,NaN [inval] NaN,NaN [inval]
* Inf,NaN +-Inf,NaN Inf,NaN 1,+-0
- * 0,NaN +-0,NaN NaN,+-0 NaN,NaN [inval]
- * NaN,0 NaN,0 NaN,+-0 NaN,0
+ * 0,NaN +-0,NaN NaN,+-0 +-0,NaN
+ * NaN,0 NaN,0 NaN,+-0 NaN,+-0
*/
z = nan_nan;
testall_odd(csinh, z, nan_nan, ALL_STD_EXCEPT, 0, 0);
@@ -227,9 +220,9 @@
testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0);
z = CMPLXL(0, NAN);
- testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, 0);
+ testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL);
testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0);
- testall_odd(ctanh, z, nan_nan, OPT_INVALID, 0, 0);
+ testall_odd(ctanh, z, CMPLXL(0, NAN), OPT_INVALID, 0, CS_REAL);
testall_odd(csin, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL);
testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0);
testall_odd(ctan, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, 0, CS_REAL);
@@ -240,7 +233,7 @@
testall_odd(ctanh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG);
testall_odd(csin, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0);
testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, 0);
- testall_odd(ctan, z, nan_nan, OPT_INVALID, 0, 0);
+ testall_odd(ctan, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, 0, CS_IMAG);
}
ATF_TC(test_inf_inputs);
@@ -260,7 +253,7 @@
* IN CSINH CCOSH CTANH
* Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0
* Inf,finite Inf cis(finite) Inf cis(finite) 1,0 sin(2 finite)
- * 0,Inf +-0,NaN inval NaN,+-0 inval NaN,NaN inval
+ * 0,Inf +-0,NaN inval NaN,+-0 inval +-0,NaN
* finite,Inf NaN,NaN inval NaN,NaN inval NaN,NaN inval
*/
z = CMPLXL(INFINITY, INFINITY);
@@ -294,11 +287,11 @@
z = CMPLXL(0, INFINITY);
testall_odd(csinh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, FE_INVALID, 0);
testall_even(ccosh, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0);
- testall_odd(ctanh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0);
+ testall_odd(ctanh, z, CMPLXL(0, NAN), ALL_STD_EXCEPT, FE_INVALID, CS_REAL);
z = CMPLXL(INFINITY, 0);
testall_odd(csin, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0);
testall_even(ccos, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, 0);
- testall_odd(ctan, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0);
+ testall_odd(ctan, z, CMPLXL(NAN, 0), ALL_STD_EXCEPT, FE_INVALID, CS_IMAG);
z = CMPLXL(42, INFINITY);
testall_odd(csinh, z, CMPLXL(NAN, NAN), ALL_STD_EXCEPT, FE_INVALID, 0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 24, 1:02 PM (15 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17758891
Default Alt Text
D28578.id83662.diff (3 KB)
Attached To
Mode
D28578: msun: ctanh/ctanhf: Import fix from MUSL
Attached
Detach File
Event Timeline
Log In to Comment