]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix catan, catanh spurious overflows (bug 15409).
authorJoseph Myers <joseph@codesourcery.com>
Sat, 27 Apr 2013 14:56:34 +0000 (14:56 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Sat, 27 Apr 2013 14:57:41 +0000 (14:57 +0000)
ChangeLog
NEWS
math/libm-test.inc
math/s_catan.c
math/s_catanf.c
math/s_catanh.c
math/s_catanhf.c
math/s_catanhl.c
math/s_catanl.c
sysdeps/i386/fpu/libm-test-ulps
sysdeps/x86_64/fpu/libm-test-ulps

index 7cb7c3523b325b2e4bd5793c4e0e7ed834382c8b..219424eb8d33c3aef08d18d8eeaaa696d13e5587 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2013-04-27  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #15409]
+       * math/s_catan.c (__catan): Handle arguments with large real or
+       imaginary part separately without squaring.
+       * math/s_catanf.c (__catanf): Likewise.
+       * math/s_catanh.c (__catanh): Likewise.
+       * math/s_catanhf.c (__catanhf): Likewise.
+       * math/s_catanhl.c [LDBL_MANT_DIG == 106] (LDBL_EPSILON): Undefine
+       and redefine.
+       (__catanhl): Handle arguments with large real or imaginary part
+       separately without squaring.
+       * math/s_catanl.c [LDBL_MANT_DIG == 106] (LDBL_EPSILON): Undefine
+       and redefine.
+       (__catanl): Handle arguments with large real or imaginary part
+       separately without squaring.
+       * math/libm-test.inc (catan_test): Add more tests.
+       (catanh_test): Likewise.
+       * sysdeps/i386/fpu/libm-test-ulps: Update.
+       * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
+
 2013-04-27  Andreas Jaeger  <aj@suse.de>
 
        [BZ #15007]
diff --git a/NEWS b/NEWS
index 15300c423ec21fe134c1afaa88470d237fa7f5ed..cdc0f3cbae0bb4e00ec05a47e4f92276dcf4af9b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,7 +15,7 @@ Version 2.18
   15006, 15007, 15020, 15023, 15036, 15054, 15055, 15062, 15078, 15160,
   15214, 15221, 15232, 15234, 15283, 15285, 15287, 15304, 15305, 15307,
   15309, 15327, 15330, 15335, 15336, 15337, 15342, 15346, 15361, 15366,
-  15394, 15405, 15406.
+  15394, 15405, 15406, 15409.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).
index a62ae9a11f95a677603d4de2df425cfa471844c8..b91035b489425e1cc00ae6668e75ad23b2ad8f33 100644 (file)
@@ -4364,6 +4364,70 @@ catan_test (void)
   TEST_c_c (catan, 0.5L, -0x1p8191L, 1.570796326794896619231321691639751442099L, -1.833603867554847165621412392048483165956e-2466L);
   TEST_c_c (catan, -0.5L, -0x1p8191L, -1.570796326794896619231321691639751442099L, -1.833603867554847165621412392048483165956e-2466L);
 #endif
+  TEST_c_c (catan, 0x1p100L, 0.0L, 1.570796326794896619231321691638962581193L, 0.0L);
+  TEST_c_c (catan, 0x1p100L, -0.0L, 1.570796326794896619231321691638962581193L, -0.0L);
+  TEST_c_c (catan, -0x1p100L, 0.0L, -1.570796326794896619231321691638962581193L, 0.0L);
+  TEST_c_c (catan, -0x1p100L, -0.0L, -1.570796326794896619231321691638962581193L, -0.0L);
+  TEST_c_c (catan, 0.0L, 0x1p100L, 1.570796326794896619231321691639751442099L, 7.888609052210118054117285652827862296732e-31L);
+  TEST_c_c (catan, -0.0L, 0x1p100L, -1.570796326794896619231321691639751442099L, 7.888609052210118054117285652827862296732e-31L);
+  TEST_c_c (catan, 0.0L, -0x1p100L, 1.570796326794896619231321691639751442099L, -7.888609052210118054117285652827862296732e-31L);
+  TEST_c_c (catan, -0.0L, -0x1p100L, -1.570796326794896619231321691639751442099L, -7.888609052210118054117285652827862296732e-31L);
+  TEST_c_c (catan, 0x1.fp127L, 0.0L, 1.570796326794896619231321691639751442096L, 0.0L);
+  TEST_c_c (catan, 0x1.fp127L, -0.0L, 1.570796326794896619231321691639751442096L, -0.0L);
+  TEST_c_c (catan, -0x1.fp127L, 0.0L, -1.570796326794896619231321691639751442096L, 0.0L);
+  TEST_c_c (catan, -0x1.fp127L, -0.0L, -1.570796326794896619231321691639751442096L, -0.0L);
+  TEST_c_c (catan, 0.0L, 0x1.fp127L, 1.570796326794896619231321691639751442099L, 3.033533808573645181854803967025150136306e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, -0.0L, 0x1.fp127L, -1.570796326794896619231321691639751442099L, 3.033533808573645181854803967025150136306e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, 0.0L, -0x1.fp127L, 1.570796326794896619231321691639751442099L, -3.033533808573645181854803967025150136306e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, -0.0L, -0x1.fp127L, -1.570796326794896619231321691639751442099L, -3.033533808573645181854803967025150136306e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, 0x1.fp127L, 0x1.fp127L, 1.570796326794896619231321691639751442097L, 1.516766904286822590927401983512575068153e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, 0x1.fp127L, -0x1.fp127L, 1.570796326794896619231321691639751442097L, -1.516766904286822590927401983512575068153e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, -0x1.fp127L, 0x1.fp127L, -1.570796326794896619231321691639751442097L, 1.516766904286822590927401983512575068153e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catan, -0x1.fp127L, -0x1.fp127L, -1.570796326794896619231321691639751442097L, -1.516766904286822590927401983512575068153e-39L, UNDERFLOW_EXCEPTION_FLOAT);
+#ifndef TEST_FLOAT
+  TEST_c_c (catan, 0x1p900L, 0.0L, 1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, 0x1p900L, -0.0L, 1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, -0x1p900L, 0.0L, -1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, -0x1p900L, -0.0L, -1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, 0.0L, 0x1p900L, 1.570796326794896619231321691639751442099L, 1.183052186166774710972751597518026531652e-271L);
+  TEST_c_c (catan, -0.0L, 0x1p900L, -1.570796326794896619231321691639751442099L, 1.183052186166774710972751597518026531652e-271L);
+  TEST_c_c (catan, 0.0L, -0x1p900L, 1.570796326794896619231321691639751442099L, -1.183052186166774710972751597518026531652e-271L);
+  TEST_c_c (catan, -0.0L, -0x1p900L, -1.570796326794896619231321691639751442099L, -1.183052186166774710972751597518026531652e-271L);
+  TEST_c_c (catan, 0x1.fp1023L, 0.0L, 1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, 0x1.fp1023L, -0.0L, 1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, -0x1.fp1023L, 0.0L, -1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, -0x1.fp1023L, -0.0L, -1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, 0.0L, 0x1.fp1023L, 1.570796326794896619231321691639751442099L, 5.742126086470197117652213464083623391533e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, -0.0L, 0x1.fp1023L, -1.570796326794896619231321691639751442099L, 5.742126086470197117652213464083623391533e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, 0.0L, -0x1.fp1023L, 1.570796326794896619231321691639751442099L, -5.742126086470197117652213464083623391533e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, -0.0L, -0x1.fp1023L, -1.570796326794896619231321691639751442099L, -5.742126086470197117652213464083623391533e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, 0x1.fp1023L, 0x1.fp1023L, 1.570796326794896619231321691639751442099L, 2.871063043235098558826106732041811695767e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, 0x1.fp1023L, -0x1.fp1023L, 1.570796326794896619231321691639751442099L, -2.871063043235098558826106732041811695767e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, -0x1.fp1023L, 0x1.fp1023L, -1.570796326794896619231321691639751442099L, 2.871063043235098558826106732041811695767e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catan, -0x1.fp1023L, -0x1.fp1023L, -1.570796326794896619231321691639751442099L, -2.871063043235098558826106732041811695767e-309L, UNDERFLOW_EXCEPTION_DOUBLE);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_c_c (catan, 0x1p10000L, 0.0L, 1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, 0x1p10000L, -0.0L, 1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, -0x1p10000L, 0.0L, -1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, -0x1p10000L, -0.0L, -1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, 0.0L, 0x1p10000L, 1.570796326794896619231321691639751442099L, 5.012372749206452009297555933742977749322e-3011L);
+  TEST_c_c (catan, -0.0L, 0x1p10000L, -1.570796326794896619231321691639751442099L, 5.012372749206452009297555933742977749322e-3011L);
+  TEST_c_c (catan, 0.0L, -0x1p10000L, 1.570796326794896619231321691639751442099L, -5.012372749206452009297555933742977749322e-3011L);
+  TEST_c_c (catan, -0.0L, -0x1p10000L, -1.570796326794896619231321691639751442099L, -5.012372749206452009297555933742977749322e-3011L);
+  TEST_c_c (catan, 0x1.fp16383L, 0.0L, 1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, 0x1.fp16383L, -0.0L, 1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, -0x1.fp16383L, 0.0L, -1.570796326794896619231321691639751442099L, 0.0L);
+  TEST_c_c (catan, -0x1.fp16383L, -0.0L, -1.570796326794896619231321691639751442099L, -0.0L);
+  TEST_c_c (catan, 0.0L, 0x1.fp16383L, 1.570796326794896619231321691639751442099L, 8.676395208031209048419813722120651877672e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, -0.0L, 0x1.fp16383L, -1.570796326794896619231321691639751442099L, 8.676395208031209048419813722120651877672e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, 0.0L, -0x1.fp16383L, 1.570796326794896619231321691639751442099L, -8.676395208031209048419813722120651877672e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, -0.0L, -0x1.fp16383L, -1.570796326794896619231321691639751442099L, -8.676395208031209048419813722120651877672e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, 0x1.fp16383L, 0x1.fp16383L, 1.570796326794896619231321691639751442099L, 4.338197604015604524209906861060325938836e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, 0x1.fp16383L, -0x1.fp16383L, 1.570796326794896619231321691639751442099L, -4.338197604015604524209906861060325938836e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, -0x1.fp16383L, 0x1.fp16383L, -1.570796326794896619231321691639751442099L, 4.338197604015604524209906861060325938836e-4933L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catan, -0x1.fp16383L, -0x1.fp16383L, -1.570796326794896619231321691639751442099L, -4.338197604015604524209906861060325938836e-4933L, UNDERFLOW_EXCEPTION);
+#endif
 
   TEST_c_c (catan, 0.75L, 1.25L, 1.10714871779409050301706546017853704L, 0.549306144334054845697622618461262852L);
   TEST_c_c (catan, -2, -3, -1.4099210495965755225306193844604208L, -0.22907268296853876629588180294200276L);
@@ -4496,6 +4560,70 @@ catanh_test (void)
   TEST_c_c (catanh, 0.5L, -0x1p8191L, 1.681051571556046753131338908660876301299e-4932L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
   TEST_c_c (catanh, -0.5L, -0x1p8191L, -1.681051571556046753131338908660876301299e-4932L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
 #endif
+  TEST_c_c (catanh, 0x1p100L, 0.0L, 7.888609052210118054117285652827862296732e-31L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1p100L, -0.0L, 7.888609052210118054117285652827862296732e-31L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0x1p100L, 0.0L, -7.888609052210118054117285652827862296732e-31L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0x1p100L, -0.0L, -7.888609052210118054117285652827862296732e-31L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, 0x1p100L, 0.0L, 1.570796326794896619231321691638962581193L);
+  TEST_c_c (catanh, -0.0L, 0x1p100L, -0.0L, 1.570796326794896619231321691638962581193L);
+  TEST_c_c (catanh, 0.0L, -0x1p100L, 0.0L, -1.570796326794896619231321691638962581193L);
+  TEST_c_c (catanh, -0.0L, -0x1p100L, -0.0L, -1.570796326794896619231321691638962581193L);
+  TEST_c_c (catanh, 0x1.fp127L, 0.0L, 3.033533808573645181854803967025150136306e-39L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, 0x1.fp127L, -0.0L, 3.033533808573645181854803967025150136306e-39L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, -0x1.fp127L, 0.0L, -3.033533808573645181854803967025150136306e-39L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, -0x1.fp127L, -0.0L, -3.033533808573645181854803967025150136306e-39L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, 0.0L, 0x1.fp127L, 0.0L, 1.570796326794896619231321691639751442096L);
+  TEST_c_c (catanh, -0.0L, 0x1.fp127L, -0.0L, 1.570796326794896619231321691639751442096L);
+  TEST_c_c (catanh, 0.0L, -0x1.fp127L, 0.0L, -1.570796326794896619231321691639751442096L);
+  TEST_c_c (catanh, -0.0L, -0x1.fp127L, -0.0L, -1.570796326794896619231321691639751442096L);
+  TEST_c_c (catanh, 0x1.fp127L, 0x1.fp127L, 1.516766904286822590927401983512575068153e-39L, 1.570796326794896619231321691639751442097L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, 0x1.fp127L, -0x1.fp127L, 1.516766904286822590927401983512575068153e-39L, -1.570796326794896619231321691639751442097L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, -0x1.fp127L, 0x1.fp127L, -1.516766904286822590927401983512575068153e-39L, 1.570796326794896619231321691639751442097L, UNDERFLOW_EXCEPTION_FLOAT);
+  TEST_c_c (catanh, -0x1.fp127L, -0x1.fp127L, -1.516766904286822590927401983512575068153e-39L, -1.570796326794896619231321691639751442097L, UNDERFLOW_EXCEPTION_FLOAT);
+#ifndef TEST_FLOAT
+  TEST_c_c (catanh, 0x1p900L, 0.0L, 1.183052186166774710972751597518026531652e-271L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1p900L, -0.0L, 1.183052186166774710972751597518026531652e-271L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0x1p900L, 0.0L, -1.183052186166774710972751597518026531652e-271L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0x1p900L, -0.0L, -1.183052186166774710972751597518026531652e-271L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, 0x1p900L, 0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, 0x1p900L, -0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, -0x1p900L, 0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, -0x1p900L, -0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1.fp1023L, 0.0L, 5.742126086470197117652213464083623391533e-309L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, 0x1.fp1023L, -0.0L, 5.742126086470197117652213464083623391533e-309L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, -0x1.fp1023L, 0.0L, -5.742126086470197117652213464083623391533e-309L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, -0x1.fp1023L, -0.0L, -5.742126086470197117652213464083623391533e-309L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, 0.0L, 0x1.fp1023L, 0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, 0x1.fp1023L, -0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, -0x1.fp1023L, 0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, -0x1.fp1023L, -0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1.fp1023L, 0x1.fp1023L, 2.871063043235098558826106732041811695767e-309L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, 0x1.fp1023L, -0x1.fp1023L, 2.871063043235098558826106732041811695767e-309L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, -0x1.fp1023L, 0x1.fp1023L, -2.871063043235098558826106732041811695767e-309L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+  TEST_c_c (catanh, -0x1.fp1023L, -0x1.fp1023L, -2.871063043235098558826106732041811695767e-309L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION_DOUBLE);
+#endif
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+  TEST_c_c (catanh, 0x1p10000L, 0.0L, 5.012372749206452009297555933742977749322e-3011L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1p10000L, -0.0L, 5.012372749206452009297555933742977749322e-3011L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0x1p10000L, 0.0L, -5.012372749206452009297555933742977749322e-3011L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0x1p10000L, -0.0L, -5.012372749206452009297555933742977749322e-3011L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, 0x1p10000L, 0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, 0x1p10000L, -0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, -0x1p10000L, 0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, -0x1p10000L, -0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1.fp16383L, 0.0L, 8.676395208031209048419813722120651877672e-4933L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, 0x1.fp16383L, -0.0L, 8.676395208031209048419813722120651877672e-4933L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, -0x1.fp16383L, 0.0L, -8.676395208031209048419813722120651877672e-4933L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, -0x1.fp16383L, -0.0L, -8.676395208031209048419813722120651877672e-4933L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, 0.0L, 0x1.fp16383L, 0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, 0x1.fp16383L, -0.0L, 1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0.0L, -0x1.fp16383L, 0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, -0.0L, -0x1.fp16383L, -0.0L, -1.570796326794896619231321691639751442099L);
+  TEST_c_c (catanh, 0x1.fp16383L, 0x1.fp16383L, 4.338197604015604524209906861060325938836e-4933L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, 0x1.fp16383L, -0x1.fp16383L, 4.338197604015604524209906861060325938836e-4933L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, -0x1.fp16383L, 0x1.fp16383L, -4.338197604015604524209906861060325938836e-4933L, 1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+  TEST_c_c (catanh, -0x1.fp16383L, -0x1.fp16383L, -4.338197604015604524209906861060325938836e-4933L, -1.570796326794896619231321691639751442099L, UNDERFLOW_EXCEPTION);
+#endif
 
   TEST_c_c (catanh, 0.75L, 1.25L, 0.261492138795671927078652057366532140L, 0.996825126463918666098902241310446708L);
   TEST_c_c (catanh, -2, -3, -0.14694666622552975204743278515471595L, -1.3389725222944935611241935759091443L);
index 6a1016e74c37bb70c78a9fa52c3d5368c378c3e0..4b7fbad30aa06bf32181bc024b7dcbd9608f1812 100644 (file)
@@ -61,27 +61,44 @@ __catan (__complex__ double x)
     }
   else
     {
-      double r2, num, den, f;
+      if (fabs (__real__ x) >= 16.0 / DBL_EPSILON
+         || fabs (__imag__ x) >= 16.0 / DBL_EPSILON)
+       {
+         __real__ res = __copysign (M_PI_2, __real__ x);
+         if (fabs (__real__ x) <= 1.0)
+           __imag__ res = 1.0 / __imag__ x;
+         else if (fabs (__imag__ x) <= 1.0)
+           __imag__ res = __imag__ x / __real__ x / __real__ x;
+         else
+           {
+             double h = __ieee754_hypot (__real__ x / 2.0, __imag__ x / 2.0);
+             __imag__ res = __imag__ x / h / h / 4.0;
+           }
+       }
+      else
+       {
+         double r2, num, den, f;
 
-      r2 = __real__ x * __real__ x;
+         r2 = __real__ x * __real__ x;
 
-      den = 1 - r2 - __imag__ x * __imag__ x;
+         den = 1 - r2 - __imag__ x * __imag__ x;
 
-      __real__ res = 0.5 * __ieee754_atan2 (2.0 * __real__ x, den);
+         __real__ res = 0.5 * __ieee754_atan2 (2.0 * __real__ x, den);
 
-      num = __imag__ x + 1.0;
-      num = r2 + num * num;
+         num = __imag__ x + 1.0;
+         num = r2 + num * num;
 
-      den = __imag__ x - 1.0;
-      den = r2 + den * den;
+         den = __imag__ x - 1.0;
+         den = r2 + den * den;
 
-      f = num / den;
-      if (f < 0.5)
-       __imag__ res = 0.25 * __ieee754_log (f);
-      else
-       {
-         num = 4.0 * __imag__ x;
-         __imag__ res = 0.25 * __log1p (num / den);
+         f = num / den;
+         if (f < 0.5)
+           __imag__ res = 0.25 * __ieee754_log (f);
+         else
+           {
+             num = 4.0 * __imag__ x;
+             __imag__ res = 0.25 * __log1p (num / den);
+           }
        }
 
       if (fabs (__real__ res) < DBL_MIN)
index d0d188ca0b5d749fb4399b947635607d1a5e1b43..aa71e5e63a38263399dfe29186857609767a5dc4 100644 (file)
@@ -61,27 +61,45 @@ __catanf (__complex__ float x)
     }
   else
     {
-      float r2, num, den, f;
+      if (fabsf (__real__ x) >= 16.0f / FLT_EPSILON
+         || fabsf (__imag__ x) >= 16.0f / FLT_EPSILON)
+       {
+         __real__ res = __copysignf ((float) M_PI_2, __real__ x);
+         if (fabsf (__real__ x) <= 1.0f)
+           __imag__ res = 1.0f / __imag__ x;
+         else if (fabsf (__imag__ x) <= 1.0f)
+           __imag__ res = __imag__ x / __real__ x / __real__ x;
+         else
+           {
+             float h = __ieee754_hypotf (__real__ x / 2.0f,
+                                         __imag__ x / 2.0f);
+             __imag__ res = __imag__ x / h / h / 4.0f;
+           }
+       }
+      else
+       {
+         float r2, num, den, f;
 
-      r2 = __real__ x * __real__ x;
+         r2 = __real__ x * __real__ x;
 
-      den = 1 - r2 - __imag__ x * __imag__ x;
+         den = 1 - r2 - __imag__ x * __imag__ x;
 
-      __real__ res = 0.5f * __ieee754_atan2f (2.0f * __real__ x, den);
+         __real__ res = 0.5f * __ieee754_atan2f (2.0f * __real__ x, den);
 
-      num = __imag__ x + 1.0f;
-      num = r2 + num * num;
+         num = __imag__ x + 1.0f;
+         num = r2 + num * num;
 
-      den = __imag__ x - 1.0f;
-      den = r2 + den * den;
+         den = __imag__ x - 1.0f;
+         den = r2 + den * den;
 
-      f = num / den;
-      if (f < 0.5f)
-       __imag__ res = 0.25f * __ieee754_logf (f);
-      else
-       {
-         num = 4.0f * __imag__ x;
-         __imag__ res = 0.25f * __log1pf (num / den);
+         f = num / den;
+         if (f < 0.5f)
+           __imag__ res = 0.25f * __ieee754_logf (f);
+         else
+           {
+             num = 4.0f * __imag__ x;
+             __imag__ res = 0.25f * __log1pf (num / den);
+           }
        }
 
       if (fabsf (__real__ res) < FLT_MIN)
index 5d18cd639f8643a1839d18cbf93fca042021c218..55c56283b3d5c459246dc7687ed1ca6ab9446f8b 100644 (file)
@@ -56,26 +56,43 @@ __catanh (__complex__ double x)
     }
   else
     {
-      double i2 = __imag__ x * __imag__ x;
+      if (fabs (__real__ x) >= 16.0 / DBL_EPSILON
+         || fabs (__imag__ x) >= 16.0 / DBL_EPSILON)
+       {
+         __imag__ res = __copysign (M_PI_2, __imag__ x);
+         if (fabs (__imag__ x) <= 1.0)
+           __real__ res = 1.0 / __real__ x;
+         else if (fabs (__real__ x) <= 1.0)
+           __real__ res = __real__ x / __imag__ x / __imag__ x;
+         else
+           {
+             double h = __ieee754_hypot (__real__ x / 2.0, __imag__ x / 2.0);
+             __real__ res = __real__ x / h / h / 4.0;
+           }
+       }
+      else
+       {
+         double i2 = __imag__ x * __imag__ x;
 
-      double num = 1.0 + __real__ x;
-      num = i2 + num * num;
+         double num = 1.0 + __real__ x;
+         num = i2 + num * num;
 
-      double den = 1.0 - __real__ x;
-      den = i2 + den * den;
+         double den = 1.0 - __real__ x;
+         den = i2 + den * den;
 
-      double f = num / den;
-      if (f < 0.5)
-       __real__ res = 0.25 * __ieee754_log (f);
-      else
-       {
-         num = 4.0 * __real__ x;
-         __real__ res = 0.25 * __log1p (num / den);
-       }
+         double f = num / den;
+         if (f < 0.5)
+           __real__ res = 0.25 * __ieee754_log (f);
+         else
+           {
+             num = 4.0 * __real__ x;
+             __real__ res = 0.25 * __log1p (num / den);
+           }
 
-      den = 1 - __real__ x * __real__ x - i2;
+         den = 1 - __real__ x * __real__ x - i2;
 
-      __imag__ res = 0.5 * __ieee754_atan2 (2.0 * __imag__ x, den);
+         __imag__ res = 0.5 * __ieee754_atan2 (2.0 * __imag__ x, den);
+       }
 
       if (fabs (__real__ res) < DBL_MIN)
        {
index 6376a2ccb73149f660f48197c435127cafc2f947..3e879423691bb4f62765805269c9839bc4aeb446 100644 (file)
@@ -56,26 +56,44 @@ __catanhf (__complex__ float x)
     }
   else
     {
-      float i2 = __imag__ x * __imag__ x;
+      if (fabsf (__real__ x) >= 16.0f / FLT_EPSILON
+         || fabsf (__imag__ x) >= 16.0f / FLT_EPSILON)
+       {
+         __imag__ res = __copysignf ((float) M_PI_2, __imag__ x);
+         if (fabsf (__imag__ x) <= 1.0f)
+           __real__ res = 1.0f / __real__ x;
+         else if (fabsf (__real__ x) <= 1.0f)
+           __real__ res = __real__ x / __imag__ x / __imag__ x;
+         else
+           {
+             float h = __ieee754_hypotf (__real__ x / 2.0f,
+                                         __imag__ x / 2.0f);
+             __real__ res = __real__ x / h / h / 4.0f;
+           }
+       }
+      else
+       {
+         float i2 = __imag__ x * __imag__ x;
 
-      float num = 1.0f + __real__ x;
-      num = i2 + num * num;
+         float num = 1.0f + __real__ x;
+         num = i2 + num * num;
 
-      float den = 1.0f - __real__ x;
-      den = i2 + den * den;
+         float den = 1.0f - __real__ x;
+         den = i2 + den * den;
 
-      float f = num / den;
-      if (f < 0.5f)
-       __real__ res = 0.25f * __ieee754_logf (f);
-      else
-       {
-         num = 4.0f * __real__ x;
-         __real__ res = 0.25f * __log1pf (num / den);
-       }
+         float f = num / den;
+         if (f < 0.5f)
+           __real__ res = 0.25f * __ieee754_logf (f);
+         else
+           {
+             num = 4.0f * __real__ x;
+             __real__ res = 0.25f * __log1pf (num / den);
+           }
 
-      den = 1 - __real__ x * __real__ x - i2;
+         den = 1 - __real__ x * __real__ x - i2;
 
-      __imag__ res = 0.5f * __ieee754_atan2f (2.0f * __imag__ x, den);
+         __imag__ res = 0.5f * __ieee754_atan2f (2.0f * __imag__ x, den);
+       }
 
       if (fabsf (__real__ res) < FLT_MIN)
        {
index 30fd27703bfc4b33f6546ea7b5ddf518fa644efd..64c30b5573ec8f958ab208c301d0a5a8a3a40a44 100644 (file)
 #include <math_private.h>
 #include <float.h>
 
+/* To avoid spurious overflows, use this definition to treat IBM long
+   double as approximating an IEEE-style format.  */
+#if LDBL_MANT_DIG == 106
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 0x1p-106L
+#endif
+
 __complex__ long double
 __catanhl (__complex__ long double x)
 {
@@ -56,26 +63,44 @@ __catanhl (__complex__ long double x)
     }
   else
     {
-      long double i2 = __imag__ x * __imag__ x;
+      if (fabsl (__real__ x) >= 16.0L / LDBL_EPSILON
+         || fabsl (__imag__ x) >= 16.0L / LDBL_EPSILON)
+       {
+         __imag__ res = __copysignl (M_PI_2l, __imag__ x);
+         if (fabsl (__imag__ x) <= 1.0L)
+           __real__ res = 1.0L / __real__ x;
+         else if (fabsl (__real__ x) <= 1.0L)
+           __real__ res = __real__ x / __imag__ x / __imag__ x;
+         else
+           {
+             long double h = __ieee754_hypotl (__real__ x / 2.0L,
+                                               __imag__ x / 2.0L);
+             __real__ res = __real__ x / h / h / 4.0L;
+           }
+       }
+      else
+       {
+         long double i2 = __imag__ x * __imag__ x;
 
-      long double num = 1.0L + __real__ x;
-      num = i2 + num * num;
+         long double num = 1.0L + __real__ x;
+         num = i2 + num * num;
 
-      long double den = 1.0L - __real__ x;
-      den = i2 + den * den;
+         long double den = 1.0L - __real__ x;
+         den = i2 + den * den;
 
-      long double f = num / den;
-      if (f < 0.5L)
-       __real__ res = 0.25L * __ieee754_logl (f);
-      else
-       {
-         num = 4.0L * __real__ x;
-         __real__ res = 0.25L * __log1pl (num / den);
-       }
+         long double f = num / den;
+         if (f < 0.5L)
+           __real__ res = 0.25L * __ieee754_logl (f);
+         else
+           {
+             num = 4.0L * __real__ x;
+             __real__ res = 0.25L * __log1pl (num / den);
+           }
 
-      den = 1 - __real__ x * __real__ x - i2;
+         den = 1 - __real__ x * __real__ x - i2;
 
-      __imag__ res = 0.5L * __ieee754_atan2l (2.0L * __imag__ x, den);
+         __imag__ res = 0.5L * __ieee754_atan2l (2.0L * __imag__ x, den);
+       }
 
       if (fabsl (__real__ res) < LDBL_MIN)
        {
index 2440e6d151417691c92d8dd262c50957b938b2d5..17ab62d34045ee165408d8648a96000f38b8c882 100644 (file)
 #include <math_private.h>
 #include <float.h>
 
+/* To avoid spurious overflows, use this definition to treat IBM long
+   double as approximating an IEEE-style format.  */
+#if LDBL_MANT_DIG == 106
+# undef LDBL_EPSILON
+# define LDBL_EPSILON 0x1p-106L
+#endif
+
 __complex__ long double
 __catanl (__complex__ long double x)
 {
@@ -61,27 +68,45 @@ __catanl (__complex__ long double x)
     }
   else
     {
-      long double r2, num, den, f;
+      if (fabsl (__real__ x) >= 16.0L / LDBL_EPSILON
+         || fabsl (__imag__ x) >= 16.0L / LDBL_EPSILON)
+       {
+         __real__ res = __copysignl (M_PI_2l, __real__ x);
+         if (fabsl (__real__ x) <= 1.0L)
+           __imag__ res = 1.0L / __imag__ x;
+         else if (fabsl (__imag__ x) <= 1.0L)
+           __imag__ res = __imag__ x / __real__ x / __real__ x;
+         else
+           {
+             long double h = __ieee754_hypotl (__real__ x / 2.0L,
+                                               __imag__ x / 2.0L);
+             __imag__ res = __imag__ x / h / h / 4.0L;
+           }
+       }
+      else
+       {
+         long double r2, num, den, f;
 
-      r2 = __real__ x * __real__ x;
+         r2 = __real__ x * __real__ x;
 
-      den = 1 - r2 - __imag__ x * __imag__ x;
+         den = 1 - r2 - __imag__ x * __imag__ x;
 
-      __real__ res = 0.5L * __ieee754_atan2l (2.0L * __real__ x, den);
+         __real__ res = 0.5L * __ieee754_atan2l (2.0L * __real__ x, den);
 
-      num = __imag__ x + 1.0L;
-      num = r2 + num * num;
+         num = __imag__ x + 1.0L;
+         num = r2 + num * num;
 
-      den = __imag__ x - 1.0L;
-      den = r2 + den * den;
+         den = __imag__ x - 1.0L;
+         den = r2 + den * den;
 
-      f = num / den;
-      if (f < 0.5L)
-       __imag__ res = 0.25L * __ieee754_logl (f);
-      else
-       {
-         num = 4.0L * __imag__ x;
-         __imag__ res = 0.25L * __log1pl (num / den);
+         f = num / den;
+         if (f < 0.5L)
+           __imag__ res = 0.25L * __ieee754_logl (f);
+         else
+           {
+             num = 4.0L * __imag__ x;
+             __imag__ res = 0.25L * __log1pl (num / den);
+           }
        }
 
       if (fabsl (__real__ res) < LDBL_MIN)
index ce6654c73f749388ee268465064189fe83e2ab10..e36d0c374d4159ed9632cf0ff519cc7669f81b36 100644 (file)
@@ -3480,13 +3480,49 @@ double: 1
 idouble: 1
 
 # catan
+Test "Imaginary part of: catan (-0x1.fp1023 + 0x1.fp1023 i) == -1.570796326794896619231321691639751442099 + 2.871063043235098558826106732041811695767e-309 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (-0x1.fp1023 - 0x1.fp1023 i) == -1.570796326794896619231321691639751442099 - 2.871063043235098558826106732041811695767e-309 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (-0x1.fp127 + 0x1.fp127 i) == -1.570796326794896619231321691639751442097 + 1.516766904286822590927401983512575068153e-39 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (-0x1.fp127 - 0x1.fp127 i) == -1.570796326794896619231321691639751442097 - 1.516766904286822590927401983512575068153e-39 i":
+ildouble: 1
+ldouble: 1
 Test "Imaginary part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
 double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "Imaginary part of: catan (0x1.fp1023 + 0x1.fp1023 i) == 1.570796326794896619231321691639751442099 + 2.871063043235098558826106732041811695767e-309 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (0x1.fp1023 - 0x1.fp1023 i) == 1.570796326794896619231321691639751442099 - 2.871063043235098558826106732041811695767e-309 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (0x1.fp127 + 0x1.fp127 i) == 1.570796326794896619231321691639751442097 + 1.516766904286822590927401983512575068153e-39 i":
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (0x1.fp127 - 0x1.fp127 i) == 1.570796326794896619231321691639751442097 - 1.516766904286822590927401983512575068153e-39 i":
+ildouble: 1
+ldouble: 1
 
 # catanh
+Test "Real part of: catanh (-0x1.fp1023 + 0x1.fp1023 i) == -2.871063043235098558826106732041811695767e-309 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (-0x1.fp1023 - 0x1.fp1023 i) == -2.871063043235098558826106732041811695767e-309 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (-0x1.fp127 + 0x1.fp127 i) == -1.516766904286822590927401983512575068153e-39 + 1.570796326794896619231321691639751442097 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (-0x1.fp127 - 0x1.fp127 i) == -1.516766904286822590927401983512575068153e-39 - 1.570796326794896619231321691639751442097 i":
+ildouble: 1
+ldouble: 1
 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
 double: 2
 float: 1
@@ -3499,6 +3535,18 @@ double: 1
 idouble: 1
 ildouble: 1
 ldouble: 1
+Test "Real part of: catanh (0x1.fp1023 + 0x1.fp1023 i) == 2.871063043235098558826106732041811695767e-309 + 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (0x1.fp1023 - 0x1.fp1023 i) == 2.871063043235098558826106732041811695767e-309 - 1.570796326794896619231321691639751442099 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (0x1.fp127 + 0x1.fp127 i) == 1.516766904286822590927401983512575068153e-39 + 1.570796326794896619231321691639751442097 i":
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (0x1.fp127 - 0x1.fp127 i) == 1.516766904286822590927401983512575068153e-39 - 1.570796326794896619231321691639751442097 i":
+ildouble: 1
+ldouble: 1
 
 # cbrt
 Test "cbrt (-27.0) == -3.0":
@@ -6236,6 +6284,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "catanh":
 double: 2
index 958848180f66e9a3d91e92b49f06af083eee706c..43b5595c5a9d611d2b1403cd80d6a223bb859a8c 100644 (file)
@@ -4205,6 +4205,26 @@ double: 1
 idouble: 1
 
 # catan
+Test "Imaginary part of: catan (-0x1.fp1023 + 0x1.fp1023 i) == -1.570796326794896619231321691639751442099 + 2.871063043235098558826106732041811695767e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (-0x1.fp1023 - 0x1.fp1023 i) == -1.570796326794896619231321691639751442099 - 2.871063043235098558826106732041811695767e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (-0x1.fp127 + 0x1.fp127 i) == -1.570796326794896619231321691639751442097 + 1.516766904286822590927401983512575068153e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (-0x1.fp127 - 0x1.fp127 i) == -1.570796326794896619231321691639751442097 - 1.516766904286822590927401983512575068153e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: catan (-2 - 3 i) == -1.4099210495965755225306193844604208 - 0.22907268296853876629588180294200276 i":
 float: 3
 ifloat: 3
@@ -4216,8 +4236,48 @@ ifloat: 1
 Test "Real part of: catan (0.75 + 1.25 i) == 1.10714871779409050301706546017853704 + 0.549306144334054845697622618461262852 i":
 float: 4
 ifloat: 4
+Test "Imaginary part of: catan (0x1.fp1023 + 0x1.fp1023 i) == 1.570796326794896619231321691639751442099 + 2.871063043235098558826106732041811695767e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (0x1.fp1023 - 0x1.fp1023 i) == 1.570796326794896619231321691639751442099 - 2.871063043235098558826106732041811695767e-309 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (0x1.fp127 + 0x1.fp127 i) == 1.570796326794896619231321691639751442097 + 1.516766904286822590927401983512575068153e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Imaginary part of: catan (0x1.fp127 - 0x1.fp127 i) == 1.570796326794896619231321691639751442097 - 1.516766904286822590927401983512575068153e-39 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
 
 # catanh
+Test "Real part of: catanh (-0x1.fp1023 + 0x1.fp1023 i) == -2.871063043235098558826106732041811695767e-309 + 1.570796326794896619231321691639751442099 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (-0x1.fp1023 - 0x1.fp1023 i) == -2.871063043235098558826106732041811695767e-309 - 1.570796326794896619231321691639751442099 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (-0x1.fp127 + 0x1.fp127 i) == -1.516766904286822590927401983512575068153e-39 + 1.570796326794896619231321691639751442097 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (-0x1.fp127 - 0x1.fp127 i) == -1.516766904286822590927401983512575068153e-39 - 1.570796326794896619231321691639751442097 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
 Test "Real part of: catanh (-2 - 3 i) == -0.14694666622552975204743278515471595 - 1.3389725222944935611241935759091443 i":
 double: 4
 idouble: 4
@@ -4234,6 +4294,26 @@ ldouble: 1
 Test "Imaginary part of: catanh (0.75 + 1.25 i) == 0.261492138795671927078652057366532140 + 0.996825126463918666098902241310446708 i":
 float: 6
 ifloat: 6
+Test "Real part of: catanh (0x1.fp1023 + 0x1.fp1023 i) == 2.871063043235098558826106732041811695767e-309 + 1.570796326794896619231321691639751442099 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (0x1.fp1023 - 0x1.fp1023 i) == 2.871063043235098558826106732041811695767e-309 - 1.570796326794896619231321691639751442099 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (0x1.fp127 + 0x1.fp127 i) == 1.516766904286822590927401983512575068153e-39 + 1.570796326794896619231321691639751442097 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
+Test "Real part of: catanh (0x1.fp127 - 0x1.fp127 i) == 1.516766904286822590927401983512575068153e-39 - 1.570796326794896619231321691639751442097 i":
+double: 1
+idouble: 1
+ildouble: 1
+ldouble: 1
 
 # cbrt
 Test "cbrt (-0.001) == -0.1":
@@ -6780,6 +6860,8 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+ildouble: 1
+ldouble: 1
 
 Function: Real part of "catanh":
 double: 4