Projects
home:pandora:RobinOS23
mpfr
_service:download_src_package:0006-digamma-inte...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:download_src_package:0006-digamma-interm-zero.patch of Package mpfr
diff -Naurd mpfr-4.1.0-a/PATCHES mpfr-4.1.0-b/PATCHES --- mpfr-4.1.0-a/PATCHES 2021-02-11 12:52:52.519350662 +0000 +++ mpfr-4.1.0-b/PATCHES 2021-02-11 12:52:52.563350183 +0000 @@ -0,0 +1 @@ +digamma-interm-zero diff -Naurd mpfr-4.1.0-a/VERSION mpfr-4.1.0-b/VERSION --- mpfr-4.1.0-a/VERSION 2021-02-11 12:50:22.424987002 +0000 +++ mpfr-4.1.0-b/VERSION 2021-02-11 12:52:52.563350183 +0000 @@ -1 +1 @@ -4.1.0-p5 +4.1.0-p6 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:50:22.412987133 +0000 +++ mpfr-4.1.0-b/src/digamma.c 2021-02-11 12:52:52.547350357 +0000 @@ -296,21 +296,26 @@ errt = mpfr_digamma_approx (t, x_plus_j); expt = MPFR_GET_EXP (t); mpfr_sub (t, t, u, MPFR_RNDN); - if (MPFR_GET_EXP (t) < expt) - errt += expt - MPFR_EXP(t); - /* Warning: if u is zero (which happens when x_plus_j >= min at the - beginning of the while loop above), EXP(u) is not defined. - In this case we have no error from u. */ - if (MPFR_NOTZERO(u) && MPFR_GET_EXP (t) < MPFR_GET_EXP (u)) - erru += MPFR_EXP(u) - MPFR_EXP(t); - if (errt > erru) - errt = errt + 1; - else if (errt == erru) - errt = errt + 2; - else - errt = erru + 1; - if (MPFR_CAN_ROUND (t, p - errt, MPFR_PREC(y), rnd_mode)) - break; + /* Warning! t may be zero (more likely in small precision). Note + that in this case, this is an exact zero, not an underflow. */ + if (MPFR_NOTZERO(t)) + { + if (MPFR_GET_EXP (t) < expt) + errt += expt - MPFR_EXP(t); + /* Warning: if u is zero (which happens when x_plus_j >= min at the + beginning of the while loop above), EXP(u) is not defined. + In this case we have no error from u. */ + if (MPFR_NOTZERO(u) && MPFR_GET_EXP (t) < MPFR_GET_EXP (u)) + erru += MPFR_EXP(u) - MPFR_EXP(t); + if (errt > erru) + errt = errt + 1; + else if (errt == erru) + errt = errt + 2; + else + errt = erru + 1; + if (MPFR_CAN_ROUND (t, p - errt, MPFR_PREC(y), rnd_mode)) + break; + } MPFR_ZIV_NEXT (loop, p); mpfr_set_prec (t, p); mpfr_set_prec (u, p); 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:50:22.424987002 +0000 +++ mpfr-4.1.0-b/src/mpfr.h 2021-02-11 12:52:52.559350226 +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-p5" +#define MPFR_VERSION_STRING "4.1.0-p6" /* 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:50:22.424987002 +0000 +++ mpfr-4.1.0-b/src/version.c 2021-02-11 12:52:52.559350226 +0000 @@ -25,5 +25,5 @@ const char * mpfr_get_version (void) { - return "4.1.0-p5"; + return "4.1.0-p6"; } 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:50:22.412987133 +0000 +++ mpfr-4.1.0-b/tests/tdigamma.c 2021-02-11 12:52:52.547350357 +0000 @@ -90,6 +90,26 @@ set_emax (emax); } +/* another test that fails with GMP_CHECK_RANDOMIZE=1612741376857003 + on revision 14398 */ +static void +bug20210208 (void) +{ + mpfr_t x, y; + int inex; + + mpfr_init2 (x, 73); + mpfr_init2 (y, 1); + mpfr_set_str (x, "1.4613470547060071827450", 10, MPFR_RNDN); + mpfr_clear_flags (); + inex = mpfr_digamma (y, x, MPFR_RNDU); + MPFR_ASSERTN (mpfr_cmp_si_2exp (y, -1, -12) == 0); + MPFR_ASSERTN (inex > 0); + MPFR_ASSERTN (__gmpfr_flags == MPFR_FLAGS_INEXACT); + mpfr_clear (x); + mpfr_clear (y); +} + int main (int argc, char *argv[]) { @@ -97,6 +117,7 @@ special (); bug20210206 (); + bug20210208 (); test_generic (MPFR_PREC_MIN, 200, 20);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2