From 41b14ecb2610582284cedc2381b7ba28af825811 Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Sat, 20 Mar 2021 17:30:17 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/mpfr.git#d89286dc3e0ed5bc981f40a92d7c2d3d94021b8c --- allpatches | 251 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mpfr.spec | 7 +- 2 files changed, 257 insertions(+), 1 deletion(-) diff --git a/allpatches b/allpatches index 65c218b..2f9fa04 100644 --- a/allpatches +++ b/allpatches @@ -1579,3 +1579,254 @@ diff -Naurd mpfr-4.1.0-a/tests/tj0.c mpfr-4.1.0-b/tests/tj0.c mpfr_init (x); mpfr_init (y); +diff -Naurd mpfr-4.1.0-a/PATCHES mpfr-4.1.0-b/PATCHES +--- mpfr-4.1.0-a/PATCHES 2021-02-17 17:22:34.594973310 +0000 ++++ mpfr-4.1.0-b/PATCHES 2021-02-17 17:22:34.702972090 +0000 +@@ -0,0 +1 @@ ++digamma-interm-zero2 +diff -Naurd mpfr-4.1.0-a/VERSION mpfr-4.1.0-b/VERSION +--- mpfr-4.1.0-a/VERSION 2021-02-11 12:53:38.426850512 +0000 ++++ mpfr-4.1.0-b/VERSION 2021-02-17 17:22:34.702972090 +0000 +@@ -1 +1 @@ +-4.1.0-p7 ++4.1.0-p8 +diff -Naurd mpfr-4.1.0-a/src/digamma.c mpfr-4.1.0-b/src/digamma.c +--- mpfr-4.1.0-a/src/digamma.c 2021-02-11 12:52:52.547350357 +0000 ++++ mpfr-4.1.0-b/src/digamma.c 2021-02-17 17:22:34.690972226 +0000 +@@ -173,16 +173,19 @@ + mpfr_digamma (v, u, MPFR_RNDN); /* error <= 1/2 ulp */ + expv = MPFR_GET_EXP (v); + mpfr_sub (v, v, t, MPFR_RNDN); +- if (MPFR_GET_EXP (v) < MPFR_GET_EXP (t)) +- e1 += MPFR_EXP(t) - MPFR_EXP(v); /* scale error for t wrt new v */ +- /* now take into account the 1/2 ulp error for v */ +- if (expv - MPFR_EXP(v) - 1 > e1) +- e1 = expv - MPFR_EXP(v) - 1; +- else +- e1 ++; +- e1 ++; /* rounding error for mpfr_sub */ +- if (MPFR_CAN_ROUND (v, p - e1, MPFR_PREC(y), rnd_mode)) +- break; ++ if (MPFR_NOTZERO(v)) ++ { ++ if (MPFR_GET_EXP (v) < MPFR_GET_EXP (t)) ++ e1 += MPFR_EXP(t) - MPFR_EXP(v); /* scale error for t wrt new v */ ++ /* now take into account the 1/2 ulp error for v */ ++ if (expv - MPFR_EXP(v) - 1 > e1) ++ e1 = expv - MPFR_EXP(v) - 1; ++ else ++ e1 ++; ++ e1 ++; /* rounding error for mpfr_sub */ ++ if (MPFR_CAN_ROUND (v, p - e1, MPFR_PREC(y), rnd_mode)) ++ break; ++ } + MPFR_ZIV_NEXT (loop, p); + mpfr_set_prec (t, p); + mpfr_set_prec (v, p); +@@ -416,10 +419,8 @@ + } + } + +- if (MPFR_IS_NEG(x)) +- inex = mpfr_digamma_reflection (y, x, rnd_mode); + /* if x < 1/2 we use the reflection formula */ +- else if (MPFR_EXP(x) < 0) ++ if (MPFR_IS_NEG(x) || MPFR_EXP(x) < 0) + inex = mpfr_digamma_reflection (y, x, rnd_mode); + else + inex = mpfr_digamma_positive (y, x, rnd_mode); +diff -Naurd mpfr-4.1.0-a/src/mpfr.h mpfr-4.1.0-b/src/mpfr.h +--- mpfr-4.1.0-a/src/mpfr.h 2021-02-11 12:53:38.422850555 +0000 ++++ mpfr-4.1.0-b/src/mpfr.h 2021-02-17 17:22:34.702972090 +0000 +@@ -27,7 +27,7 @@ + #define MPFR_VERSION_MAJOR 4 + #define MPFR_VERSION_MINOR 1 + #define MPFR_VERSION_PATCHLEVEL 0 +-#define MPFR_VERSION_STRING "4.1.0-p7" ++#define MPFR_VERSION_STRING "4.1.0-p8" + + /* User macros: + MPFR_USE_FILE: Define it to make MPFR define functions dealing +diff -Naurd mpfr-4.1.0-a/src/version.c mpfr-4.1.0-b/src/version.c +--- mpfr-4.1.0-a/src/version.c 2021-02-11 12:53:38.426850512 +0000 ++++ mpfr-4.1.0-b/src/version.c 2021-02-17 17:22:34.702972090 +0000 +@@ -25,5 +25,5 @@ + const char * + mpfr_get_version (void) + { +- return "4.1.0-p7"; ++ return "4.1.0-p8"; + } +diff -Naurd mpfr-4.1.0-a/tests/tdigamma.c mpfr-4.1.0-b/tests/tdigamma.c +--- mpfr-4.1.0-a/tests/tdigamma.c 2021-02-11 12:52:52.547350357 +0000 ++++ mpfr-4.1.0-b/tests/tdigamma.c 2021-02-17 17:22:34.690972226 +0000 +@@ -110,6 +110,26 @@ + mpfr_clear (y); + } + ++/* another test that fails with GMP_CHECK_RANDOMIZE=1613197421465830 ++ on revision 14429 */ ++static void ++bug20210215 (void) ++{ ++ mpfr_t x, y; ++ int inex; ++ ++ mpfr_init2 (x, 510); ++ mpfr_init2 (y, 4); ++ mpfr_set_str (x, "-8.2923051438433494998166335341807999322052669984208422481227138906096000469898717007386115912802685588348601663465077353194268894939972221117314512518182580e+35", 10, MPFR_RNDN); ++ mpfr_clear_flags (); ++ inex = mpfr_digamma (y, x, MPFR_RNDU); ++ MPFR_ASSERTN (mpfr_cmp_ui0 (y, 88) == 0); ++ MPFR_ASSERTN (inex > 0); ++ MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_INEXACT); ++ mpfr_clear (x); ++ mpfr_clear (y); ++} ++ + int + main (int argc, char *argv[]) + { +@@ -118,6 +138,7 @@ + special (); + bug20210206 (); + bug20210208 (); ++ bug20210215 (); + + test_generic (MPFR_PREC_MIN, 200, 20); + +diff -Naurd mpfr-4.1.0-a/PATCHES mpfr-4.1.0-b/PATCHES +--- mpfr-4.1.0-a/PATCHES 2021-02-17 17:25:46.396981483 +0000 ++++ mpfr-4.1.0-b/PATCHES 2021-02-17 17:25:46.440981068 +0000 +@@ -0,0 +1 @@ ++jyn_asympt-interm-zero +diff -Naurd mpfr-4.1.0-a/VERSION mpfr-4.1.0-b/VERSION +--- mpfr-4.1.0-a/VERSION 2021-02-17 17:22:34.702972090 +0000 ++++ mpfr-4.1.0-b/VERSION 2021-02-17 17:25:46.440981068 +0000 +@@ -1 +1 @@ +-4.1.0-p8 ++4.1.0-p9 +diff -Naurd mpfr-4.1.0-a/src/jyn_asympt.c mpfr-4.1.0-b/src/jyn_asympt.c +--- mpfr-4.1.0-a/src/jyn_asympt.c 2021-02-11 12:53:38.410850685 +0000 ++++ mpfr-4.1.0-b/src/jyn_asympt.c 2021-02-17 17:25:46.424981219 +0000 +@@ -69,7 +69,7 @@ + MPFR_ZIV_INIT (loop, w); + for (;;) + { +- int ok = 1; ++ int ok = 0; + + mpfr_set_prec (c, w); + mpfr_init2 (s, w); +@@ -96,10 +96,7 @@ + + /* if s or c is zero, MPFR_GET_EXP will fail below */ + if (MPFR_IS_ZERO(s) || MPFR_IS_ZERO(c)) +- { +- ok = 0; +- goto clear; +- } ++ goto clear; /* with ok=0 */ + + /* precompute 1/(8|z|) */ + mpfr_si_div (iz, MPFR_IS_POS(z) ? 1 : -1, z, MPFR_RNDN); /* err <= 1 */ +@@ -227,6 +224,9 @@ + mpfr_sub (s, c, s, MPFR_RNDN); + #endif + } ++ if (MPFR_IS_ZERO(s)) ++ goto clear; /* with ok=0 */ ++ ok = 1; + if ((n & 2) != 0) + mpfr_neg (s, s, MPFR_RNDN); + if (MPFR_GET_EXP (s) > err) +diff -Naurd mpfr-4.1.0-a/src/mpfr.h mpfr-4.1.0-b/src/mpfr.h +--- mpfr-4.1.0-a/src/mpfr.h 2021-02-17 17:22:34.702972090 +0000 ++++ mpfr-4.1.0-b/src/mpfr.h 2021-02-17 17:25:46.436981105 +0000 +@@ -27,7 +27,7 @@ + #define MPFR_VERSION_MAJOR 4 + #define MPFR_VERSION_MINOR 1 + #define MPFR_VERSION_PATCHLEVEL 0 +-#define MPFR_VERSION_STRING "4.1.0-p8" ++#define MPFR_VERSION_STRING "4.1.0-p9" + + /* User macros: + MPFR_USE_FILE: Define it to make MPFR define functions dealing +diff -Naurd mpfr-4.1.0-a/src/version.c mpfr-4.1.0-b/src/version.c +--- mpfr-4.1.0-a/src/version.c 2021-02-17 17:22:34.702972090 +0000 ++++ mpfr-4.1.0-b/src/version.c 2021-02-17 17:25:46.440981068 +0000 +@@ -25,5 +25,5 @@ + const char * + mpfr_get_version (void) + { +- return "4.1.0-p8"; ++ return "4.1.0-p9"; + } +diff -Naurd mpfr-4.1.0-a/tests/mpfr-test.h mpfr-4.1.0-b/tests/mpfr-test.h +--- mpfr-4.1.0-a/tests/mpfr-test.h 2020-06-29 13:57:32.000000000 +0000 ++++ mpfr-4.1.0-b/tests/mpfr-test.h 2021-02-17 17:25:46.424981219 +0000 +@@ -191,6 +191,8 @@ + + #define mpfr_cmp0(x,y) (MPFR_ASSERTN (!MPFR_IS_NAN (x) && !MPFR_IS_NAN (y)), mpfr_cmp (x,y)) + #define mpfr_cmp_ui0(x,i) (MPFR_ASSERTN (!MPFR_IS_NAN (x)), mpfr_cmp_ui (x,i)) ++#define mpfr_cmp_si_2exp0(x,i,e) (MPFR_ASSERTN (!MPFR_IS_NAN (x)), \ ++ mpfr_cmp_si_2exp (x,i,e)) + + /* define CHECK_EXTERNAL if you want to check mpfr against another library + with correct rounding. You'll probably have to modify mpfr_print_raw() +diff -Naurd mpfr-4.1.0-a/tests/tj1.c mpfr-4.1.0-b/tests/tj1.c +--- mpfr-4.1.0-a/tests/tj1.c 2020-01-08 18:11:13.000000000 +0000 ++++ mpfr-4.1.0-b/tests/tj1.c 2021-02-17 17:25:46.424981219 +0000 +@@ -55,14 +55,14 @@ + /* since |x| is just above 2^e, |j1(x)| is just above 2^(e-1), + thus y should be 2^(e-1) and the inexact flag should be + of opposite sign of x */ +- MPFR_ASSERTN(mpfr_cmp_si_2exp (y, sign, e - 1) == 0); ++ MPFR_ASSERTN(mpfr_cmp_si_2exp0 (y, sign, e - 1) == 0); + MPFR_ASSERTN(VSIGN (inex) * sign < 0); + } + else + { + /* here |y| should be 0.5*2^emin and the inexact flag should + have the sign of x */ +- MPFR_ASSERTN(mpfr_cmp_si_2exp (y, sign, e) == 0); ++ MPFR_ASSERTN(mpfr_cmp_si_2exp0 (y, sign, e) == 0); + MPFR_ASSERTN(VSIGN (inex) * sign > 0); + } + } +@@ -72,6 +72,26 @@ + mpfr_clear (y); + } + ++/* a test that fails with GMP_CHECK_RANDOMIZE=1613146232984428 ++ on revision 14429 */ ++static void ++bug20210215 (void) ++{ ++ mpfr_t x, y; ++ int inex; ++ ++ mpfr_init2 (x, 221); ++ mpfr_init2 (y, 1); ++ mpfr_set_str (x, "1.6484611511696130037307738844228498447763863563070374544054791168614e+01", 10, MPFR_RNDN); ++ mpfr_clear_flags (); ++ inex = mpfr_j1 (y, x, MPFR_RNDZ); ++ MPFR_ASSERTN (mpfr_cmp_si_2exp0 (y, -1, -9) == 0); ++ MPFR_ASSERTN (inex > 0); ++ MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_INEXACT); ++ mpfr_clear (x); ++ mpfr_clear (y); ++} ++ + int + main (int argc, char *argv[]) + { +@@ -79,6 +99,8 @@ + + tests_start_mpfr (); + ++ bug20210215 (); ++ + test_small (); + + mpfr_init (x); diff --git a/mpfr.spec b/mpfr.spec index 1fac1b3..272dfc9 100644 --- a/mpfr.spec +++ b/mpfr.spec @@ -1,7 +1,7 @@ Summary: C library for multiple-precision floating-point computations Name: mpfr Version: 4.1.0 -Release: 4%{?dist} +Release: 5%{?dist} URL: https://www.mpfr.org/ License: LGPLv3+ @@ -17,6 +17,8 @@ Source0: https://www.mpfr.org/%{name}-%{version}/%{name}-%{version}.tar.xz # - digamma-hugemem.patch # - digamma-interm-zero.patch # - jn-interm-zero.patch +# - digamma-interm-zero2.patch +# - jyn-asympt-interm-zero.patch Patch0: https://www.mpfr.org/%{name}-%{version}/allpatches # This can be removed when F32 reaches EOL @@ -105,6 +107,9 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{_infodir}/mpfr.info* %changelog +* Tue Mar 9 2021 Jerry James - 4.1.0-5 +- Add upstream patches 8-9 + * Wed Feb 17 2021 Jerry James - 4.1.0-4 - Add upstream patches 1-7