Replace M_PI2l with lit_pi_2_d in libm-test.inc

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.
This commit is contained in:
Paul E. Murphy 2016-05-27 12:03:33 -05:00
parent 135d1c7f6a
commit 84ba459dcf
5 changed files with 169 additions and 154 deletions

View File

@ -1,3 +1,12 @@
2016-05-27 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
* 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.
2016-05-27 Paul E. Murphy <murphyp@linux.vnet.ibm.com>
* libm-test.inc (M_PI_34l): Rename to

View File

@ -295,6 +295,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. */
@ -1874,8 +1876,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),
@ -1933,28 +1935,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),
@ -2060,10 +2062,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),
@ -2071,12 +2073,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),
@ -2091,8 +2093,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),
@ -2105,18 +2107,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),
@ -2748,22 +2750,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),
@ -2792,18 +2794,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),
@ -3440,10 +3442,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),
@ -3491,15 +3493,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),
@ -3531,18 +3533,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),
@ -4172,14 +4174,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),
@ -4208,18 +4210,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),
@ -4866,30 +4868,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),
@ -4900,8 +4902,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),
@ -5372,29 +5374,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, 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, 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, -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, 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, 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, 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, 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),
@ -5405,8 +5407,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),
@ -6225,14 +6227,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),

View File

@ -26,4 +26,5 @@
#define PREFIX DBL
#define LIT(x) (x)
#define TYPE_STR "double"
#define LITM(x) x
#define FTOSTR snprintf

View File

@ -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

View File

@ -26,4 +26,5 @@
#define PREFIX LDBL
#define TYPE_STR "ldouble"
#define LIT(x) (x ## L)
#define LITM(x) x ## l
#define FTOSTR snprintf