]> git.ipfire.org Git - ipfire-2.x.git/commit - lfs/mpfr
mpfr: Update with latest bug patches
authorAdolf Belka <adolf.belka@ipfire.org>
Fri, 19 May 2023 17:04:49 +0000 (19:04 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 15 Jun 2023 09:37:47 +0000 (09:37 +0000)
commit8e498000ec9e16b7952cc3753f9a976caffe49d9
tree7b39687b36ebaff8efe0ebb76c4e156b175efd4e
parentaec620df453bd2040ec8cc27362e256b5db12d15
mpfr: Update with latest bug patches

- Update version 4.2.0 from 4 bug patches to 9 bug patches
- Update of rootfile not required
- Bug fix changelog
5 The mpfr_reldiff function, which computes |b−c|/b, is buggy on special values,
         e.g. on the following (b,c) values: (+Inf,+Inf) gives ±0 instead of NaN (like
         NaN/Inf); (+0,+0) gives 1 instead of NaN (like 0/0); (+0,1) gives 1 instead of
         Inf (like 1/0). Moreover, the sign of 0 for (+Inf,+Inf) or (−Inf,−Inf) is not
         set, i.e. it is just the sign of the destination before the call; as a
 consequence, results are not even consistent. These bugs are fixed by the
 reldiff patch.
Corresponding changeset in the 4.2 branch: 81e4d4427.
6 The reuse tests are incomplete: the sign of a result zero is not checked, so
 that it can miss bugs (one of the mpfr_reldiff bugs mentioned above, in
 particular). The tests-reuse patch adds a check of the sign of zero and
 contains other minor improvements.
Corresponding changeset in the 4.2 branch: e6d47b8f5.
7 The general code for the power function (mpfr_pow_general internal function) has
 two bugs in particular cases: the first one is an incorrect computation of the
 error bound when there has been an intermediate underflow or overflow (in such
 a case, the computation is performed again with a rescaling, thus with an
 additional error term, but there is a bug in the computation of this term), so
 that the result may be rounded incorrectly (in particular, a spurious overflow
 is possible); the second one occurs in a corner case (destination precision 1,
 rounding to nearest, and where the rounded result assuming an unbounded
 exponent range would be 2emin−2 and the exact result is larger than this value),
 with the only consequence being a missing underflow exception (the underflow
 flag is not set). These two bugs are fixed by the pow_general patch, which also
 provides testcases.
Note: The second bug was introduced by commit 936df8ef6 in MPFR 4.1.0 (the code
 simplification was incorrect, and there were no associated tests in the
 testsuite).
Corresponding changesets in the 4.2 branch: 85bc7331c5fa407a6c9a16c173e.
8 The mpfr_compound_si function can take a huge amount of memory and time in some
 cases (when the argument x is a large even integer and xn is represented exactly
 in the target precision) and does not correctly detect overflows and underflows.
 This is fixed by the compound patch, which also provides various tests.
Corresponding changesets in the 4.2 branch: 7635c4a3574d86a61f952fb0f5c,
 a4894f68d7bb748775f5cb40571d87459969.
9 MPFR can crash when a formatted output function is called with %.2147483648Rg in
 the format string. For instance: mpfr_snprintf (NULL, 0, "%.2147483648Rg\n", x);
 This is fixed by the printf_large_prec_for_g patch, which also provides
 testcases.
Corresponding changesets in the 4.2 branch: 686f82776769ad91a6.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/mpfr
src/patches/mpfr-4.2.0-cumulative-patches-1-to-4.patch [deleted file]
src/patches/mpfr-4.2.0-cumulative-patches-1-to-9.patch [new file with mode: 0644]