[PATCHv3,04/11] Replace M_PI2l with lit_pi_2_d in libm-test.inc
diff mbox

Message ID 4ca0519767695877982b62ebf320e2edb2deb2c1.1464297421.git.murphyp@linux.vnet.ibm.com
State New
Headers show

Commit Message

Paul E. Murphy May 26, 2016, 9:42 p.m. UTC
This is useful in situations where the long double type is
less precise than the type under test.  This adds a new
wrapper macro LITM(x) to each type to append the proper
suffix onto macro constants found in math.h.

	* libm-test.inc: Replace usage of M_PI2l with
	(lit_pi_2_d): New macro.

	* math/test-double.h (LITM): New macro.
	* math/test-float.h (LITM): Likewise.
	* math/test-ldouble.h (LITM): Likewise.
---
 math/libm-test.inc  | 316 ++++++++++++++++++++++++++--------------------------
 math/test-double.h  |   1 +
 math/test-float.h   |   2 +
 math/test-ldouble.h |   1 +
 4 files changed, 163 insertions(+), 157 deletions(-)

Comments

Joseph Myers May 27, 2016, 1:31 p.m. UTC | #1
On Thu, 26 May 2016, Paul E. Murphy wrote:

> This is useful in situations where the long double type is
> less precise than the type under test.  This adds a new
> wrapper macro LITM(x) to each type to append the proper
> suffix onto macro constants found in math.h.
> 
> 	* libm-test.inc: Replace usage of M_PI2l with
> 	(lit_pi_2_d): New macro.
> 
> 	* math/test-double.h (LITM): New macro.
> 	* math/test-float.h (LITM): Likewise.
> 	* math/test-ldouble.h (LITM): Likewise.

OK.
Paul E. Murphy May 27, 2016, 5:12 p.m. UTC | #2
On 05/27/2016 08:31 AM, Joseph Myers wrote:
> On Thu, 26 May 2016, Paul E. Murphy wrote:
> 
>> This is useful in situations where the long double type is
>> less precise than the type under test.  This adds a new
>> wrapper macro LITM(x) to each type to append the proper
>> suffix onto macro constants found in math.h.
>>
>> 	* libm-test.inc: Replace usage of M_PI2l with
>> 	(lit_pi_2_d): New macro.
>>
>> 	* math/test-double.h (LITM): New macro.
>> 	* math/test-float.h (LITM): Likewise.
>> 	* math/test-ldouble.h (LITM): Likewise.
> 
> OK.
> 

Committed as 84ba459.

Patch
diff mbox

diff --git a/math/libm-test.inc b/math/libm-test.inc
index 4cd1db6..a23b812 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -321,6 +321,8 @@  struct ulp_data
 #define lit_pi_4_ln10_m_d	LIT (0.341094088460460336871445906357838943)
 /* pi / ln(10) */
 #define lit_pi_ln10_d		LIT (1.364376353841841347485783625431355770)
+/* pi / 2 */
+#define lit_pi_2_d		LITM (M_PI_2)
 
 #define ulps_file_name "ULPs"	/* Name of the ULPs file.  */
 static FILE *ulps_file;		/* File to document difference.  */
@@ -1900,8 +1902,8 @@  asinh_test (void)
 
 static const struct test_f_f_data atan_test_data[] =
   {
-    TEST_f_f (atan, plus_infty, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_f_f (atan, minus_infty, -M_PI_2l, ERRNO_UNCHANGED),
+    TEST_f_f (atan, plus_infty, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_f_f (atan, minus_infty, -lit_pi_2_d, ERRNO_UNCHANGED),
     TEST_f_f (atan, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
     TEST_f_f (atan, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
     TEST_f_f (atan, snan_value, qnan_value, INVALID_EXCEPTION),
@@ -1959,28 +1961,28 @@  static const struct test_ff_f_data atan2_test_data[] =
     TEST_ff_f (atan2, -max_value, plus_infty, minus_zero, ERRNO_UNCHANGED),
 
     /* atan2(+inf, x) == pi/2 for finite x.  */
-    TEST_ff_f (atan2, plus_infty, 1, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, plus_zero, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, min_value, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, min_subnorm_value, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, max_value, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, -1, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, minus_zero, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, -min_value, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, -min_subnorm_value, M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, plus_infty, -max_value, M_PI_2l, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, 1, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, plus_zero, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, min_value, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, min_subnorm_value, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, max_value, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, -1, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, minus_zero, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, -min_value, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, -min_subnorm_value, lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_infty, -max_value, lit_pi_2_d, ERRNO_UNCHANGED),
 
     /* atan2(-inf, x) == -pi/2 for finite x.  */
-    TEST_ff_f (atan2, minus_infty, 1, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, plus_zero, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, min_value, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, min_subnorm_value, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, max_value, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, -1, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, minus_zero, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, -min_value, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, -min_subnorm_value, -M_PI_2l, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_infty, -max_value, -M_PI_2l, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, 1, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, plus_zero, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, min_value, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, min_subnorm_value, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, max_value, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, -1, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, minus_zero, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, -min_value, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, -min_subnorm_value, -lit_pi_2_d, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_infty, -max_value, -lit_pi_2_d, ERRNO_UNCHANGED),
 
     /* atan2 (y,-inf) == +pi for finite y > 0 or +0.  */
     TEST_ff_f (atan2, 1, minus_infty, M_PIl, ERRNO_UNCHANGED),
@@ -2086,10 +2088,10 @@  cabs_test (void)
 
 static const struct test_c_c_data cacos_test_data[] =
   {
-    TEST_c_c (cacos, 0, 0, M_PI_2l, minus_zero),
-    TEST_c_c (cacos, minus_zero, 0, M_PI_2l, minus_zero),
-    TEST_c_c (cacos, minus_zero, minus_zero, M_PI_2l, 0.0),
-    TEST_c_c (cacos, 0, minus_zero, M_PI_2l, 0.0),
+    TEST_c_c (cacos, 0, 0, lit_pi_2_d, minus_zero),
+    TEST_c_c (cacos, minus_zero, 0, lit_pi_2_d, minus_zero),
+    TEST_c_c (cacos, minus_zero, minus_zero, lit_pi_2_d, 0.0),
+    TEST_c_c (cacos, 0, minus_zero, lit_pi_2_d, 0.0),
 
     TEST_c_c (cacos, minus_infty, plus_infty, lit_pi_3_m_4_d, minus_infty),
     TEST_c_c (cacos, minus_infty, minus_infty, lit_pi_3_m_4_d, plus_infty),
@@ -2097,12 +2099,12 @@  static const struct test_c_c_data cacos_test_data[] =
     TEST_c_c (cacos, plus_infty, plus_infty, M_PI_4l, minus_infty),
     TEST_c_c (cacos, plus_infty, minus_infty, M_PI_4l, plus_infty),
 
-    TEST_c_c (cacos, -10.0, plus_infty, M_PI_2l, minus_infty),
-    TEST_c_c (cacos, -10.0, minus_infty, M_PI_2l, plus_infty),
-    TEST_c_c (cacos, 0, plus_infty, M_PI_2l, minus_infty),
-    TEST_c_c (cacos, 0, minus_infty, M_PI_2l, plus_infty),
-    TEST_c_c (cacos, 0.1L, plus_infty, M_PI_2l, minus_infty),
-    TEST_c_c (cacos, 0.1L, minus_infty, M_PI_2l, plus_infty),
+    TEST_c_c (cacos, -10.0, plus_infty, lit_pi_2_d, minus_infty),
+    TEST_c_c (cacos, -10.0, minus_infty, lit_pi_2_d, plus_infty),
+    TEST_c_c (cacos, 0, plus_infty, lit_pi_2_d, minus_infty),
+    TEST_c_c (cacos, 0, minus_infty, lit_pi_2_d, plus_infty),
+    TEST_c_c (cacos, 0.1L, plus_infty, lit_pi_2_d, minus_infty),
+    TEST_c_c (cacos, 0.1L, minus_infty, lit_pi_2_d, plus_infty),
 
     TEST_c_c (cacos, minus_infty, 0, M_PIl, minus_infty),
     TEST_c_c (cacos, minus_infty, minus_zero, M_PIl, plus_infty),
@@ -2117,8 +2119,8 @@  static const struct test_c_c_data cacos_test_data[] =
     TEST_c_c (cacos, plus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN),
     TEST_c_c (cacos, minus_infty, qnan_value, qnan_value, plus_infty, IGNORE_ZERO_INF_SIGN),
 
-    TEST_c_c (cacos, 0, qnan_value, M_PI_2l, qnan_value),
-    TEST_c_c (cacos, minus_zero, qnan_value, M_PI_2l, qnan_value),
+    TEST_c_c (cacos, 0, qnan_value, lit_pi_2_d, qnan_value),
+    TEST_c_c (cacos, minus_zero, qnan_value, lit_pi_2_d, qnan_value),
 
     TEST_c_c (cacos, qnan_value, plus_infty, qnan_value, minus_infty),
     TEST_c_c (cacos, qnan_value, minus_infty, qnan_value, plus_infty),
@@ -2131,18 +2133,18 @@  static const struct test_c_c_data cacos_test_data[] =
 
     TEST_c_c (cacos, qnan_value, qnan_value, qnan_value, qnan_value),
 
-    TEST_c_c (cacos, plus_zero, -1.5L, M_PI_2l, 1.194763217287109304111930828519090523536L),
-    TEST_c_c (cacos, minus_zero, -1.5L, M_PI_2l, 1.194763217287109304111930828519090523536L),
-    TEST_c_c (cacos, plus_zero, -1.0L, M_PI_2l, 0.8813735870195430252326093249797923090282L),
-    TEST_c_c (cacos, minus_zero, -1.0L, M_PI_2l, 0.8813735870195430252326093249797923090282L),
-    TEST_c_c (cacos, plus_zero, -0.5L, M_PI_2l, 0.4812118250596034474977589134243684231352L),
-    TEST_c_c (cacos, minus_zero, -0.5L, M_PI_2l, 0.4812118250596034474977589134243684231352L),
-    TEST_c_c (cacos, plus_zero, 0.5L, M_PI_2l, -0.4812118250596034474977589134243684231352L),
-    TEST_c_c (cacos, minus_zero, 0.5L, M_PI_2l, -0.4812118250596034474977589134243684231352L),
-    TEST_c_c (cacos, plus_zero, 1.0L, M_PI_2l, -0.8813735870195430252326093249797923090282L),
-    TEST_c_c (cacos, minus_zero, 1.0L, M_PI_2l, -0.8813735870195430252326093249797923090282L),
-    TEST_c_c (cacos, plus_zero, 1.5L, M_PI_2l, -1.194763217287109304111930828519090523536L),
-    TEST_c_c (cacos, minus_zero, 1.5L, M_PI_2l, -1.194763217287109304111930828519090523536L),
+    TEST_c_c (cacos, plus_zero, -1.5L, lit_pi_2_d, 1.194763217287109304111930828519090523536L),
+    TEST_c_c (cacos, minus_zero, -1.5L, lit_pi_2_d, 1.194763217287109304111930828519090523536L),
+    TEST_c_c (cacos, plus_zero, -1.0L, lit_pi_2_d, 0.8813735870195430252326093249797923090282L),
+    TEST_c_c (cacos, minus_zero, -1.0L, lit_pi_2_d, 0.8813735870195430252326093249797923090282L),
+    TEST_c_c (cacos, plus_zero, -0.5L, lit_pi_2_d, 0.4812118250596034474977589134243684231352L),
+    TEST_c_c (cacos, minus_zero, -0.5L, lit_pi_2_d, 0.4812118250596034474977589134243684231352L),
+    TEST_c_c (cacos, plus_zero, 0.5L, lit_pi_2_d, -0.4812118250596034474977589134243684231352L),
+    TEST_c_c (cacos, minus_zero, 0.5L, lit_pi_2_d, -0.4812118250596034474977589134243684231352L),
+    TEST_c_c (cacos, plus_zero, 1.0L, lit_pi_2_d, -0.8813735870195430252326093249797923090282L),
+    TEST_c_c (cacos, minus_zero, 1.0L, lit_pi_2_d, -0.8813735870195430252326093249797923090282L),
+    TEST_c_c (cacos, plus_zero, 1.5L, lit_pi_2_d, -1.194763217287109304111930828519090523536L),
+    TEST_c_c (cacos, minus_zero, 1.5L, lit_pi_2_d, -1.194763217287109304111930828519090523536L),
 
     TEST_c_c (cacos, -1.5L, plus_zero, M_PIl, -0.9624236501192068949955178268487368462704L),
     TEST_c_c (cacos, -1.5L, minus_zero, M_PIl, 0.9624236501192068949955178268487368462704L),
@@ -2774,22 +2776,22 @@  cacos_test (void)
 
 static const struct test_c_c_data cacosh_test_data[] =
   {
-    TEST_c_c (cacosh, 0, 0, 0.0, M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, 0, 0.0, M_PI_2l),
-    TEST_c_c (cacosh, 0, minus_zero, 0.0, -M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, minus_zero, 0.0, -M_PI_2l),
+    TEST_c_c (cacosh, 0, 0, 0.0, lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, 0, 0.0, lit_pi_2_d),
+    TEST_c_c (cacosh, 0, minus_zero, 0.0, -lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, minus_zero, 0.0, -lit_pi_2_d),
     TEST_c_c (cacosh, minus_infty, plus_infty, plus_infty, lit_pi_3_m_4_d),
     TEST_c_c (cacosh, minus_infty, minus_infty, plus_infty, -lit_pi_3_m_4_d),
 
     TEST_c_c (cacosh, plus_infty, plus_infty, plus_infty, M_PI_4l),
     TEST_c_c (cacosh, plus_infty, minus_infty, plus_infty, -M_PI_4l),
 
-    TEST_c_c (cacosh, -10.0, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (cacosh, -10.0, minus_infty, plus_infty, -M_PI_2l),
-    TEST_c_c (cacosh, 0, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (cacosh, 0, minus_infty, plus_infty, -M_PI_2l),
-    TEST_c_c (cacosh, 0.1L, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (cacosh, 0.1L, minus_infty, plus_infty, -M_PI_2l),
+    TEST_c_c (cacosh, -10.0, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (cacosh, -10.0, minus_infty, plus_infty, -lit_pi_2_d),
+    TEST_c_c (cacosh, 0, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (cacosh, 0, minus_infty, plus_infty, -lit_pi_2_d),
+    TEST_c_c (cacosh, 0.1L, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (cacosh, 0.1L, minus_infty, plus_infty, -lit_pi_2_d),
 
     TEST_c_c (cacosh, minus_infty, 0, plus_infty, M_PIl),
     TEST_c_c (cacosh, minus_infty, minus_zero, plus_infty, -M_PIl),
@@ -2818,18 +2820,18 @@  static const struct test_c_c_data cacosh_test_data[] =
 
     TEST_c_c (cacosh, qnan_value, qnan_value, qnan_value, qnan_value),
 
-    TEST_c_c (cacosh, plus_zero, -1.5L, 1.194763217287109304111930828519090523536L, -M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, -1.5L, 1.194763217287109304111930828519090523536L, -M_PI_2l),
-    TEST_c_c (cacosh, plus_zero, -1.0L, 0.8813735870195430252326093249797923090282L, -M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, -1.0L, 0.8813735870195430252326093249797923090282L, -M_PI_2l),
-    TEST_c_c (cacosh, plus_zero, -0.5L, 0.4812118250596034474977589134243684231352L, -M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, -0.5L, 0.4812118250596034474977589134243684231352L, -M_PI_2l),
-    TEST_c_c (cacosh, plus_zero, 0.5L, 0.4812118250596034474977589134243684231352L, M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, 0.5L, 0.4812118250596034474977589134243684231352L, M_PI_2l),
-    TEST_c_c (cacosh, plus_zero, 1.0L, 0.8813735870195430252326093249797923090282L, M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, 1.0L, 0.8813735870195430252326093249797923090282L, M_PI_2l),
-    TEST_c_c (cacosh, plus_zero, 1.5L, 1.194763217287109304111930828519090523536L, M_PI_2l),
-    TEST_c_c (cacosh, minus_zero, 1.5L, 1.194763217287109304111930828519090523536L, M_PI_2l),
+    TEST_c_c (cacosh, plus_zero, -1.5L, 1.194763217287109304111930828519090523536L, -lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, -1.5L, 1.194763217287109304111930828519090523536L, -lit_pi_2_d),
+    TEST_c_c (cacosh, plus_zero, -1.0L, 0.8813735870195430252326093249797923090282L, -lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, -1.0L, 0.8813735870195430252326093249797923090282L, -lit_pi_2_d),
+    TEST_c_c (cacosh, plus_zero, -0.5L, 0.4812118250596034474977589134243684231352L, -lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, -0.5L, 0.4812118250596034474977589134243684231352L, -lit_pi_2_d),
+    TEST_c_c (cacosh, plus_zero, 0.5L, 0.4812118250596034474977589134243684231352L, lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, 0.5L, 0.4812118250596034474977589134243684231352L, lit_pi_2_d),
+    TEST_c_c (cacosh, plus_zero, 1.0L, 0.8813735870195430252326093249797923090282L, lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, 1.0L, 0.8813735870195430252326093249797923090282L, lit_pi_2_d),
+    TEST_c_c (cacosh, plus_zero, 1.5L, 1.194763217287109304111930828519090523536L, lit_pi_2_d),
+    TEST_c_c (cacosh, minus_zero, 1.5L, 1.194763217287109304111930828519090523536L, lit_pi_2_d),
 
     TEST_c_c (cacosh, -1.5L, plus_zero, 0.9624236501192068949955178268487368462704L, M_PIl),
     TEST_c_c (cacosh, -1.5L, minus_zero, 0.9624236501192068949955178268487368462704L, -M_PIl),
@@ -3466,10 +3468,10 @@  static const struct test_c_f_data carg_test_data[] =
     TEST_c_f (carg, plus_infty, -2.0, minus_zero),
 
     /* carg(x + i inf) == pi/2 for finite x.  */
-    TEST_c_f (carg, 10.0, plus_infty, M_PI_2l),
+    TEST_c_f (carg, 10.0, plus_infty, lit_pi_2_d),
 
     /* carg(x - i inf) == -pi/2 for finite x.  */
-    TEST_c_f (carg, 10.0, minus_infty, -M_PI_2l),
+    TEST_c_f (carg, 10.0, minus_infty, -lit_pi_2_d),
 
     /* carg (-inf + i y) == +pi for finite y > 0.  */
     TEST_c_f (carg, minus_infty, 10.0, M_PIl),
@@ -3517,15 +3519,15 @@  static const struct test_c_c_data casin_test_data[] =
     TEST_c_c (casin, 0.1L, plus_infty, 0.0, plus_infty),
     TEST_c_c (casin, 0.1L, minus_infty, 0.0, minus_infty),
 
-    TEST_c_c (casin, minus_infty, 0, -M_PI_2l, plus_infty),
-    TEST_c_c (casin, minus_infty, minus_zero, -M_PI_2l, minus_infty),
-    TEST_c_c (casin, minus_infty, 100, -M_PI_2l, plus_infty),
-    TEST_c_c (casin, minus_infty, -100, -M_PI_2l, minus_infty),
+    TEST_c_c (casin, minus_infty, 0, -lit_pi_2_d, plus_infty),
+    TEST_c_c (casin, minus_infty, minus_zero, -lit_pi_2_d, minus_infty),
+    TEST_c_c (casin, minus_infty, 100, -lit_pi_2_d, plus_infty),
+    TEST_c_c (casin, minus_infty, -100, -lit_pi_2_d, minus_infty),
 
-    TEST_c_c (casin, plus_infty, 0, M_PI_2l, plus_infty),
-    TEST_c_c (casin, plus_infty, minus_zero, M_PI_2l, minus_infty),
-    TEST_c_c (casin, plus_infty, 0.5, M_PI_2l, plus_infty),
-    TEST_c_c (casin, plus_infty, -0.5, M_PI_2l, minus_infty),
+    TEST_c_c (casin, plus_infty, 0, lit_pi_2_d, plus_infty),
+    TEST_c_c (casin, plus_infty, minus_zero, lit_pi_2_d, minus_infty),
+    TEST_c_c (casin, plus_infty, 0.5, lit_pi_2_d, plus_infty),
+    TEST_c_c (casin, plus_infty, -0.5, lit_pi_2_d, minus_infty),
 
     TEST_c_c (casin, qnan_value, plus_infty, qnan_value, plus_infty),
     TEST_c_c (casin, qnan_value, minus_infty, qnan_value, minus_infty),
@@ -3557,18 +3559,18 @@  static const struct test_c_c_data casin_test_data[] =
     TEST_c_c (casin, plus_zero, 1.5L, plus_zero, 1.194763217287109304111930828519090523536L),
     TEST_c_c (casin, minus_zero, 1.5L, minus_zero, 1.194763217287109304111930828519090523536L),
 
-    TEST_c_c (casin, -1.5L, plus_zero, -M_PI_2l, 0.9624236501192068949955178268487368462704L),
-    TEST_c_c (casin, -1.5L, minus_zero, -M_PI_2l, -0.9624236501192068949955178268487368462704L),
-    TEST_c_c (casin, -1.0L, plus_zero, -M_PI_2l, plus_zero),
-    TEST_c_c (casin, -1.0L, minus_zero, -M_PI_2l, minus_zero),
+    TEST_c_c (casin, -1.5L, plus_zero, -lit_pi_2_d, 0.9624236501192068949955178268487368462704L),
+    TEST_c_c (casin, -1.5L, minus_zero, -lit_pi_2_d, -0.9624236501192068949955178268487368462704L),
+    TEST_c_c (casin, -1.0L, plus_zero, -lit_pi_2_d, plus_zero),
+    TEST_c_c (casin, -1.0L, minus_zero, -lit_pi_2_d, minus_zero),
     TEST_c_c (casin, -0.5L, plus_zero, -0.5235987755982988730771072305465838140329L, plus_zero),
     TEST_c_c (casin, -0.5L, minus_zero, -0.5235987755982988730771072305465838140329L, minus_zero),
     TEST_c_c (casin, 0.5L, plus_zero, 0.5235987755982988730771072305465838140329L, plus_zero),
     TEST_c_c (casin, 0.5L, minus_zero, 0.5235987755982988730771072305465838140329L, minus_zero),
-    TEST_c_c (casin, 1.0L, plus_zero, M_PI_2l, plus_zero),
-    TEST_c_c (casin, 1.0L, minus_zero, M_PI_2l, minus_zero),
-    TEST_c_c (casin, 1.5L, plus_zero, M_PI_2l, 0.9624236501192068949955178268487368462704L),
-    TEST_c_c (casin, 1.5L, minus_zero, M_PI_2l, -0.9624236501192068949955178268487368462704L),
+    TEST_c_c (casin, 1.0L, plus_zero, lit_pi_2_d, plus_zero),
+    TEST_c_c (casin, 1.0L, minus_zero, lit_pi_2_d, minus_zero),
+    TEST_c_c (casin, 1.5L, plus_zero, lit_pi_2_d, 0.9624236501192068949955178268487368462704L),
+    TEST_c_c (casin, 1.5L, minus_zero, lit_pi_2_d, -0.9624236501192068949955178268487368462704L),
 
     TEST_c_c (casin, 0x1p50L, 1.0L, 1.570796326794895731052901991514519103193L, 3.535050620855721078027883819436720218708e1L),
     TEST_c_c (casin, 0x1p50L, -1.0L, 1.570796326794895731052901991514519103193L, -3.535050620855721078027883819436720218708e1L),
@@ -4198,14 +4200,14 @@  static const struct test_c_c_data casinh_test_data[] =
     TEST_c_c (casinh, minus_infty, plus_infty, minus_infty, M_PI_4l),
     TEST_c_c (casinh, minus_infty, minus_infty, minus_infty, -M_PI_4l),
 
-    TEST_c_c (casinh, -10.0, plus_infty, minus_infty, M_PI_2l),
-    TEST_c_c (casinh, -10.0, minus_infty, minus_infty, -M_PI_2l),
-    TEST_c_c (casinh, 0, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (casinh, 0, minus_infty, plus_infty, -M_PI_2l),
-    TEST_c_c (casinh, minus_zero, plus_infty, minus_infty, M_PI_2l),
-    TEST_c_c (casinh, minus_zero, minus_infty, minus_infty, -M_PI_2l),
-    TEST_c_c (casinh, 0.1L, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (casinh, 0.1L, minus_infty, plus_infty, -M_PI_2l),
+    TEST_c_c (casinh, -10.0, plus_infty, minus_infty, lit_pi_2_d),
+    TEST_c_c (casinh, -10.0, minus_infty, minus_infty, -lit_pi_2_d),
+    TEST_c_c (casinh, 0, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (casinh, 0, minus_infty, plus_infty, -lit_pi_2_d),
+    TEST_c_c (casinh, minus_zero, plus_infty, minus_infty, lit_pi_2_d),
+    TEST_c_c (casinh, minus_zero, minus_infty, minus_infty, -lit_pi_2_d),
+    TEST_c_c (casinh, 0.1L, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (casinh, 0.1L, minus_infty, plus_infty, -lit_pi_2_d),
 
     TEST_c_c (casinh, minus_infty, 0, minus_infty, 0.0),
     TEST_c_c (casinh, minus_infty, minus_zero, minus_infty, minus_zero),
@@ -4234,18 +4236,18 @@  static const struct test_c_c_data casinh_test_data[] =
 
     TEST_c_c (casinh, qnan_value, qnan_value, qnan_value, qnan_value),
 
-    TEST_c_c (casinh, plus_zero, -1.5L, 0.9624236501192068949955178268487368462704L, -M_PI_2l),
-    TEST_c_c (casinh, minus_zero, -1.5L, -0.9624236501192068949955178268487368462704L, -M_PI_2l),
-    TEST_c_c (casinh, plus_zero, -1.0L, plus_zero, -M_PI_2l),
-    TEST_c_c (casinh, minus_zero, -1.0L, minus_zero, -M_PI_2l),
+    TEST_c_c (casinh, plus_zero, -1.5L, 0.9624236501192068949955178268487368462704L, -lit_pi_2_d),
+    TEST_c_c (casinh, minus_zero, -1.5L, -0.9624236501192068949955178268487368462704L, -lit_pi_2_d),
+    TEST_c_c (casinh, plus_zero, -1.0L, plus_zero, -lit_pi_2_d),
+    TEST_c_c (casinh, minus_zero, -1.0L, minus_zero, -lit_pi_2_d),
     TEST_c_c (casinh, plus_zero, -0.5L, plus_zero, -0.5235987755982988730771072305465838140329L),
     TEST_c_c (casinh, minus_zero, -0.5L, minus_zero, -0.5235987755982988730771072305465838140329L),
     TEST_c_c (casinh, plus_zero, 0.5L, plus_zero, 0.5235987755982988730771072305465838140329L),
     TEST_c_c (casinh, minus_zero, 0.5L, minus_zero, 0.5235987755982988730771072305465838140329L),
-    TEST_c_c (casinh, plus_zero, 1.0L, plus_zero, M_PI_2l),
-    TEST_c_c (casinh, minus_zero, 1.0L, minus_zero, M_PI_2l),
-    TEST_c_c (casinh, plus_zero, 1.5L, 0.9624236501192068949955178268487368462704L, M_PI_2l),
-    TEST_c_c (casinh, minus_zero, 1.5L, -0.9624236501192068949955178268487368462704L, M_PI_2l),
+    TEST_c_c (casinh, plus_zero, 1.0L, plus_zero, lit_pi_2_d),
+    TEST_c_c (casinh, minus_zero, 1.0L, minus_zero, lit_pi_2_d),
+    TEST_c_c (casinh, plus_zero, 1.5L, 0.9624236501192068949955178268487368462704L, lit_pi_2_d),
+    TEST_c_c (casinh, minus_zero, 1.5L, -0.9624236501192068949955178268487368462704L, lit_pi_2_d),
 
     TEST_c_c (casinh, -1.5L, plus_zero, -1.194763217287109304111930828519090523536L, plus_zero),
     TEST_c_c (casinh, -1.5L, minus_zero, -1.194763217287109304111930828519090523536L, minus_zero),
@@ -4892,30 +4894,30 @@  static const struct test_c_c_data catan_test_data[] =
     TEST_c_c (catan, plus_zero, -1.0L, plus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
     TEST_c_c (catan, minus_zero, -1.0L, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
 
-    TEST_c_c (catan, plus_infty, plus_infty, M_PI_2l, 0),
-    TEST_c_c (catan, plus_infty, minus_infty, M_PI_2l, minus_zero),
-    TEST_c_c (catan, minus_infty, plus_infty, -M_PI_2l, 0),
-    TEST_c_c (catan, minus_infty, minus_infty, -M_PI_2l, minus_zero),
+    TEST_c_c (catan, plus_infty, plus_infty, lit_pi_2_d, 0),
+    TEST_c_c (catan, plus_infty, minus_infty, lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, minus_infty, plus_infty, -lit_pi_2_d, 0),
+    TEST_c_c (catan, minus_infty, minus_infty, -lit_pi_2_d, minus_zero),
 
 
-    TEST_c_c (catan, plus_infty, -10.0, M_PI_2l, minus_zero),
-    TEST_c_c (catan, minus_infty, -10.0, -M_PI_2l, minus_zero),
-    TEST_c_c (catan, plus_infty, minus_zero, M_PI_2l, minus_zero),
-    TEST_c_c (catan, minus_infty, minus_zero, -M_PI_2l, minus_zero),
-    TEST_c_c (catan, plus_infty, 0.0, M_PI_2l, 0),
-    TEST_c_c (catan, minus_infty, 0.0, -M_PI_2l, 0),
-    TEST_c_c (catan, plus_infty, 0.1L, M_PI_2l, 0),
-    TEST_c_c (catan, minus_infty, 0.1L, -M_PI_2l, 0),
+    TEST_c_c (catan, plus_infty, -10.0, lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, minus_infty, -10.0, -lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, plus_infty, minus_zero, lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, minus_infty, minus_zero, -lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, plus_infty, 0.0, lit_pi_2_d, 0),
+    TEST_c_c (catan, minus_infty, 0.0, -lit_pi_2_d, 0),
+    TEST_c_c (catan, plus_infty, 0.1L, lit_pi_2_d, 0),
+    TEST_c_c (catan, minus_infty, 0.1L, -lit_pi_2_d, 0),
 
-    TEST_c_c (catan, 0.0, minus_infty, M_PI_2l, minus_zero),
-    TEST_c_c (catan, minus_zero, minus_infty, -M_PI_2l, minus_zero),
-    TEST_c_c (catan, 100.0, minus_infty, M_PI_2l, minus_zero),
-    TEST_c_c (catan, -100.0, minus_infty, -M_PI_2l, minus_zero),
+    TEST_c_c (catan, 0.0, minus_infty, lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, minus_zero, minus_infty, -lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, 100.0, minus_infty, lit_pi_2_d, minus_zero),
+    TEST_c_c (catan, -100.0, minus_infty, -lit_pi_2_d, minus_zero),
 
-    TEST_c_c (catan, 0.0, plus_infty, M_PI_2l, 0),
-    TEST_c_c (catan, minus_zero, plus_infty, -M_PI_2l, 0),
-    TEST_c_c (catan, 0.5, plus_infty, M_PI_2l, 0),
-    TEST_c_c (catan, -0.5, plus_infty, -M_PI_2l, 0),
+    TEST_c_c (catan, 0.0, plus_infty, lit_pi_2_d, 0),
+    TEST_c_c (catan, minus_zero, plus_infty, -lit_pi_2_d, 0),
+    TEST_c_c (catan, 0.5, plus_infty, lit_pi_2_d, 0),
+    TEST_c_c (catan, -0.5, plus_infty, -lit_pi_2_d, 0),
 
     TEST_c_c (catan, qnan_value, 0.0, qnan_value, 0),
     TEST_c_c (catan, qnan_value, minus_zero, qnan_value, minus_zero),
@@ -4926,8 +4928,8 @@  static const struct test_c_c_data catan_test_data[] =
     TEST_c_c (catan, 0.0, qnan_value, qnan_value, qnan_value),
     TEST_c_c (catan, minus_zero, qnan_value, qnan_value, qnan_value),
 
-    TEST_c_c (catan, plus_infty, qnan_value, M_PI_2l, 0, IGNORE_ZERO_INF_SIGN),
-    TEST_c_c (catan, minus_infty, qnan_value, -M_PI_2l, 0, IGNORE_ZERO_INF_SIGN),
+    TEST_c_c (catan, plus_infty, qnan_value, lit_pi_2_d, 0, IGNORE_ZERO_INF_SIGN),
+    TEST_c_c (catan, minus_infty, qnan_value, -lit_pi_2_d, 0, IGNORE_ZERO_INF_SIGN),
 
     TEST_c_c (catan, qnan_value, 10.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK),
     TEST_c_c (catan, qnan_value, -10.5, qnan_value, qnan_value, INVALID_EXCEPTION_OK),
@@ -5398,29 +5400,29 @@  static const struct test_c_c_data catanh_test_data[] =
     TEST_c_c (catanh, plus_zero, -1.0L, plus_zero, -M_PI_4l),
     TEST_c_c (catanh, minus_zero, -1.0L, minus_zero, -M_PI_4l),
 
-    TEST_c_c (catanh, plus_infty, plus_infty, 0.0, M_PI_2l),
-    TEST_c_c (catanh, plus_infty, minus_infty, 0.0, -M_PI_2l),
-    TEST_c_c (catanh, minus_infty, plus_infty, minus_zero, M_PI_2l),
-    TEST_c_c (catanh, minus_infty, minus_infty, minus_zero, -M_PI_2l),
-
-    TEST_c_c (catanh, -10.0, plus_infty, minus_zero, M_PI_2l),
-    TEST_c_c (catanh, -10.0, minus_infty, minus_zero, -M_PI_2l),
-    TEST_c_c (catanh, minus_zero, plus_infty, minus_zero, M_PI_2l),
-    TEST_c_c (catanh, minus_zero, minus_infty, minus_zero, -M_PI_2l),
-    TEST_c_c (catanh, 0, plus_infty, 0.0, M_PI_2l),
-    TEST_c_c (catanh, 0, minus_infty, 0.0, -M_PI_2l),
-    TEST_c_c (catanh, 0.1L, plus_infty, 0.0, M_PI_2l),
-    TEST_c_c (catanh, 0.1L, minus_infty, 0.0, -M_PI_2l),
-
-    TEST_c_c (catanh, minus_infty, 0, minus_zero, M_PI_2l),
-    TEST_c_c (catanh, minus_infty, minus_zero, minus_zero, -M_PI_2l),
-    TEST_c_c (catanh, minus_infty, 100, minus_zero, M_PI_2l),
-    TEST_c_c (catanh, minus_infty, -100, minus_zero, -M_PI_2l),
-
-    TEST_c_c (catanh, plus_infty, 0, 0.0, M_PI_2l),
-    TEST_c_c (catanh, plus_infty, minus_zero, 0.0, -M_PI_2l),
-    TEST_c_c (catanh, plus_infty, 0.5, 0.0, M_PI_2l),
-    TEST_c_c (catanh, plus_infty, -0.5, 0.0, -M_PI_2l),
+    TEST_c_c (catanh, plus_infty, plus_infty, 0.0, lit_pi_2_d),
+    TEST_c_c (catanh, plus_infty, minus_infty, 0.0, -lit_pi_2_d),
+    TEST_c_c (catanh, minus_infty, plus_infty, minus_zero, lit_pi_2_d),
+    TEST_c_c (catanh, minus_infty, minus_infty, minus_zero, -lit_pi_2_d),
+
+    TEST_c_c (catanh, -10.0, plus_infty, minus_zero, lit_pi_2_d),
+    TEST_c_c (catanh, -10.0, minus_infty, minus_zero, -lit_pi_2_d),
+    TEST_c_c (catanh, minus_zero, plus_infty, minus_zero, lit_pi_2_d),
+    TEST_c_c (catanh, minus_zero, minus_infty, minus_zero, -lit_pi_2_d),
+    TEST_c_c (catanh, 0, plus_infty, 0.0, lit_pi_2_d),
+    TEST_c_c (catanh, 0, minus_infty, 0.0, -lit_pi_2_d),
+    TEST_c_c (catanh, 0.1L, plus_infty, 0.0, lit_pi_2_d),
+    TEST_c_c (catanh, 0.1L, minus_infty, 0.0, -lit_pi_2_d),
+
+    TEST_c_c (catanh, minus_infty, 0, minus_zero, lit_pi_2_d),
+    TEST_c_c (catanh, minus_infty, minus_zero, minus_zero, -lit_pi_2_d),
+    TEST_c_c (catanh, minus_infty, 100, minus_zero, lit_pi_2_d),
+    TEST_c_c (catanh, minus_infty, -100, minus_zero, -lit_pi_2_d),
+
+    TEST_c_c (catanh, plus_infty, 0, 0.0, lit_pi_2_d),
+    TEST_c_c (catanh, plus_infty, minus_zero, 0.0, -lit_pi_2_d),
+    TEST_c_c (catanh, plus_infty, 0.5, 0.0, lit_pi_2_d),
+    TEST_c_c (catanh, plus_infty, -0.5, 0.0, -lit_pi_2_d),
 
     TEST_c_c (catanh, 0, qnan_value, 0.0, qnan_value),
     TEST_c_c (catanh, minus_zero, qnan_value, minus_zero, qnan_value),
@@ -5431,8 +5433,8 @@  static const struct test_c_c_data catanh_test_data[] =
     TEST_c_c (catanh, qnan_value, 0, qnan_value, qnan_value),
     TEST_c_c (catanh, qnan_value, minus_zero, qnan_value, qnan_value),
 
-    TEST_c_c (catanh, qnan_value, plus_infty, 0.0, M_PI_2l, IGNORE_ZERO_INF_SIGN),
-    TEST_c_c (catanh, qnan_value, minus_infty, 0.0, -M_PI_2l, IGNORE_ZERO_INF_SIGN),
+    TEST_c_c (catanh, qnan_value, plus_infty, 0.0, lit_pi_2_d, IGNORE_ZERO_INF_SIGN),
+    TEST_c_c (catanh, qnan_value, minus_infty, 0.0, -lit_pi_2_d, IGNORE_ZERO_INF_SIGN),
 
     TEST_c_c (catanh, 10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK),
     TEST_c_c (catanh, -10.5, qnan_value, qnan_value, qnan_value, INVALID_EXCEPTION_OK),
@@ -6251,14 +6253,14 @@  static const struct test_c_c_data clog_test_data[] =
     TEST_c_c (clog, plus_infty, plus_infty, plus_infty, M_PI_4l),
     TEST_c_c (clog, plus_infty, minus_infty, plus_infty, -M_PI_4l),
 
-    TEST_c_c (clog, 0, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (clog, 3, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (clog, minus_zero, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (clog, -3, plus_infty, plus_infty, M_PI_2l),
-    TEST_c_c (clog, 0, minus_infty, plus_infty, -M_PI_2l),
-    TEST_c_c (clog, 3, minus_infty, plus_infty, -M_PI_2l),
-    TEST_c_c (clog, minus_zero, minus_infty, plus_infty, -M_PI_2l),
-    TEST_c_c (clog, -3, minus_infty, plus_infty, -M_PI_2l),
+    TEST_c_c (clog, 0, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (clog, 3, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (clog, minus_zero, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (clog, -3, plus_infty, plus_infty, lit_pi_2_d),
+    TEST_c_c (clog, 0, minus_infty, plus_infty, -lit_pi_2_d),
+    TEST_c_c (clog, 3, minus_infty, plus_infty, -lit_pi_2_d),
+    TEST_c_c (clog, minus_zero, minus_infty, plus_infty, -lit_pi_2_d),
+    TEST_c_c (clog, -3, minus_infty, plus_infty, -lit_pi_2_d),
 
     TEST_c_c (clog, minus_infty, 0, plus_infty, M_PIl),
     TEST_c_c (clog, minus_infty, 1, plus_infty, M_PIl),
diff --git a/math/test-double.h b/math/test-double.h
index 6783b44..3667883 100644
--- a/math/test-double.h
+++ b/math/test-double.h
@@ -26,4 +26,5 @@ 
 #define PREFIX DBL
 #define LIT(x) (x)
 #define TYPE_STR "double"
+#define LITM(x) x
 #define FTOSTR snprintf
diff --git a/math/test-float.h b/math/test-float.h
index 9bb3b84..4f9149f 100644
--- a/math/test-float.h
+++ b/math/test-float.h
@@ -26,4 +26,6 @@ 
 #define PREFIX FLT
 #define TYPE_STR "float"
 #define LIT(x) (x ## f)
+/* Use the double variants of macro constants.  */
+#define LITM(x) x
 #define FTOSTR snprintf
diff --git a/math/test-ldouble.h b/math/test-ldouble.h
index 63f5008..f3a8d8d 100644
--- a/math/test-ldouble.h
+++ b/math/test-ldouble.h
@@ -26,4 +26,5 @@ 
 #define PREFIX LDBL
 #define TYPE_STR "ldouble"
 #define LIT(x) (x ## L)
+#define LITM(x) x ## l
 #define FTOSTR snprintf