summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Attempt to eliminate issues with aliasing rules. But this triggersubf2vlefevre2020-03-265-35/+48
| | | | | | | a new failure with -Werror=strict-aliasing on src/fma.c due to <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94337>. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/ubf2@13820 280ebfd0-de03-0410-8827-d642c229c3f4
* Merged the latest changes from the trunk (r13818).vlefevre2020-03-261-21/+21
|\ | | | | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/ubf2@13819 280ebfd0-de03-0410-8827-d642c229c3f4
| * [tests/tsub.c] Avoid the build failure with -Werror=strict-aliasing byvlefevre2020-03-261-21/+21
| | | | | | | | | | | | replacing x[…] by p[…] (but this doesn't eliminate the problem itself). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13818 280ebfd0-de03-0410-8827-d642c229c3f4
* | Created ubf2 branch for experimental UBF code attempting to avoidvlefevre2020-03-260-0/+0
|/ | | | | | breaking the aliasing rules. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/ubf2@13817 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] UBF: updated comment: this breaks aliasing rules, butvlefevre2020-03-261-3/+5
| | | | | | | | | there isn't any other acceptable solution. Note: when trying to build MPFR without --enable-assert, with GCC and CFLAGS="-O2 -Werror=strict-aliasing", the compilation of tests/tsub.c currently fails because of that. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13816 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] Fixed tests on UBF.vlefevre2020-03-251-3/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13815 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sub1.c] Fixed underflow handling in case c small (can occur onlyvlefevre2020-03-251-1/+7
| | | | | | with UBF). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13814 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tfma.c] Minor correction.vlefevre2020-03-251-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13813 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tfma.c] Changed a RND_LOOP to RND_LOOP_NO_RNDF as the behaviorvlefevre2020-03-251-1/+1
| | | | | | with RNDF changed after a bug fix. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13812 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] Completed tests for UBF (currently fail).vlefevre2020-03-251-3/+38
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13811 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sub1.c] Bug fix for UBF and MPFR_RNDF.vlefevre2020-03-251-0/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13810 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/set_{si,ui}_2exp.c] Bug fix in MPFR_LONG_WITHIN_LIMB defined case:vlefevre2020-03-252-0/+18
| | | | | | | added early underflow/overflow checking to avoid integer overflow or errors due to special exponent values. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13809 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_si.c] Added tests of mpfr_set_si_2exp and mpfr_set_ui_2expvlefevre2020-03-251-0/+129
| | | | | | | | | in precision 3 with integers from -31 to 31 and exponents MPFR_EXP_MIN, MPFR_EMIN_MIN-7 to MPFR_EMIN_MIN, MPFR_EMAX_MAX-7 to MPFR_EMAX_MAX, MPFR_EXP_MAX-7 to MPFR_EXP_MAX, showing bugs in these functions when MPFR_LONG_WITHIN_LIMB is defined. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13808 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] More tests on UBF. The results are not checked yet,vlefevre2020-03-241-11/+38
| | | | | | | but running the tests with UBsan could allow one to trigger bugs (such as the one fixed in r13806). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13807 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sub1.c] If exp_b = MPFR_EXP_MIN, an integer overflow may occur invlefevre2020-03-241-0/+9
| | | | | | | the "MAX (aq, bq) + 2 <= diff_exp" branch. This is possible only with UBF. Fixed this bug with an early underflow detection in the UBF case. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13806 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tfmma.c] Added extreme_underflow test: before the r13798 bug fix,vlefevre2020-03-241-0/+21
| | | | | | this was triggering an integer overflow. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13805 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] Corrected a function name.vlefevre2020-03-241-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13804 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] More tests on UBF, in particular with an exponent changevlefevre2020-03-241-20/+74
| | | | | | (including subnormal → normal and normal → overflow due to that). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13803 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] Tests on UBF: underflow/overflow cases done.vlefevre2020-03-241-28/+41
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13802 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] More tests on UBF.vlefevre2020-03-231-11/+140
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13801 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] UBF: reordered macro definitions.vlefevre2020-03-231-4/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13800 280ebfd0-de03-0410-8827-d642c229c3f4
* [src]vlefevre2020-03-233-3/+8
| | | | | | | * mpfr-impl.h: define MPFR_UBF_GET_EXP macro. * add1.c, sub1.c: use this macro. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13799 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sub1.c] Detect an underflow case (before the main detection) tovlefevre2020-03-231-0/+9
| | | | | | avoid a possible integer overflow with UBF. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13798 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] Added comments.vlefevre2020-03-231-0/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13797 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsub.c] First tests on UBF.vlefevre2020-03-231-0/+90
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13796 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/agm.c] Avoid a potential integer overflow with huge precisions.vlefevre2020-03-231-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13795 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/root.c] Removed useless cast in a comparison, as both operands arevlefevre2020-03-161-1/+1
| | | | | | non-negative. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13794 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/rem1.c]vlefevre2020-03-161-2/+4
| | | | | | | | | | | | * Portability fix: when mpfr_exp_t <= long (which is the default), an addition was done in unsigned integer arithmetic instead of signed integer arithmetic, with a conversion back to a signed type, i.e. with potentially implementation-defined behavior. There could also be an integer overflow on huge-precision values if mp_bitcnt_t > unsigned long. * Updated a comment. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13793 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/pow.c]vlefevre2020-03-161-4/+7
| | | | | | | | | | | | * Portability fix: when mpfr_exp_t <= long (which is the default), an addition with a negative result was done in unsigned integer arithmetic instead of signed integer arithmetic, with a conversion back to a signed type, i.e. with implementation-defined behavior. There could also be an integer overflow on huge-precision values if mp_bitcnt_t > unsigned long. * Updated comments. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13792 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/cos.c] Updated a comment.vlefevre2020-03-161-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13791 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/cos.c] Updated a comment.vlefevre2020-03-161-1/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13790 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/const_log2.c] Corrected type for the return value of mpz_scan1.vlefevre2020-03-161-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13789 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Revert a change done in r13783 for function bad_cases():vlefevre2020-03-132-8/+27
| | | | | | | | | no longer fail if a generated value does not correspond to a bad case. But fail if the MPFR_CHECK_BADCASES environment variable is defined and too few bad cases are generated (less than 90%). [doc/README.dev] Document MPFR_CHECK_BADCASES. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13788 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests] Update to test the ternary value in test5rm() when possible,vlefevre2020-03-134-46/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | and support the exact cases. * tests.c: - test5rm(): modified the prototype again and the behavior. Now, either only one test is done and the ternary value is not checked, or the test is done in the 5 rounding modes and the ternary value is checked. - data_check(): corresponding update; updated description. - bad_cases(): test the exact cases too. * tatanh.c: for the bad_cases() call, reduce emax to avoid errors in the generation of bad cases due to the rounding of tanh(y) to 1, which does not correspond to a bad case for atanh, but to an exact case. * tlog1p.c: for the bad_cases() call, reduce emax to avoid errors in the generation of bad cases due to the rounding of expm1(y) to -1, which does not correspond to a bad case for log1p, but to an exact case. * trec_sqrt.c: corrected the bad_cases() call to avoid negative numbers. Note: the following tests GMP_CHECK_RANDOMIZE=5 ./tacos GMP_CHECK_RANDOMIZE=6 ./tatan GMP_CHECK_RANDOMIZE=4 ./tcos currently fail, but because of a change in r13783 (see associated log for the reason). To be fixed later. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13787 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Modified the prototype of test5rm() to support avlefevre2020-03-131-17/+16
| | | | | | | | | parameter "exact". Therefore the parameter "test_one" is now a boolean (the value 2 is no longer supported, as redundant with "exact"), and about data_check() with rnd = '*', the loop is now done in test5rm(), i.e. test5rm() is called with test_one being false. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13786 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsqrt.c] For bad_cases(), use the same pos and psup parametersvlefevre2020-03-121-1/+1
| | | | | | as in troot.c for "rootn[2]", allowing inexact cases. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13785 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcbrt.c] For bad_cases(), use the same pos and psup parametersvlefevre2020-03-121-1/+1
| | | | | | as in troot.c for "rootn[3]", allowing inexact cases. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13784 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests]vlefevre2020-03-122-10/+15
| | | | | | | | | | | | | | | | | | | | | | | * tests.c, function bad_cases(): updated/added debug messages; assume that the parameters are chosen in such a way that this test always generates hard-to-round cases (including exact cases), i.e. exit with an error if one does not get a bad case, otherwise this can leave unexpected failures unnoticed (either due to a bug in the MPFR library or due to poorly chosen parameters such as in troot.c until now). Note: ideally, this would require a proof, but it is better to get (unlikely) spurious failures with a non-default GMP_CHECK_RANDOMIZE value than missing important tests. * troot.c, bad_cases() invocation: - corrected the pos parameter: when n is even, it is useless to generate a negative number as the function is not defined (the inverse function generates a positive number, and the mismatch now yields a failure due to the change in bad_cases); when n is odd, generate as many negative numbers as positive ones. - for n ≤ 5, reduce the psup parameter in order to also generate inexact cases, instead of always exact cases. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13783 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Added a TODO for bad_cases, as the exact cases are notvlefevre2020-03-121-0/+3
| | | | | | | tested yet. As a consequence, the bad_cases test added in tcbrt.c r13776 is not really useful yet, as the cbrt bad cases are only exact cases. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13782 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c]vlefevre2020-03-121-31/+26
| | | | | | | | | | | | | * test5rm: removed additional useless tests added in r6037 in the case test_one true and rnd = MPFR_RNDZ or MPFR_RNDA, since the description was a bit incorrect and this was used only by - data/digamma, where this yielded only duplicate tests (mode *); - data/li2, where mode z is used on a few tests and could be replaced by mode Z (i.e. test_one false) if need be; updated description and added details. * data_check: corrected/updated description. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13781 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Minor change in an initialization.vlefevre2020-03-121-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13780 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_set_{d64,d128}.c] Added a FIXME and improved a message.vlefevre2020-03-122-3/+7
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13779 280ebfd0-de03-0410-8827-d642c229c3f4
* [acinclude.m4] Added a FIXME: in case of cross-compiling, the guessvlefevre2020-03-121-0/+9
| | | | | | | | "DPD" can be wrong, e.g. for the build with MinGW under Linux. One does not get a failure just because of other issues in the code, forcing the portable implementation of the decimal functions. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13778 280ebfd0-de03-0410-8827-d642c229c3f4
* Added bad_cases tests for mpfr_cbrt.vlefevre2020-03-111-0/+7
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13776 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/cbrt.c] Improved the algorithm in the case the precision of thevlefevre2020-03-111-44/+40
| | | | | | | | input is larger than 3n, where n is the precision of the output, + 1 if the rounding mode is MPFR_RNDN: instead of truncating the output, call mpz_root on the truncated input. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13775 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcbrt.c] Test the ternary value on other exact cases.vlefevre2020-03-111-14/+16
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13774 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcbrt.c] Test the ternary value on special cases.vlefevre2020-03-111-6/+32
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13773 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/cbrt.c] Description of the algorithm: improvement; corrected thevlefevre2020-03-111-11/+8
| | | | | | | | | end, which was incorrect and did not match the code (the comment was introduced in r2057 and was already incorrect in the round-down case; then the round-to-nearest case was improved in r2070, but the comment was not updated). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13772 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/cbrt.c] Description of the algorithm: correction; added a TODO.vlefevre2020-03-111-4/+13
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13771 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/cbrt.c] Description of the algorithm: corrected indentation;vlefevre2020-03-101-15/+15
| | | | | | | renamed variable r to t in order to avoid confusion with the code (where r has a different meaning). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13769 280ebfd0-de03-0410-8827-d642c229c3f4