Lines Matching +full:0 +full:x3f000000
21 #if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0)
102 uint32 exp = (hl >> 52) & 0x7ff;
105 if (exp == 0x7ff) {
106 if (mantissa == 0)
110 } else if (exp == 0 && mantissa == 0) {
111 mpfr_set_ui(x, 0, GMP_RNDN);
112 mpfr_setsign(x, x, sign < 0, GMP_RNDN);
114 if (exp != 0)
118 mpfr_set_sj_2exp(x, mantissa * sign, (int)exp - 0x3ff - 52, GMP_RNDN);
123 uint32 exp = (f >> 23) & 0xff;
126 if (exp == 0xff) {
127 if (mantissa == 0)
131 } else if (exp == 0 && mantissa == 0) {
132 mpfr_set_ui(x, 0, GMP_RNDN);
133 mpfr_setsign(x, x, sign < 0, GMP_RNDN);
135 if (exp != 0)
139 mpfr_set_sj_2exp(x, mantissa * sign, (int)exp - 0x7f - 23, GMP_RNDN);
171 *h = 0x7ff80000;
172 *l = 0;
173 *extra = 0;
177 sign = mpfr_signbit(x) ? 0x80000000U : 0;
180 *h = 0x7ff00000 | sign;
181 *l = 0;
182 *extra = 0;
187 *h = 0x00000000 | sign;
188 *l = 0;
189 *extra = 0;
196 mpfr_set_exp(significand, 0);
199 * So the IEEE exponent corresponding to exp==0 is 0x3fe. */
200 if (exp > 0x400) {
202 *h = 0x7ff00000 | sign;
203 *l = 0;
204 *extra = 0;
209 if (exp <= -0x3fe || mpfr_zero_p(x))
210 exp = -0x3fd; /* denormalise */
211 expfield = exp + 0x3fd; /* offset to cancel leading mantissa bit */
235 *f = 0x7fc00000;
236 *extra = 0;
240 sign = mpfr_signbit(x) ? 0x80000000U : 0;
243 *f = 0x7f800000 | sign;
244 *extra = 0;
249 *f = 0x00000000 | sign;
250 *extra = 0;
257 mpfr_set_exp(significand, 0);
260 * So the IEEE exponent corresponding to exp==0 is 0x7e. */
261 if (exp > 0x80) {
263 *f = 0x7f800000 | sign;
264 *extra = 0;
269 if (exp <= -0x7e || mpfr_zero_p(x))
270 exp = -0x7d; /* denormalise */
271 expfield = exp + 0x7d; /* offset to cancel leading mantissa bit */
332 * 0x3c2, i.e. of the order of 2^-61. So we need 1024 bits of pi
363 * NaN in cases where gamma(x) < 0, so it's no use to us.
411 (((in)[0] & 0x7F800000) == 0x7F800000 || \
412 (((in)[0] & 0x7F800000) == 0 && ((in)[0]&0x7FFFFFFF) != 0)))
415 (((in)[0] & 0x7FF00000) == 0x7FF00000 || \
416 (((in)[0] & 0x7FF00000) == 0 && (((in)[0] & 0xFFFFF) | (in)[1]) != 0)))
424 if ((0x7FF00000 & ~in[0]) == 0)
425 return 0; /* not finite, hence not integer */
427 return in[0] == out[0] && in[1] == out[1];
432 if ((0x7F800000 & ~in[0]) == 0)
433 return 0; /* not finite, hence not integer */
435 return in[0] == out[0];
443 if ((in[0] & 0x7FF00000) != 0x7FF00000)
444 return 0; /* not the inf/nan exponent */
445 if ((in[0] << 12) == 0 && in[1] == 0)
446 return 0; /* inf */
447 if (in[0] & 0x00080000)
448 return 0; /* qnan */
453 if ((in[0] & 0x7F800000) != 0x7F800000)
454 return 0; /* not the inf/nan exponent */
455 if ((in[0] << 9) == 0)
456 return 0; /* inf */
457 if (in[0] & 0x00400000)
458 return 0; /* qnan */
476 for (op = 0; op < wrapper_get_nops(ctx); op++) {
497 cases_uniform, 0x3e400000, 0x40300000},
499 cases_uniform_float, 0x39800000, 0x41800000},
501 cases_uniform, 0x3e400000, 0x40300000},
503 cases_uniform_float, 0x39800000, 0x41800000},
505 cases_uniform, 0x3e400000, 0x40300000},
507 cases_uniform_float, 0x39800000, 0x41800000},
509 cases_uniform_float, 0x39800000, 0x41800000},
511 cases_uniform_float, 0x39800000, 0x41800000},
513 cases_uniform, 0x3e400000, 0x40300000},
515 cases_uniform_float, 0x39800000, 0x41800000},
517 cases_uniform, 0x3e400000, 0x40300000},
519 cases_uniform_float, 0x39800000, 0x41800000},
521 cases_uniform, 0x3e400000, 0x40300000},
523 cases_uniform_float, 0x39800000, 0x41800000},
529 cases_uniform, 0x3e400000, 0x3fefffff},
531 cases_uniform_float, 0x39800000, 0x3f7fffff},
533 cases_uniform, 0x3c900000, 0x3fefffff},
535 cases_uniform_float, 0x33800000, 0x3f7fffff},
542 cases_uniform, 0x3e400000, 0x43400000},
544 cases_uniform_float, 0x39800000, 0x4b800000},
550 atan2_cases, 0},
552 atan2_cases_float, 0},
558 cases_uniform, 0x3c900000, 0x40878000},
560 cases_uniform_float, 0x33800000, 0x42dc0000},
562 cases_uniform, 0x3c900000, 0x40878000},
564 cases_uniform_float, 0x33800000, 0x42dc0000},
566 cases_uniform, 0x3e400000, 0x40878000},
568 cases_uniform_float, 0x39800000, 0x42dc0000},
573 cases_uniform, 0x3e400000, 0x40340000},
575 cases_uniform, 0x39800000, 0x41100000},
581 {"log", (funcptr)mpfr_log, args1, {NULL}, log_cases, 0},
582 {"logf", (funcptr)mpfr_log, args1f, {NULL}, log_cases_float, 0},
583 {"log10", (funcptr)mpfr_log10, args1, {NULL}, log_cases, 0},
584 {"log10f", (funcptr)mpfr_log10, args1f, {NULL}, log_cases_float, 0},
588 {"pow", (funcptr)mpfr_pow, args2, {NULL}, pow_cases, 0},
589 {"powf", (funcptr)mpfr_pow, args2f, {NULL}, pow_cases_float, 0},
595 {"rred", (funcptr)test_rred, rred, {NULL}, rred_cases, 0},
596 {"rredf", (funcptr)test_rred, rredf, {NULL}, rred_cases_float, 0},
600 {"sqrt", (funcptr)mpfr_sqrt, args1, {NULL}, log_cases, 0},
601 {"sqrtf", (funcptr)mpfr_sqrt, args1f, {NULL}, log_cases_float, 0},
602 {"cbrt", (funcptr)mpfr_cbrt, args1, {NULL}, log_cases, 0},
603 {"cbrtf", (funcptr)mpfr_cbrt, args1f, {NULL}, log_cases_float, 0},
604 {"hypot", (funcptr)mpfr_hypot, args2, {NULL}, atan2_cases, 0},
605 {"hypotf", (funcptr)mpfr_hypot, args2f, {NULL}, atan2_cases_float, 0},
627 {"isfinite", (funcptr)test_isfinite, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
628 {"isfinitef", (funcptr)test_isfinitef, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
629 {"isinf", (funcptr)test_isinf, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
630 {"isinff", (funcptr)test_isinff, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
631 {"isnan", (funcptr)test_isnan, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
632 {"isnanf", (funcptr)test_isnanf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
633 {"isnormal", (funcptr)test_isnormal, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
634 {"isnormalf", (funcptr)test_isnormalf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
635 {"signbit", (funcptr)test_signbit, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
636 {"signbitf", (funcptr)test_signbitf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
637 {"fpclassify", (funcptr)test_fpclassify, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
638 {"fpclassifyf", (funcptr)test_fpclassifyf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
642 {"isgreater", (funcptr)test_isgreater, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
643 {"isgreaterequal", (funcptr)test_isgreaterequal, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
644 {"isless", (funcptr)test_isless, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
645 {"islessequal", (funcptr)test_islessequal, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
646 {"islessgreater", (funcptr)test_islessgreater, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
647 {"isunordered", (funcptr)test_isunordered, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
649 {"isgreaterf", (funcptr)test_isgreaterf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
650 {"isgreaterequalf", (funcptr)test_isgreaterequalf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
651 {"islessf", (funcptr)test_islessf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
652 {"islessequalf", (funcptr)test_islessequalf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
653 {"islessgreaterf", (funcptr)test_islessgreaterf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
654 {"isunorderedf", (funcptr)test_isunorderedf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
659 {"atanh", (funcptr)mpfr_atanh, args1, {NULL}, cases_uniform, 0x3e400000, 0x3fefffff},
660 {"asinh", (funcptr)mpfr_asinh, args1, {NULL}, cases_uniform, 0x3e400000, 0x3fefffff},
661 {"acosh", (funcptr)mpfr_acosh, args1, {NULL}, cases_uniform_positive, 0x3ff00000, 0x7fefffff},
663 {"atanhf", (funcptr)mpfr_atanh, args1f, {NULL}, cases_uniform_float, 0x32000000, 0x3f7fffff},
664 {"asinhf", (funcptr)mpfr_asinh, args1f, {NULL}, cases_uniform_float, 0x32000000, 0x3f7fffff},
665 {"acoshf", (funcptr)mpfr_acosh, args1f, {NULL}, cases_uniform_float_positive, 0x3f800000, 0x7f800000},
672 {"csin", (funcptr)mpc_sin, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
673 {"csinf", (funcptr)mpc_sin, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
674 {"ccos", (funcptr)mpc_cos, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
675 {"ccosf", (funcptr)mpc_cos, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
676 {"ctan", (funcptr)mpc_tan, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
677 {"ctanf", (funcptr)mpc_tan, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
679 {"casin", (funcptr)mpc_asin, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
680 {"casinf", (funcptr)mpc_asin, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
681 {"cacos", (funcptr)mpc_acos, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
682 {"cacosf", (funcptr)mpc_acos, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
683 {"catan", (funcptr)mpc_atan, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
684 {"catanf", (funcptr)mpc_atan, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
686 {"csinh", (funcptr)mpc_sinh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
687 {"csinhf", (funcptr)mpc_sinh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
688 {"ccosh", (funcptr)mpc_cosh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
689 {"ccoshf", (funcptr)mpc_cosh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
690 {"ctanh", (funcptr)mpc_tanh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
691 {"ctanhf", (funcptr)mpc_tanh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
693 {"casinh", (funcptr)mpc_asinh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
694 {"casinhf", (funcptr)mpc_asinh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
695 {"cacosh", (funcptr)mpc_acosh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
696 {"cacoshf", (funcptr)mpc_acosh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
697 {"catanh", (funcptr)mpc_atanh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
698 {"catanhf", (funcptr)mpc_atanh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
700 {"cexp", (funcptr)mpc_exp, args1c, {NULL}, complex_cases_uniform, 0x3c900000, 0x40862000},
701 {"cpow", (funcptr)test_cpow, args2c, {NULL}, complex_pow_cases, 0x3fc00000, 0x40000000},
702 {"clog", (funcptr)mpc_log, args1c, {NULL}, complex_log_cases, 0, 0},
703 {"csqrt", (funcptr)mpc_sqrt, args1c, {NULL}, complex_log_cases, 0, 0},
705 {"cexpf", (funcptr)mpc_exp, args1fc, {NULL}, complex_cases_uniform_float, 0x24800000, 0x42b00000},
706 {"cpowf", (funcptr)test_cpow, args2fc, {NULL}, complex_pow_cases_float, 0x3e000000, 0x41000000},
707 {"clogf", (funcptr)mpc_log, args1fc, {NULL}, complex_log_cases_float, 0, 0},
708 {"csqrtf", (funcptr)mpc_sqrt, args1fc, {NULL}, complex_log_cases_float, 0, 0},
710 {"cdiv", (funcptr)mpc_div, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
711 {"cmul", (funcptr)mpc_mul, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
712 {"cadd", (funcptr)mpc_add, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
713 {"csub", (funcptr)mpc_sub, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
715 {"cdivf", (funcptr)mpc_div, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
716 {"cmulf", (funcptr)mpc_mul, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
717 {"caddf", (funcptr)mpc_add, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
718 {"csubf", (funcptr)mpc_sub, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
720 {"cabsf", (funcptr)mpc_abs, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
721 {"cabs", (funcptr)mpc_abs, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
722 {"cargf", (funcptr)mpc_arg, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
723 {"carg", (funcptr)mpc_arg, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
724 {"cimagf", (funcptr)mpc_imag, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
725 {"cimag", (funcptr)mpc_imag, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
726 {"conjf", (funcptr)mpc_conj, args1fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
727 {"conj", (funcptr)mpc_conj, args1c, {NULL}, complex_arithmetic_cases, 0, 0},
728 {"cprojf", (funcptr)mpc_proj, args1fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
729 {"cproj", (funcptr)mpc_proj, args1c, {NULL}, complex_arithmetic_cases, 0, 0},
730 {"crealf", (funcptr)mpc_real, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
731 {"creal", (funcptr)mpc_real, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
732 {"erfcf", (funcptr)mpfr_erfc, args1f, {NULL}, cases_biased_float, 0x1e800000, 0x41000000},
733 {"erfc", (funcptr)mpfr_erfc, args1, {NULL}, cases_biased, 0x3bd00000, 0x403c0000},
734 {"erff", (funcptr)mpfr_erf, args1f, {NULL}, cases_biased_float, 0x03800000, 0x40700000},
735 {"erf", (funcptr)mpfr_erf, args1, {NULL}, cases_biased, 0x00800000, 0x40200000},
736 {"exp2f", (funcptr)mpfr_exp2, args1f, {NULL}, cases_uniform_float, 0x33800000, 0x43c00000},
737 {"exp2", (funcptr)mpfr_exp2, args1, {NULL}, cases_uniform, 0x3ca00000, 0x40a00000},
738 {"expm1f", (funcptr)mpfr_expm1, args1f, {NULL}, cases_uniform_float, 0x33000000, 0x43800000},
739 {"expm1", (funcptr)mpfr_expm1, args1, {NULL}, cases_uniform, 0x3c900000, 0x409c0000},
740 {"fmaxf", (funcptr)mpfr_max, args2f, {NULL}, minmax_cases_float, 0, 0x7f7fffff},
741 {"fmax", (funcptr)mpfr_max, args2, {NULL}, minmax_cases, 0, 0x7fefffff},
742 {"fminf", (funcptr)mpfr_min, args2f, {NULL}, minmax_cases_float, 0, 0x7f7fffff},
743 {"fmin", (funcptr)mpfr_min, args2, {NULL}, minmax_cases, 0, 0x7fefffff},
744 {"lgammaf", (funcptr)test_lgamma, args1f, {NULL}, cases_uniform_float, 0x01800000, 0x7f800000},
745 {"lgamma", (funcptr)test_lgamma, args1, {NULL}, cases_uniform, 0x00100000, 0x7ff00000},
746 {"log1pf", (funcptr)mpfr_log1p, args1f, {NULL}, log1p_cases_float, 0, 0},
747 {"log1p", (funcptr)mpfr_log1p, args1, {NULL}, log1p_cases, 0, 0},
748 {"log2f", (funcptr)mpfr_log2, args1f, {NULL}, log_cases_float, 0, 0},
749 {"log2", (funcptr)mpfr_log2, args1, {NULL}, log_cases, 0, 0},
750 {"tgammaf", (funcptr)mpfr_gamma, args1f, {NULL}, cases_uniform_float, 0x2f800000, 0x43000000},
751 {"tgamma", (funcptr)mpfr_gamma, args1, {NULL}, cases_uniform, 0x3c000000, 0x40800000},
757 #define random_sign ( random_upto(1) ? 0x80000000 : 0 )
760 return !((x[0] & 0x7FFFFFFF) || x[1]);
766 cases_uniform(out,0x00100000,0x7fefffff);
767 cases_uniform(out+2,0x00100000,0x7fefffff);
773 cases_uniform_float(out,0x00800000,0x7f7fffff);
774 cases_uniform_float(out+2,0x00800000,0x7f7fffff);
820 cases_uniform(out,0x3fe00000, 0x40000000);
821 cases_uniform(out+2,0x3fe00000, 0x40000000);
822 cases_uniform(out+4,0x3f800000, 0x40600000);
823 cases_uniform(out+6,0x3f800000, 0x40600000);
832 cases_uniform_float(out,0x3f000000, 0x40000000);
833 cases_uniform_float(out+2,0x3f000000, 0x40000000);
834 cases_uniform_float(out+4,0x3d600000, 0x41900000);
835 cases_uniform_float(out+6,0x3d600000, 0x41900000);
840 cases_uniform(out,0,0x7fefffff);
841 cases_uniform(out+2,0,0x7fefffff);
842 cases_uniform(out+4,0,0x7fefffff);
843 cases_uniform(out+6,0,0x7fefffff);
848 cases_uniform_float(out,0,0x7f7fffff);
849 cases_uniform_float(out+2,0,0x7f7fffff);
850 cases_uniform_float(out+4,0,0x7f7fffff);
851 cases_uniform_float(out+6,0,0x7f7fffff);
869 premax = preptr = 0;
875 -127, -126, -125, -24, -4, -3, -2, -1, 0, 1, 2, 3, 4,
895 preptr = 0;
896 for (sign = 0; sign <= 1; sign++) {
897 for (eptr = 0; eptr < sizeof(exps)/sizeof(*exps); eptr++) {
898 se = (sign ? 0x80000000 : 0) | ((exps[eptr]+127) << 23);
902 specifics[preptr++] = se | 0;
906 specifics[preptr++] = se | 0x7FFFFF;
910 for (j = 1; j && j <= 0x400000; j <<= 1)
915 for (j = 1; j && j <= 0x400000; j <<= 1)
916 specifics[preptr++] = se | (0x7FFFFF ^ j);
920 for (j = 2; j && j <= 0x100000; j <<= 1)
925 for (j = 4; j && j <= 0x200000; j <<= 1)
926 specifics[preptr++] = se | (0x7FFFFF ^ (j-1));
959 * - with prob 1/5, all 0s down to some point and then random
960 * - with prob 1/5, all 0s up to some point and then random
966 case 0:
981 f &= 0x7FFFFF;
982 f |= (random32() & 0xFF800000);/* FIXME - do better */
996 premax = preptr = 0;
1003 -1, 0, 1, 2, 3, 4, 29, 30, 31, 32, 53, 61, 62, 63, 64, 127,
1023 preptr = 0;
1024 for (sign = 0; sign <= 1; sign++) {
1025 for (eptr = 0; eptr < sizeof(exps)/sizeof(*exps); eptr++) {
1026 se = (sign ? 0x80000000 : 0) | ((exps[eptr]+1023) << 20);
1030 specifics[preptr][0] = 0;
1031 specifics[preptr][1] = 0;
1032 specifics[preptr++][0] |= se;
1036 specifics[preptr][0] = 0xFFFFF;
1037 specifics[preptr][1] = ~0;
1038 specifics[preptr++][0] |= se;
1042 for (j = 1; j && j <= 0x80000000; j <<= 1) {
1043 specifics[preptr][0] = 0;
1045 specifics[preptr++][0] |= se;
1046 if (j & 0xFFFFF) {
1047 specifics[preptr][0] = j;
1048 specifics[preptr][1] = 0;
1049 specifics[preptr++][0] |= se;
1055 for (j = 1; j && j <= 0x80000000; j <<= 1) {
1056 specifics[preptr][0] = 0xFFFFF;
1058 specifics[preptr++][0] |= se;
1059 if (j & 0xFFFFF) {
1060 specifics[preptr][0] = 0xFFFFF ^ j;
1061 specifics[preptr][1] = ~0;
1062 specifics[preptr++][0] |= se;
1068 for (j = 2; j && j <= 0x80000000; j <<= 1) {
1069 specifics[preptr][0] = 0;
1071 specifics[preptr++][0] |= se;
1073 for (j = 1; j && j <= 0x20000; j <<= 1) {
1074 specifics[preptr][0] = 2*j-1;
1075 specifics[preptr][1] = ~0;
1076 specifics[preptr++][0] |= se;
1081 for (j = 4; j && j <= 0x80000000; j <<= 1) {
1082 specifics[preptr][0] = 0xFFFFF;
1084 specifics[preptr++][0] |= se;
1086 for (j = 1; j && j <= 0x40000; j <<= 1) {
1087 specifics[preptr][0] = 0xFFFFF ^ (j-1);
1088 specifics[preptr][1] = 0;
1089 specifics[preptr++][0] |= se;
1109 t = specifics[n][0];
1110 specifics[n][0] = specifics[preptr-1][0];
1111 specifics[preptr-1][0] = t; /* (not really needed) */
1112 ret[0] = t;
1127 * - with prob 1/5, all 0s down to some point and then random
1128 * - with prob 1/5, all 0s up to some point and then random
1135 case 0:
1143 f = ~0;
1152 f = 0;
1161 g = 0;
1170 g = ~0;
1174 g &= 0xFFFFF;
1175 g |= (random32() & 0xFFF00000);/* FIXME - do better */
1176 ret[0] = g;
1184 out[0] = highbound - random_upto_biased(highbound-lowbound, 8);
1185 out[1] = random_upto(0xFFFFFFFF);
1186 out[0] |= random_sign;
1193 out[0] = highbound - random_upto_biased(highbound-lowbound, 8);
1194 out[1] = random_upto(0xFFFFFFFF);
1201 out[0] = highbound - random_upto_biased(highbound-lowbound, 8);
1202 out[1] = 0;
1203 out[0] |= random_sign;
1244 out[0] = highbound - random_upto(highbound-lowbound);
1245 out[1] = random_upto(0xFFFFFFFF);
1246 out[0] |= random_sign;
1252 out[0] = highbound - random_upto(highbound-lowbound);
1253 out[1] = 0;
1254 out[0] |= random_sign;
1261 out[0] = highbound - random_upto(highbound-lowbound);
1262 out[1] = random_upto(0xFFFFFFFF);
1268 out[0] = highbound - random_upto(highbound-lowbound);
1269 out[1] = 0;
1277 out[0] = random_upto(0x7FEFFFFF);
1278 out[1] = random_upto(0xFFFFFFFF);
1285 out[0] = random_upto(0x7F7FFFFF);
1286 out[1] = 0;
1293 if (sign == 0) {
1294 cases_uniform_positive(out, 0x3c700000, 0x43400000);
1296 cases_uniform_positive(out, 0x3c000000, 0x3ff00000);
1298 out[0] |= sign;
1304 if (sign == 0) {
1305 cases_uniform_float_positive(out, 0x32000000, 0x4c000000);
1307 cases_uniform_float_positive(out, 0x30000000, 0x3f800000);
1309 out[0] |= sign;
1315 out[0] = random_upto(0x7FEFFFFF);
1316 out[1] = random_upto(0xFFFFFFFF);
1317 out[0] |= random_sign;
1318 out[2] = random_upto(0x7FEFFFFF);
1319 out[3] = random_upto(0xFFFFFFFF);
1327 out[0] = random_upto(0x7F7FFFFF);
1328 out[1] = 0;
1329 out[0] |= random_sign;
1330 out[2] = random_upto(0x7F7FFFFF);
1331 out[3] = 0;
1339 out[0] = ((0x3fc00000 + random_upto(0x036fffff)) |
1341 out[1] = random_upto(0xFFFFFFFF);
1348 out[0] = ((0x3e000000 + random_upto(0x0cffffff)) |
1350 out[1] = 0; /* for iszero */
1359 if (expdiff < 0) {
1363 swap = 0;
1364 out[swap ^ 0] = random_upto(0x7FEFFFFF-((expdiff+1)<<20));
1365 out[swap ^ 2] = random_upto(((expdiff+1)<<20)-1) + out[swap ^ 0];
1366 out[1] = random_upto(0xFFFFFFFF);
1367 out[3] = random_upto(0xFFFFFFFF);
1368 out[0] |= random_sign;
1378 if (expdiff < 0) {
1382 swap = 0;
1383 out[swap ^ 0] = random_upto(0x7F7FFFFF-((expdiff+1)<<23));
1384 out[swap ^ 2] = random_upto(((expdiff+1)<<23)-1) + out[swap ^ 0];
1385 out[0] |= random_sign;
1387 out[1] = out[3] = 0; /* for iszero */
1394 * Pick an exponent e (-0x33 to +0x7FE) for x, and here's the
1397 * For e < 0x3FE, the range is [-0x400/(0x3FE-e),+0x432/(0x3FE-e)]
1398 * For e > 0x3FF, the range is [-0x432/(e-0x3FF),+0x400/(e-0x3FF)]
1400 * For e == 0x3FE or e == 0x3FF, the range gets infinite at one
1403 * 0x3ff00000.00000001 whereas 52 is anything at least as big
1404 * as 0x3ff80000.00000000; for e == 0x3fe, 1 necessarily means
1405 * 0x3fefffff.ffffffff and 52 is anything at most as big as
1406 * 0x3fe80000.00000000). Then, as it happens, a sensible
1407 * maximum power is 2^(63-n) for e == 0x3fe, and 2^(62-n) for
1408 * e == 0x3ff.
1419 const uint32 pmin = 0x3e100000;
1425 0x3FE - random_upto_biased(0x431,2) : /* small */
1426 0x3FF + random_upto_biased(0x3FF,2)); /* big */
1431 if (e < 0x3FE || e > 0x3FF) {
1433 if (e < 0x3FE)
1434 imin = 0x40000 / (0x3FE - e), imax = 0x43200 / (0x3FE - e);
1436 imin = 0x43200 / (e - 0x3FF), imax = 0x40000 / (e - 0x3FF);
1441 n = (e > 0 ? 53 : 52+e);
1445 if (e == 0x3FE)
1449 dmax = (dmax << 20) + 0x3FF00000;
1454 out[0] = 0;
1457 out[0] = 1;
1458 out[1] = random_upto(0xFFFFFFFF);
1460 out[0] = random_upto((1 << (n-33)) - 1) + (1 << (n-33));
1461 out[1] = random_upto(0xFFFFFFFF);
1463 /* Negate the mantissa if e == 0x3FE. */
1464 if (e == 0x3FE) {
1466 out[0] = -out[0];
1467 if (out[1]) out[0]--;
1470 out[0] &= 0xFFFFF;
1471 out[0] |= ((e > 0 ? e : 0) << 20);
1478 out[2] = (dmin - random_upto_biased(dmin-pmin, 10)) | 0x80000000;
1480 out[3] = random_upto(0xFFFFFFFF);
1485 * Pick an exponent e (-0x16 to +0xFE) for x, and here's the
1488 * For e < 0x7E, the range is [-0x80/(0x7E-e),+0x95/(0x7E-e)]
1489 * For e > 0x7F, the range is [-0x95/(e-0x7F),+0x80/(e-0x7F)]
1491 * For e == 0x7E or e == 0x7F, the range gets infinite at one
1494 * 0x3f800001 whereas 23 is anything at least as big as
1495 * 0x3fc00000; for e == 0x7e, 1 necessarily means 0x3f7fffff
1496 * and 23 is anything at most as big as 0x3f400000). Then, as
1498 * 0x7e, and 2^(30-n) for e == 0x7f.
1509 const uint32 pmin = 0x38000000;
1515 0x7E - random_upto_biased(0x94,2) : /* small */
1516 0x7F + random_upto_biased(0x7f,2)); /* big */
1521 if (e < 0x7E || e > 0x7F) {
1523 if (e < 0x7E)
1524 imin = 0x8000 / (0x7e - e), imax = 0x9500 / (0x7e - e);
1526 imin = 0x9500 / (e - 0x7f), imax = 0x8000 / (e - 0x7f);
1531 n = (e > 0 ? 24 : 23+e);
1535 if (e == 0x7E)
1539 dmax = (dmax << 23) + 0x3F800000;
1543 out[0] = random_upto((1 << (n-1)) - 1) + (1 << (n-1));
1544 out[1] = 0;
1545 /* Negate the mantissa if e == 0x7E. */
1546 if (e == 0x7E) {
1547 out[0] = -out[0];
1550 out[0] &= 0x7FFFFF;
1551 out[0] |= ((e > 0 ? e : 0) << 23);
1558 out[2] = (dmin - random_upto_biased(dmin-pmin, 10)) | 0x80000000;
1560 out[3] = 0;
1564 int declined = 0;
1574 declined |= lib_fo && is_dhard(args+0);
1582 declined |= lib_fo && is_shard(args+0);
1589 declined |= lib_fo && is_dhard(args+0);
1598 declined |= lib_fo && is_shard(args+0);
1602 declined |= lib_fo && is_dhard(args+0);
1608 declined |= lib_fo && is_shard(args+0);
1636 declined |= lib_fo && is_dhard(result+0);
1643 declined |= lib_fo && is_shard(result+0);
1647 declined |= lib_fo && is_dhard(result+0);
1652 declined |= lib_fo && is_shard(result+0);
1689 rejected = 0; /* FIXME */
1698 printf(" op1=%08x.%08x", args[0], args[1]);
1706 printf(" op1=%08x", args[0]);
1711 printf(" op1=%08x.%08x", args[0], args[1]);
1718 printf(" op1=%08x", args[0]);
1722 printf(" op1=%08x.%08x", args[0], args[1]);
1727 printf(" op1r=%08x.%08x", args[0], args[1]);
1731 printf(" op1r=%08x.%08x", args[0], args[1]);
1738 printf(" op1r=%08x", args[0]);
1742 printf(" op1r=%08x", args[0]);
1759 if (rejected == 0) {
1762 set_mpfr_d(a, args[0], args[1]);
1765 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1768 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1771 set_mpc_d(ac, args[0], args[1], args[2], args[3]);
1774 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1777 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1780 set_mpfr_f(a, args[0]);
1783 get_mpfr_f(r, &result[0], &result[1]);
1786 get_mpfr_f(r, &result[0], &result[1]);
1789 set_mpc_f(ac, args[0], args[2]);
1792 get_mpfr_f(r, &result[0], &result[1]);
1795 get_mpfr_f(r, &result[0], &result[1]);
1798 set_mpfr_d(a, args[0], args[1]);
1803 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1806 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1809 set_mpfr_f(a, args[0]);
1814 get_mpfr_f(r, &result[0], &result[1]);
1817 get_mpfr_f(r, &result[0], &result[1]);
1820 set_mpfr_d(a, args[0], args[1]);
1823 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1828 get_mpfr_d(r, &result[0], &result[1], &result[2]);
1831 set_mpfr_f(a, args[0]);
1834 get_mpfr_f(r, &result[0], &result[1]);
1839 get_mpfr_f(r, &result[0], &result[1]);
1870 errstr = ((testclassify)(fn->func))(args, &result[0]);
1873 errstr = ((testclassifyf)(fn->func))(args, &result[0]);
1876 set_mpc_d(ac, args[0], args[1], args[2], args[3]);
1879 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]);
1882 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]);
1885 set_mpc_d(ac, args[0], args[1], args[2], args[3]);
1890 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]);
1893 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]);
1896 set_mpc_f(ac, args[0], args[2]);
1899 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]);
1902 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]);
1905 set_mpc_f(ac, args[0], args[2]);
1910 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]);
1913 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]);
1927 if (rejected == 0) {
1930 if ((result[0] & 0x7FFFFFFF) == 0 && result[1] == 0) {
1932 * If the output is +0 or -0 apart from the extra
1963 if (result[2] < 0x40000000) {
1969 printextra = 0;
1976 } else if (!(result[0] & 0x7ff00000)) {
1994 } else if ((result[0] & 0x7FFFFFFF) > 0x7FEFFFFF) {
2001 (args[0] & 0x80000000) != 0 && /* negative */
2007 printextra = 0;
2010 /* lgamma(0) is also a pole. */
2013 printextra = 0;
2018 if (!printextra || (rejected && !(rejected==1 && result[2]!=0))) {
2020 result[0], result[1]);
2023 result[0], result[1], (result[2] >> 20) & 0xFFF);
2034 if (rejected == 0) {
2037 if ((result[0] & 0x7FFFFFFF) == 0) {
2044 if (result[1] < 0x40000000) {
2046 printextra = 0;
2050 } else if (!(result[0] & 0x7f800000)) {
2065 } else if ((result[0] & 0x7FFFFFFF) > 0x7F7FFFFF) {
2072 (args[0] & 0x80000000) != 0 && /* negative */
2078 printextra = 0;
2081 /* lgamma(0) is also a pole. */
2084 printextra = 0;
2089 if (!printextra || (rejected && !(rejected==1 && result[1]!=0))) {
2091 result[0]);
2094 result[0], (result[1] >> 20) & 0xFFF);
2103 printf(" result=%08x.%08x", result[0], result[1]);
2108 printf(" result=%08x", result[0]);
2111 printf(" result=%08x.%08x res2=%08x", result[0], result[1],
2116 result[0], result[1], result[2], result[3]);
2121 printf(" result=%08x res2=%08x", result[0], result[2]);
2127 printf(" result=%x", result[0]);
2131 if (0/* errstr */) {
2132 printf(" resultr=%08x.%08x", result[0], result[1]);
2136 result[0], result[1], (result[2] >> 20) & 0xFFF);
2138 result[4], result[5], (result[6] >> 20) & 0xFFF);
2145 if (0/* errstr */) {
2146 printf(" resultr=%08x", result[0]);
2150 result[0], (result[1] >> 20) & 0xFFF);
2152 result[4], (result[5] >> 20) & 0xFFF);
2159 if (errstr && *(errstr+1) == '\0') {
2160 printf(" errno=0 status=%c",*errstr);
2163 } else if (errstr && errstr[0] == 'E') {
2166 printf(" error=%s", errstr && *errstr ? errstr : "0");
2171 vet_for_decline(fn, args, result, 0);
2190 for (i = 0; i < number; i++) {
2199 int e = 0x412 + scale;
2200 while (!(x & 0x100000))
2206 int e = 0x95 + scale;
2207 while (!(x & 0x800000))