diff --git a/test/cpfloat_test.ts b/test/cpfloat_test.ts index fb3d791..23a1080 100644 --- a/test/cpfloat_test.ts +++ b/test/cpfloat_test.ts @@ -35,17 +35,15 @@ typedef union { #define CONST_PI 3.14159265358979323846 #define CONST_SQRT2 1.41421356237309504880 -#define MINFORMAT 0 -#define MAXFORMAT 2 #define MINMODE -1 #define MAXMODE 8 #define NREPS 1000 /* Define default target formats. */ -// binary16, bfloat16, TensorFloat-32 -static size_t precision [] = {11, 8, 11}; -static size_t emax [] = {15, 127, 127}; -static size_t emin [] = {-14, -126, -126}; +// binary16, bfloat16 +static size_t precision [] = {11, 8}; +static size_t emax [] = {15, 127}; +static size_t emin [] = {-14, -126}; static size_t nformats = 2; /* Structure for options and fixtures. */ @@ -916,7 +914,7 @@ for (size_t mode = 1; mode < 3; mode++) { double *zd = alloc_init_array_double(xd, n); double *yd = allocate_array_double(xd, n, mode); select_tests_det_double(yd, xd, zd, n, fpopts, - MINMODE, MAXMODE, 0, 2, -1, -1); + MINMODE, MAXMODE, 0, nformats - 1, -1, -1); free(zd); free_array_double(yd, mode); @@ -924,7 +922,7 @@ for (size_t mode = 1; mode < 3; mode++) { float *zf = alloc_init_array_float(xf, n); float *yf = allocate_array_float(xf, n, mode); select_tests_det_float(yf, xf, zf, n, fpopts, - MINMODE, MAXMODE, 0, 2, -1, -1); + MINMODE, MAXMODE, 0, nformats - 1, -1, -1); free(zf); free_array_float(yf, mode); } @@ -2624,11 +2622,10 @@ free(onef); free(exp); free(lexp); -#test enumeration_floating_point_numbers -printf("4c. Next and previous floating-point number\n"); +#test floating_point_enumeration_subnormal_numbers +printf("4c. Next and previous floating-point number: subnormal numbers\n"); fpopts->explim = CPFLOAT_EXPRANGE_TARG; fpopts->subnormal = CPFLOAT_SUBN_USE; -// Subnormals for (size_t mode = 2; mode < 3; mode++) { for (size_t i = 0; i < nformats; i++) { fpopts->precision = precision[i]; @@ -2729,7 +2726,10 @@ for (size_t mode = 2; mode < 3; mode++) { } } -// Normals +#test floating_point_enumeration_normal_numbers +printf("4d. Next and previous floating-point number: normal numbers\n"); +fpopts->explim = CPFLOAT_EXPRANGE_TARG; +fpopts->subnormal = CPFLOAT_SUBN_USE; for (size_t mode = 2; mode < 3; mode++) { for (size_t i = 0; i < nformats; i++) { fpopts->precision = precision[i]; @@ -2839,12 +2839,10 @@ for (size_t mode = 2; mode < 3; mode++) { } #test integer_rounding -printf("4c. Integer rounding\n"); - +printf("4e. Integer rounding\n"); fpopts->emax = emax[1]; fpopts->emin = emin[1]; fpopts->precision = precision[1]; - size_t n = 32; double *xd = malloc(n * sizeof(*xd)); int *xi = malloc(n * sizeof(*xi)); @@ -3012,7 +3010,7 @@ check_equality_double_long_long(rd7, xll, n-3); #test arithmetic_operations_large -printf("4d. Arithmetic operations on large arrays\n"); +printf("4f. Arithmetic operations on large arrays\n"); size_t i = 0; fpopts->precision = precision[i]; fpopts->emax = emax[i];