[PATCHv3,05/11] Replace M_PIl with lit_pi in libm-test.inc
diff mbox

Message ID 21b01be1cd6e8a5ffe445427740260b748db8de8.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.

	* libm-test.inc: Replace usage of M_PIl with
	(lit_pi): New macro.
---
 math/libm-test.inc | 78 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 40 insertions(+), 38 deletions(-)

Comments

Joseph Myers May 27, 2016, 1:32 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.
> 
> 	* libm-test.inc: Replace usage of M_PIl with
> 	(lit_pi): New macro.

OK.
Paul E. Murphy May 27, 2016, 5:12 p.m. UTC | #2
On 05/27/2016 08:32 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.
>>
>> 	* libm-test.inc: Replace usage of M_PIl with
>> 	(lit_pi): New macro.
> 
> OK.
> 

Committed as 9289b55.

Patch
diff mbox

diff --git a/math/libm-test.inc b/math/libm-test.inc
index a23b812..d81585b 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -323,6 +323,8 @@  struct ulp_data
 #define lit_pi_ln10_d		LIT (1.364376353841841347485783625431355770)
 /* pi / 2 */
 #define lit_pi_2_d		LITM (M_PI_2)
+/* pi */
+#define lit_pi			LITM (M_PI)
 
 #define ulps_file_name "ULPs"	/* Name of the ULPs file.  */
 static FILE *ulps_file;		/* File to document difference.  */
@@ -1985,18 +1987,18 @@  static const struct test_ff_f_data atan2_test_data[] =
     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),
-    TEST_ff_f (atan2, plus_zero, minus_infty, M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, min_value, minus_infty, M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, min_subnorm_value, minus_infty, M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, max_value, minus_infty, M_PIl, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, 1, minus_infty, lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, plus_zero, minus_infty, lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, min_value, minus_infty, lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, min_subnorm_value, minus_infty, lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, max_value, minus_infty, lit_pi, ERRNO_UNCHANGED),
 
     /* atan2 (y,-inf) == -pi for finite y < 0 or -0.  */
-    TEST_ff_f (atan2, -1, minus_infty, -M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, minus_zero, minus_infty, -M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, -min_value, minus_infty, -M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, -min_subnorm_value, minus_infty, -M_PIl, ERRNO_UNCHANGED),
-    TEST_ff_f (atan2, -max_value, minus_infty, -M_PIl, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, -1, minus_infty, -lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, minus_zero, minus_infty, -lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, -min_value, minus_infty, -lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, -min_subnorm_value, minus_infty, -lit_pi, ERRNO_UNCHANGED),
+    TEST_ff_f (atan2, -max_value, minus_infty, -lit_pi, ERRNO_UNCHANGED),
 
     TEST_ff_f (atan2, plus_infty, plus_infty, M_PI_4l, ERRNO_UNCHANGED),
     TEST_ff_f (atan2, minus_infty, plus_infty, -M_PI_4l, ERRNO_UNCHANGED),
@@ -2106,10 +2108,10 @@  static const struct test_c_c_data cacos_test_data[] =
     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),
-    TEST_c_c (cacos, minus_infty, 100, M_PIl, minus_infty),
-    TEST_c_c (cacos, minus_infty, -100, M_PIl, plus_infty),
+    TEST_c_c (cacos, minus_infty, 0, lit_pi, minus_infty),
+    TEST_c_c (cacos, minus_infty, minus_zero, lit_pi, plus_infty),
+    TEST_c_c (cacos, minus_infty, 100, lit_pi, minus_infty),
+    TEST_c_c (cacos, minus_infty, -100, lit_pi, plus_infty),
 
     TEST_c_c (cacos, plus_infty, 0, 0.0, minus_infty),
     TEST_c_c (cacos, plus_infty, minus_zero, 0.0, plus_infty),
@@ -2146,10 +2148,10 @@  static const struct test_c_c_data cacos_test_data[] =
     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),
-    TEST_c_c (cacos, -1.0L, plus_zero, M_PIl, minus_zero),
-    TEST_c_c (cacos, -1.0L, minus_zero, M_PIl, plus_zero),
+    TEST_c_c (cacos, -1.5L, plus_zero, lit_pi, -0.9624236501192068949955178268487368462704L),
+    TEST_c_c (cacos, -1.5L, minus_zero, lit_pi, 0.9624236501192068949955178268487368462704L),
+    TEST_c_c (cacos, -1.0L, plus_zero, lit_pi, minus_zero),
+    TEST_c_c (cacos, -1.0L, minus_zero, lit_pi, plus_zero),
     TEST_c_c (cacos, -0.5L, plus_zero, 2.094395102393195492308428922186335256131L, minus_zero),
     TEST_c_c (cacos, -0.5L, minus_zero, 2.094395102393195492308428922186335256131L, plus_zero),
     TEST_c_c (cacos, 0.5L, plus_zero, 1.047197551196597746154214461093167628066L, minus_zero),
@@ -2793,10 +2795,10 @@  static const struct test_c_c_data cacosh_test_data[] =
     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),
-    TEST_c_c (cacosh, minus_infty, 100, plus_infty, M_PIl),
-    TEST_c_c (cacosh, minus_infty, -100, plus_infty, -M_PIl),
+    TEST_c_c (cacosh, minus_infty, 0, plus_infty, lit_pi),
+    TEST_c_c (cacosh, minus_infty, minus_zero, plus_infty, -lit_pi),
+    TEST_c_c (cacosh, minus_infty, 100, plus_infty, lit_pi),
+    TEST_c_c (cacosh, minus_infty, -100, plus_infty, -lit_pi),
 
     TEST_c_c (cacosh, plus_infty, 0, plus_infty, 0.0),
     TEST_c_c (cacosh, plus_infty, minus_zero, plus_infty, minus_zero),
@@ -2833,10 +2835,10 @@  static const struct test_c_c_data cacosh_test_data[] =
     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),
-    TEST_c_c (cacosh, -1.0L, plus_zero, plus_zero, M_PIl),
-    TEST_c_c (cacosh, -1.0L, minus_zero, plus_zero, -M_PIl),
+    TEST_c_c (cacosh, -1.5L, plus_zero, 0.9624236501192068949955178268487368462704L, lit_pi),
+    TEST_c_c (cacosh, -1.5L, minus_zero, 0.9624236501192068949955178268487368462704L, -lit_pi),
+    TEST_c_c (cacosh, -1.0L, plus_zero, plus_zero, lit_pi),
+    TEST_c_c (cacosh, -1.0L, minus_zero, plus_zero, -lit_pi),
     TEST_c_c (cacosh, -0.5L, plus_zero, plus_zero, 2.094395102393195492308428922186335256131L),
     TEST_c_c (cacosh, -0.5L, minus_zero, plus_zero, -2.094395102393195492308428922186335256131L),
     TEST_c_c (cacosh, 0.5L, plus_zero, plus_zero, 1.047197551196597746154214461093167628066L),
@@ -3474,10 +3476,10 @@  static const struct test_c_f_data carg_test_data[] =
     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),
+    TEST_c_f (carg, minus_infty, 10.0, lit_pi),
 
     /* carg (-inf + i y) == -pi for finite y < 0.  */
-    TEST_c_f (carg, minus_infty, -10.0, -M_PIl),
+    TEST_c_f (carg, minus_infty, -10.0, -lit_pi),
 
     TEST_c_f (carg, plus_infty, plus_infty, M_PI_4l),
 
@@ -6032,8 +6034,8 @@  static const struct test_f_f_data ceil_test_data[] =
     TEST_f_f (ceil, -snan_value, qnan_value, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION),
 
     /* Bug 15479: spurious "inexact" exception may occur.  */
-    TEST_f_f (ceil, M_PIl, 4.0, ERRNO_UNCHANGED),
-    TEST_f_f (ceil, -M_PIl, -3.0, ERRNO_UNCHANGED),
+    TEST_f_f (ceil, lit_pi, 4.0, ERRNO_UNCHANGED),
+    TEST_f_f (ceil, -lit_pi, -3.0, ERRNO_UNCHANGED),
     TEST_f_f (ceil, min_subnorm_value, 1.0, ERRNO_UNCHANGED),
     TEST_f_f (ceil, min_value, 1.0, ERRNO_UNCHANGED),
     TEST_f_f (ceil, 0.1, 1.0, ERRNO_UNCHANGED),
@@ -6241,8 +6243,8 @@  cimag_test (void)
 
 static const struct test_c_c_data clog_test_data[] =
   {
-    TEST_c_c (clog, minus_zero, 0, minus_infty, M_PIl, DIVIDE_BY_ZERO_EXCEPTION),
-    TEST_c_c (clog, minus_zero, minus_zero, minus_infty, -M_PIl, DIVIDE_BY_ZERO_EXCEPTION),
+    TEST_c_c (clog, minus_zero, 0, minus_infty, lit_pi, DIVIDE_BY_ZERO_EXCEPTION),
+    TEST_c_c (clog, minus_zero, minus_zero, minus_infty, -lit_pi, DIVIDE_BY_ZERO_EXCEPTION),
 
     TEST_c_c (clog, 0, 0, minus_infty, 0.0, DIVIDE_BY_ZERO_EXCEPTION),
     TEST_c_c (clog, 0, minus_zero, minus_infty, minus_zero, DIVIDE_BY_ZERO_EXCEPTION),
@@ -6262,10 +6264,10 @@  static const struct test_c_c_data clog_test_data[] =
     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),
-    TEST_c_c (clog, minus_infty, minus_zero, plus_infty, -M_PIl),
-    TEST_c_c (clog, minus_infty, -1, plus_infty, -M_PIl),
+    TEST_c_c (clog, minus_infty, 0, plus_infty, lit_pi),
+    TEST_c_c (clog, minus_infty, 1, plus_infty, lit_pi),
+    TEST_c_c (clog, minus_infty, minus_zero, plus_infty, -lit_pi),
+    TEST_c_c (clog, minus_infty, -1, plus_infty, -lit_pi),
 
     TEST_c_c (clog, plus_infty, 0, plus_infty, 0.0),
     TEST_c_c (clog, plus_infty, 1, plus_infty, 0.0),
@@ -7187,8 +7189,8 @@  static const struct test_f_f_data floor_test_data[] =
     TEST_f_f (floor, -snan_value, qnan_value, NO_INEXACT_EXCEPTION|INVALID_EXCEPTION),
 
     /* Bug 15479: spurious "inexact" exception may occur.  */
-    TEST_f_f (floor, M_PIl, 3.0, ERRNO_UNCHANGED),
-    TEST_f_f (floor, -M_PIl, -4.0, ERRNO_UNCHANGED),
+    TEST_f_f (floor, lit_pi, 3.0, ERRNO_UNCHANGED),
+    TEST_f_f (floor, -lit_pi, -4.0, ERRNO_UNCHANGED),
     TEST_f_f (floor, min_subnorm_value, 0.0, ERRNO_UNCHANGED),
     TEST_f_f (floor, min_value, 0.0, ERRNO_UNCHANGED),
     TEST_f_f (floor, 0.1, 0.0, ERRNO_UNCHANGED),