Skip to content

Commit b9a5027

Browse files
committed
Modify tests from Darwin specifications to openlibm specifications
Modify specifications regarding exceptions thrown and return values for border conditions for tgamma, y0, y1 and yn functions
1 parent 29af332 commit b9a5027

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

test/libm-test.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4129,8 +4129,8 @@ tgamma_test (void)
41294129
init_max_error ();
41304130

41314131
check_float ("tgamma (inf) == inf", FUNC(tgamma) (plus_infty), plus_infty, 0, 0, 0);
4132-
check_float ("tgamma (0) == NaN plus invalid exception", FUNC(tgamma) (0), nan_value, 0, 0, INVALID_EXCEPTION);
4133-
check_float ("tgamma (-0) == NaN plus invalid exception", FUNC(tgamma) (minus_zero), nan_value, 0, 0, INVALID_EXCEPTION);
4132+
check_float ("tgamma (0) == inf plus divide-by-zero", FUNC(tgamma) (0), plus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
4133+
check_float ("tgamma (-0) == inf plus divide-by-zero", FUNC(tgamma) (minus_zero), minus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
41344134
/* tgamma (x) == NaN plus invalid exception for integer x <= 0. */
41354135
check_float ("tgamma (-2) == NaN plus invalid exception", FUNC(tgamma) (-2), nan_value, 0, 0, INVALID_EXCEPTION);
41364136
check_float ("tgamma (-inf) == NaN plus invalid exception", FUNC(tgamma) (minus_infty), nan_value, 0, 0, INVALID_EXCEPTION);
@@ -4196,8 +4196,8 @@ y0_test (void)
41964196
/* y0 is the Bessel function of the second kind of order 0 */
41974197
init_max_error ();
41984198

4199-
check_float ("y0 (-1.0) == -inf", FUNC(y0) (-1.0), minus_infty, 0, 0, 0);
4200-
check_float ("y0 (0.0) == -inf", FUNC(y0) (0.0), minus_infty, 0, 0, 0);
4199+
check_float ("y0 (-1.0) == NaN", FUNC(y0) (-1.0), nan_value, 0, 0, INVALID_EXCEPTION);
4200+
check_float ("y0 (0.0) == -inf", FUNC(y0) (0.0), minus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
42014201
check_float ("y0 (NaN) == NaN", FUNC(y0) (nan_value), nan_value, 0, 0, 0);
42024202
check_float ("y0 (inf) == 0", FUNC(y0) (plus_infty), 0, 0, 0, 0);
42034203

@@ -4230,8 +4230,8 @@ y1_test (void)
42304230
/* y1 is the Bessel function of the second kind of order 1 */
42314231
init_max_error ();
42324232

4233-
check_float ("y1 (-1.0) == -inf", FUNC(y1) (-1.0), minus_infty, 0, 0, 0);
4234-
check_float ("y1 (0.0) == -inf", FUNC(y1) (0.0), minus_infty, 0, 0, 0);
4233+
check_float ("y1 (-1.0) == NaN", FUNC(y1) (-1.0), nan_value, 0, 0, INVALID_EXCEPTION);
4234+
check_float ("y1 (0.0) == -inf", FUNC(y1) (0.0), minus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
42354235
check_float ("y1 (inf) == 0", FUNC(y1) (plus_infty), 0, 0, 0, 0);
42364236
check_float ("y1 (NaN) == NaN", FUNC(y1) (nan_value), nan_value, 0, 0, 0);
42374237

@@ -4264,8 +4264,8 @@ yn_test (void)
42644264
init_max_error ();
42654265

42664266
/* yn (0, x) == y0 (x) */
4267-
check_float ("yn (0, -1.0) == -inf", FUNC(yn) (0, -1.0), minus_infty, 0, 0, 0);
4268-
check_float ("yn (0, 0.0) == -inf", FUNC(yn) (0, 0.0), minus_infty, 0, 0, 0);
4267+
check_float ("yn (0, -1.0) == NaN", FUNC(yn) (0, -1.0), nan_value, 0, 0, INVALID_EXCEPTION);
4268+
check_float ("yn (0, 0.0) == -inf", FUNC(yn) (0, 0.0), minus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
42694269
check_float ("yn (0, NaN) == NaN", FUNC(yn) (0, nan_value), nan_value, 0, 0, 0);
42704270
check_float ("yn (0, inf) == 0", FUNC(yn) (0, plus_infty), 0, 0, 0, 0);
42714271

@@ -4278,8 +4278,8 @@ yn_test (void)
42784278
check_float ("yn (0, 10.0) == 0.055671167283599391424", FUNC(yn) (0, 10.0), 0.055671167283599391424L, DELTA1642, 0, 0);
42794279

42804280
/* yn (1, x) == y1 (x) */
4281-
check_float ("yn (1, -1.0) == -inf", FUNC(yn) (1, -1.0), minus_infty, 0, 0, 0);
4282-
check_float ("yn (1, 0.0) == -inf", FUNC(yn) (1, 0.0), minus_infty, 0, 0, 0);
4281+
check_float ("yn (1, -1.0) == NaN", FUNC(yn) (1, -1.0), nan_value, 0, 0, INVALID_EXCEPTION);
4282+
check_float ("yn (1, 0.0) == -inf", FUNC(yn) (1, 0.0), minus_infty, 0, 0, DIVIDE_BY_ZERO_EXCEPTION);
42834283
check_float ("yn (1, inf) == 0", FUNC(yn) (1, plus_infty), 0, 0, 0, 0);
42844284
check_float ("yn (1, NaN) == NaN", FUNC(yn) (1, nan_value), nan_value, 0, 0, 0);
42854285

0 commit comments

Comments
 (0)