Compare commits
No commits in common. "c9s" and "c8s" have entirely different histories.
@ -1 +0,0 @@
|
|||||||
1
|
|
||||||
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,2 +1,7 @@
|
|||||||
/mpfr-*.zip
|
/mpfr-3.1.1.tar.xz
|
||||||
/mpfr-*.tar.xz
|
/mpfr-3.1.2.zip
|
||||||
|
/mpfr-3.1.2.tar.xz
|
||||||
|
/mpfr-3.1.3.tar.xz
|
||||||
|
/mpfr-3.1.4.tar.xz
|
||||||
|
/mpfr-3.1.5.tar.xz
|
||||||
|
/mpfr-3.1.6.tar.xz
|
||||||
|
|||||||
1832
allpatches
1832
allpatches
File diff suppressed because it is too large
Load Diff
2
ci.fmf
2
ci.fmf
@ -1,2 +0,0 @@
|
|||||||
# Docs: https://docs.fedoraproject.org/en-US/ci/tmt/#_multiple_plans
|
|
||||||
resultsdb-testcase: separate
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
--- !Policy
|
|
||||||
product_versions:
|
|
||||||
- rhel-*
|
|
||||||
decision_context: osci_compose_gate
|
|
||||||
rules:
|
|
||||||
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/all-internal.functional}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
From 96295d88fc03795ce6ae03ee2daabf9639fd96cc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Paul Zimmermann <Paul.Zimmermann@inria.fr>
|
|
||||||
Date: Wed, 30 Apr 2025 17:09:57 +0200
|
|
||||||
Subject: [PATCH] [sin_cos] fixed uninitialized value and added comments
|
|
||||||
|
|
||||||
(issue reported by Jerry James,
|
|
||||||
see https://sympa.inria.fr/sympa/arc/mpfr/2025-04/msg00039.html)
|
|
||||||
---
|
|
||||||
src/sin_cos.c | 6 +++++-
|
|
||||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/sin_cos.c b/src/sin_cos.c
|
|
||||||
index af0d87094..5279a4c29 100644
|
|
||||||
--- a/src/sin_cos.c
|
|
||||||
+++ b/src/sin_cos.c
|
|
||||||
@@ -331,6 +331,9 @@ sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r,
|
|
||||||
mult[0] = r - pp_s + r0 - p_s;
|
|
||||||
/* we have x^3 < 1/2^mult[0] */
|
|
||||||
|
|
||||||
+ /* accu[k] is some bound for the k-th term, more precisely the k-th term
|
|
||||||
+ is bounded by 1/2^accu[k] */
|
|
||||||
+ accu[0] = 0;
|
|
||||||
for (i = 2, k = 0, prec_i_have = mult[0]; prec_i_have < prec; i += 2)
|
|
||||||
{
|
|
||||||
/* i is even here */
|
|
||||||
@@ -366,7 +369,8 @@ sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r,
|
|
||||||
MPFR_MPZ_SIZEINBASE2(mult[k], Q[k]);
|
|
||||||
mult[k] += 2 * r - size_ptoj[1] - 1;
|
|
||||||
/* the absolute contribution of the next term is 1/2^accu[k] */
|
|
||||||
- accu[k] = (k == 0) ? mult[k] : mult[k] + accu[k-1];
|
|
||||||
+ MPFR_ASSERTD(k > 0);
|
|
||||||
+ accu[k] = mult[k] + accu[k-1];
|
|
||||||
prec_i_have = accu[k]; /* the current term is < 1/2^accu[k] */
|
|
||||||
j = (i + 2) / 2;
|
|
||||||
l = 1;
|
|
||||||
--
|
|
||||||
GitLab
|
|
||||||
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON
|
|
||||||
# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors
|
|
||||||
|
|
||||||
# Documentation is in the -doc subpackage
|
|
||||||
addFilter(r'^mpfr.?-devel\.[^:]+: W: no-documentation')
|
|
||||||
196
mpfr.spec
196
mpfr.spec
@ -1,187 +1,93 @@
|
|||||||
Summary: C library for multiple-precision floating-point computations
|
Summary: A C library for multiple-precision floating-point computations
|
||||||
Name: mpfr
|
Name: mpfr
|
||||||
Version: 4.1.0
|
Version: 3.1.6
|
||||||
Release: 10%{?dist}
|
Release: 1%{?dist}
|
||||||
URL: https://www.mpfr.org/
|
URL: http://www.mpfr.org/
|
||||||
|
# GFDL (mpfr.texi, mpfr.info and fdl.texi)
|
||||||
|
License: LGPLv3+ and GPLv3+ and GFDL
|
||||||
|
BuildRequires: autoconf libtool gmp-devel gcc
|
||||||
|
Requires(post): /sbin/ldconfig
|
||||||
|
Requires(postun): /sbin/ldconfig
|
||||||
|
Requires: gmp >= 4.2.3
|
||||||
|
|
||||||
License: LGPLv3+
|
Source0: http://www.mpfr.org/%{name}-%{version}/%{name}-%{version}.tar.xz
|
||||||
BuildRequires: gmp-devel gcc make
|
|
||||||
|
|
||||||
Source0: https://www.mpfr.org/%{name}-%{version}/%{name}-%{version}.tar.xz
|
# https://gforge.inria.fr/scm/viewvc.php/mpfr?revision=11783&view=revision
|
||||||
|
# http://www.mpfr.org/mpfr-3.1.6/patch01
|
||||||
|
Patch0: rev11783.patch
|
||||||
|
|
||||||
# Upstream post-release patches. This currently contains:
|
# https://gforge.inria.fr/scm/viewvc.php/mpfr?revision=11982&view=revision
|
||||||
# - decimal128-conv.patch
|
# http://www.mpfr.org/mpfr-3.1.6/patch02
|
||||||
# - random_deviate.patch
|
Patch1: rev11982.patch
|
||||||
# - set_z_2exp-overflow.patch
|
|
||||||
# - prototypes.patch
|
|
||||||
# - 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
|
|
||||||
|
|
||||||
# fix use of uninitialized value in sin_cos (RHEL-35392)
|
|
||||||
# https://gitlab.inria.fr/mpfr/mpfr/-/commit/96295d88fc03795ce6ae03ee2daabf9639fd96cc
|
|
||||||
Patch: mpfr-sin_cos-uninit-var.patch
|
|
||||||
|
|
||||||
# This can be removed when F32 reaches EOL
|
|
||||||
Obsoletes: mpfr3 < 4.0.0
|
|
||||||
Provides: mpfr3 = %{version}-%{release}
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The MPFR library is a C library for multiple-precision floating-point
|
The MPFR library is a C library for multiple-precision floating-point
|
||||||
computations with "correct rounding". The MPFR is efficient and
|
computations with "correct rounding". The MPFR is efficient and
|
||||||
also has a well-defined semantics. It copies the good ideas from the
|
also has a well-defined semantics. It copies the good ideas from the
|
||||||
ANSI/IEEE-754 standard for double-precision floating-point arithmetic
|
ANSI/IEEE-754 standard for double-precision floating-point arithmetic
|
||||||
(53-bit mantissa). MPFR is based on the GMP multiple-precision library.
|
(53-bit mantissa). MPFR is based on the GMP multiple-precision library.
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for the MPFR library
|
Summary: Development files for the MPFR library
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Requires: gmp-devel%{?_isa}
|
Requires(post): /sbin/install-info
|
||||||
|
Requires(preun): /sbin/install-info
|
||||||
# This can be removed when F32 reaches EOL
|
Requires: gmp-devel
|
||||||
Obsoletes: mpfr3-devel < 4.0.0
|
|
||||||
Provides: mpfr3-devel = %{version}-%{release}
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
Header files and documentation for using the MPFR
|
Header files and documentation for using the MPFR
|
||||||
multiple-precision floating-point library in applications.
|
multiple-precision floating-point library in applications.
|
||||||
|
|
||||||
If you want to develop applications which will use the MPFR library,
|
If you want to develop applications which will use the MPFR library,
|
||||||
you'll need to install the mpfr-devel package. You'll also need to
|
you'll need to install the mpfr-devel package. You'll also need to
|
||||||
install the mpfr package.
|
install the mpfr package.
|
||||||
|
|
||||||
%package doc
|
|
||||||
Summary: Documentation for the MPFR library
|
|
||||||
License: GFDL
|
|
||||||
BuildArch: noarch
|
|
||||||
|
|
||||||
%description doc
|
|
||||||
Documentation for the MPFR library.
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --disable-assert --disable-static
|
%configure --disable-assert --disable-static
|
||||||
|
make %{?_smp_mflags}
|
||||||
# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
|
|
||||||
# -Wl,--as-needed after all the libraries.
|
|
||||||
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
|
|
||||||
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
|
|
||||||
-e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \
|
|
||||||
-i libtool
|
|
||||||
|
|
||||||
%make_build
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
cp -p PATCHES README %{buildroot}%{_pkgdocdir}
|
rm -f $RPM_BUILD_ROOT%{_libdir}/libmpfr.la
|
||||||
rm -f %{buildroot}%{_libdir}/*.la
|
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
|
||||||
rm -f %{buildroot}%{_infodir}/dir
|
|
||||||
|
|
||||||
#these go into licenses, not doc
|
#these go into licenses, not doc
|
||||||
rm -f %{buildroot}%{_pkgdocdir}/COPYING{,.LESSER}
|
rm -f $RPM_BUILD_ROOT%{_pkgdocdir}/COPYING $RPM_BUILD_ROOT%{_pkgdocdir}/COPYING.LESSER
|
||||||
|
|
||||||
%check
|
%check
|
||||||
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
|
make %{?_smp_mflags} check
|
||||||
%make_build check
|
|
||||||
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%post devel
|
||||||
|
if [ -f %{_infodir}/mpfr.info.gz ]; then
|
||||||
|
/sbin/install-info %{_infodir}/mpfr.info.gz %{_infodir}/dir || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
%preun devel
|
||||||
|
if [ "$1" = 0 ]; then
|
||||||
|
if [ -f %{_infodir}/mpfr.info.gz ]; then
|
||||||
|
/sbin/install-info --delete %{_infodir}/mpfr.info.gz %{_infodir}/dir || :
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license COPYING COPYING.LESSER
|
%license COPYING COPYING.LESSER
|
||||||
%dir %{_pkgdocdir}
|
%doc NEWS README AUTHORS BUGS TODO doc/FAQ.html
|
||||||
%{_pkgdocdir}/BUGS
|
%{_libdir}/libmpfr.so.*
|
||||||
%{_pkgdocdir}/NEWS
|
|
||||||
%{_pkgdocdir}/PATCHES
|
|
||||||
%{_pkgdocdir}/README
|
|
||||||
%{_libdir}/libmpfr.so.6*
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/libmpfr.so
|
|
||||||
%{_includedir}/mpfr.h
|
|
||||||
%{_includedir}/mpf2mpfr.h
|
|
||||||
%{_libdir}/pkgconfig/mpfr.pc
|
|
||||||
|
|
||||||
%files doc
|
|
||||||
%dir %{_pkgdocdir}
|
|
||||||
%{_pkgdocdir}/AUTHORS
|
|
||||||
%{_pkgdocdir}/examples
|
%{_pkgdocdir}/examples
|
||||||
%{_pkgdocdir}/FAQ.html
|
%{_libdir}/libmpfr.so
|
||||||
%{_pkgdocdir}/TODO
|
%{_includedir}/*.h
|
||||||
%{_infodir}/mpfr.info*
|
%{_infodir}/mpfr.info*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Feb 09 2026 Lukáš Zaoral <lzaoral@redhat.com> - 4.1.0-10
|
|
||||||
- add /usr/share/doc/mpfr ownership to the doc subpackage as well (RHEL-36690)
|
|
||||||
|
|
||||||
* Tue Jan 27 2026 Lukáš Zaoral <lzaoral@redhat.com> - 4.1.0-9
|
|
||||||
- add /usr/share/doc/mpfr ownership (RHEL-36690)
|
|
||||||
|
|
||||||
* Wed Dec 10 2025 Lukáš Zaoral <lzaoral@redhat.com> - 4.1.0-8
|
|
||||||
- fix use of uninitialized value in sin_cos (RHEL-35392)
|
|
||||||
|
|
||||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 4.1.0-7
|
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
|
||||||
Related: rhbz#1991688
|
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 4.1.0-6
|
|
||||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
|
||||||
|
|
||||||
* Tue Mar 9 2021 Jerry James <loganjerry@gmail.com> - 4.1.0-5
|
|
||||||
- Add upstream patches 8-9
|
|
||||||
|
|
||||||
* Wed Feb 17 2021 Jerry James <loganjerry@gmail.com> - 4.1.0-4
|
|
||||||
- Add upstream patches 1-7
|
|
||||||
|
|
||||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-3
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-2
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sat Jul 11 2020 Jerry James <loganjerry@gmail.com> - 4.1.0-1
|
|
||||||
- Update to MPFR version 4.1.0
|
|
||||||
- Drop all patches
|
|
||||||
|
|
||||||
* Mon Jun 29 2020 Jerry James <loganjerry@gmail.com> - 4.0.2-5
|
|
||||||
- Add upstream patches 8 and 9
|
|
||||||
|
|
||||||
* Thu Apr 16 2020 Jerry James <loganjerry@gmail.com> - 4.0.2-4
|
|
||||||
- Add upstream patches 2 through 7
|
|
||||||
|
|
||||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-3
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Oct 11 2019 Jerry James <loganjerry@gmail.com> - 4.0.2-2
|
|
||||||
- Drop the mpfr3 and mpfr3-devel subpackages
|
|
||||||
|
|
||||||
* Tue Oct 8 2019 Jerry James <loganjerry@gmail.com> - 4.0.2-1
|
|
||||||
- Update to MPFR version 4.0.2 plus patch01
|
|
||||||
- Make mpfr3 and mpfr3-devel subpackages for version 3.1.6
|
|
||||||
- Add a -doc subpackage to hold the GFDL-licensed content
|
|
||||||
- The main package license is LGPLv3+; the GPLv3+ content is not packaged
|
|
||||||
- Drop unnecessary autoconf and libtool BRs
|
|
||||||
- Drop explicit R on gmp; it is autogenerated
|
|
||||||
- Drop info scriptlets; this version can never appear in Fedora < 32 or RHEL < 9
|
|
||||||
- Drop ldconfig_scriptlets for the same reason
|
|
||||||
- Make sure there are no rpaths and that -Wl,--as-needed takes effect
|
|
||||||
- Do not use the %%doc macro; the files have already been copied
|
|
||||||
|
|
||||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-5
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
||||||
|
|
||||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-4
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Oct 30 2018 Rex Dieter <rdieter@fedoraproject.org> - 3.1.6-3
|
|
||||||
- update scriptlets (#1644106)
|
|
||||||
- use %%make_build %%make_install
|
|
||||||
|
|
||||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.6-2
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
||||||
|
|
||||||
* Sun Feb 25 2018 James Paul Turner <jamesturner246@fedoraproject.org> - 3.1.6-1
|
* Sun Feb 25 2018 James Paul Turner <jamesturner246@fedoraproject.org> - 3.1.6-1
|
||||||
- Update to MPFR version 3.1.6
|
- Update to MPFR version 3.1.6
|
||||||
- Use autosetup specfile macro for applying patches (patches 1 and 2 applied)
|
- Use autosetup specfile macro for applying patches (patches 1 and 2 applied)
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
/all-internal:
|
|
||||||
discover:
|
|
||||||
how: fmf
|
|
||||||
url: https://pkgs.devel.redhat.com/git/tests/mpfr
|
|
||||||
execute:
|
|
||||||
how: tmt
|
|
||||||
adjust:
|
|
||||||
enabled: false
|
|
||||||
when: distro == centos-stream or distro == fedora
|
|
||||||
285
rev11783.patch
Normal file
285
rev11783.patch
Normal file
@ -0,0 +1,285 @@
|
|||||||
|
diff -Naurd mpfr-3.1.6-a/PATCHES mpfr-3.1.6-b/PATCHES
|
||||||
|
--- mpfr-3.1.6-a/PATCHES 2017-10-26 13:55:51.168013439 +0000
|
||||||
|
+++ mpfr-3.1.6-b/PATCHES 2017-10-26 13:55:51.236013121 +0000
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+mpfr_get
|
||||||
|
diff -Naurd mpfr-3.1.6-a/VERSION mpfr-3.1.6-b/VERSION
|
||||||
|
--- mpfr-3.1.6-a/VERSION 2017-09-07 11:36:44.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/VERSION 2017-10-26 13:55:51.236013121 +0000
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-3.1.6
|
||||||
|
+3.1.6-p1
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/get_ld.c mpfr-3.1.6-b/src/get_ld.c
|
||||||
|
--- mpfr-3.1.6-a/src/get_ld.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/get_ld.c 2017-10-26 13:55:51.208013252 +0000
|
||||||
|
@@ -41,6 +41,9 @@
|
||||||
|
mpfr_exp_t sh; /* exponent shift, so that x/2^sh is in the double range */
|
||||||
|
mpfr_t y, z;
|
||||||
|
int sign;
|
||||||
|
+ MPFR_SAVE_EXPO_DECL (expo);
|
||||||
|
+
|
||||||
|
+ MPFR_SAVE_EXPO_MARK (expo);
|
||||||
|
|
||||||
|
/* first round x to the target long double precision, so that
|
||||||
|
all subsequent operations are exact (this avoids double rounding
|
||||||
|
@@ -103,6 +106,7 @@
|
||||||
|
}
|
||||||
|
if (sign < 0)
|
||||||
|
r = -r;
|
||||||
|
+ MPFR_SAVE_EXPO_FREE (expo);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/get_si.c mpfr-3.1.6-b/src/get_si.c
|
||||||
|
--- mpfr-3.1.6-a/src/get_si.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/get_si.c 2017-10-26 13:55:51.208013252 +0000
|
||||||
|
@@ -28,6 +28,7 @@
|
||||||
|
mpfr_prec_t prec;
|
||||||
|
long s;
|
||||||
|
mpfr_t x;
|
||||||
|
+ MPFR_SAVE_EXPO_DECL (expo);
|
||||||
|
|
||||||
|
if (MPFR_UNLIKELY (!mpfr_fits_slong_p (f, rnd)))
|
||||||
|
{
|
||||||
|
@@ -39,14 +40,22 @@
|
||||||
|
if (MPFR_IS_ZERO (f))
|
||||||
|
return (long) 0;
|
||||||
|
|
||||||
|
- /* determine prec of long */
|
||||||
|
- for (s = LONG_MIN, prec = 0; s != 0; s /= 2, prec++)
|
||||||
|
+ /* Determine the precision of long. |LONG_MIN| may have one more bit
|
||||||
|
+ as an integer, but in this case, this is a power of 2, thus fits
|
||||||
|
+ in a precision-prec floating-point number. */
|
||||||
|
+ for (s = LONG_MAX, prec = 0; s != 0; s /= 2, prec++)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_MARK (expo);
|
||||||
|
+
|
||||||
|
/* first round to prec bits */
|
||||||
|
mpfr_init2 (x, prec);
|
||||||
|
mpfr_rint (x, f, rnd);
|
||||||
|
|
||||||
|
+ /* The flags from mpfr_rint are the wanted ones. In particular,
|
||||||
|
+ it sets the inexact flag when necessary. */
|
||||||
|
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
|
||||||
|
+
|
||||||
|
/* warning: if x=0, taking its exponent is illegal */
|
||||||
|
if (MPFR_UNLIKELY (MPFR_IS_ZERO(x)))
|
||||||
|
s = 0;
|
||||||
|
@@ -65,5 +74,7 @@
|
||||||
|
|
||||||
|
mpfr_clear (x);
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_FREE (expo);
|
||||||
|
+
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/get_sj.c mpfr-3.1.6-b/src/get_sj.c
|
||||||
|
--- mpfr-3.1.6-a/src/get_sj.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/get_sj.c 2017-10-26 13:55:51.208013252 +0000
|
||||||
|
@@ -35,6 +35,7 @@
|
||||||
|
intmax_t r;
|
||||||
|
mpfr_prec_t prec;
|
||||||
|
mpfr_t x;
|
||||||
|
+ MPFR_SAVE_EXPO_DECL (expo);
|
||||||
|
|
||||||
|
if (MPFR_UNLIKELY (!mpfr_fits_intmax_p (f, rnd)))
|
||||||
|
{
|
||||||
|
@@ -46,20 +47,24 @@
|
||||||
|
if (MPFR_IS_ZERO (f))
|
||||||
|
return (intmax_t) 0;
|
||||||
|
|
||||||
|
- /* determine the precision of intmax_t */
|
||||||
|
- for (r = MPFR_INTMAX_MIN, prec = 0; r != 0; r /= 2, prec++)
|
||||||
|
+ /* Determine the precision of intmax_t. |INTMAX_MIN| may have one
|
||||||
|
+ more bit as an integer, but in this case, this is a power of 2,
|
||||||
|
+ thus fits in a precision-prec floating-point number. */
|
||||||
|
+ for (r = MPFR_INTMAX_MAX, prec = 0; r != 0; r /= 2, prec++)
|
||||||
|
{ }
|
||||||
|
- /* Note: though INTMAX_MAX would have been sufficient for the conversion,
|
||||||
|
- we chose INTMAX_MIN so that INTMAX_MIN - 1 is always representable in
|
||||||
|
- precision prec; this is useful to detect overflows in MPFR_RNDZ (will
|
||||||
|
- be needed later). */
|
||||||
|
|
||||||
|
- /* Now, r = 0. */
|
||||||
|
+ MPFR_ASSERTD (r == 0);
|
||||||
|
+
|
||||||
|
+ MPFR_SAVE_EXPO_MARK (expo);
|
||||||
|
|
||||||
|
mpfr_init2 (x, prec);
|
||||||
|
mpfr_rint (x, f, rnd);
|
||||||
|
MPFR_ASSERTN (MPFR_IS_FP (x));
|
||||||
|
|
||||||
|
+ /* The flags from mpfr_rint are the wanted ones. In particular,
|
||||||
|
+ it sets the inexact flag when necessary. */
|
||||||
|
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
|
||||||
|
+
|
||||||
|
if (MPFR_NOTZERO (x))
|
||||||
|
{
|
||||||
|
mp_limb_t *xp;
|
||||||
|
@@ -67,15 +72,15 @@
|
||||||
|
|
||||||
|
xp = MPFR_MANT (x);
|
||||||
|
sh = MPFR_GET_EXP (x);
|
||||||
|
- MPFR_ASSERTN ((mpfr_prec_t) sh <= prec);
|
||||||
|
+ MPFR_ASSERTN ((mpfr_prec_t) sh <= prec + 1);
|
||||||
|
if (MPFR_INTMAX_MIN + MPFR_INTMAX_MAX != 0
|
||||||
|
- && MPFR_UNLIKELY ((mpfr_prec_t) sh == prec))
|
||||||
|
+ && MPFR_UNLIKELY ((mpfr_prec_t) sh > prec))
|
||||||
|
{
|
||||||
|
/* 2's complement and x <= INTMAX_MIN: in the case mp_limb_t
|
||||||
|
has the same size as intmax_t, we cannot use the code in
|
||||||
|
the for loop since the operations would be performed in
|
||||||
|
unsigned arithmetic. */
|
||||||
|
- MPFR_ASSERTN (MPFR_IS_NEG (x) && (mpfr_powerof2_raw (x)));
|
||||||
|
+ MPFR_ASSERTN (MPFR_IS_NEG (x) && mpfr_powerof2_raw (x));
|
||||||
|
r = MPFR_INTMAX_MIN;
|
||||||
|
}
|
||||||
|
else if (MPFR_IS_POS (x))
|
||||||
|
@@ -117,6 +122,8 @@
|
||||||
|
|
||||||
|
mpfr_clear (x);
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_FREE (expo);
|
||||||
|
+
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/get_ui.c mpfr-3.1.6-b/src/get_ui.c
|
||||||
|
--- mpfr-3.1.6-a/src/get_ui.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/get_ui.c 2017-10-26 13:55:51.208013252 +0000
|
||||||
|
@@ -30,6 +30,7 @@
|
||||||
|
mpfr_t x;
|
||||||
|
mp_size_t n;
|
||||||
|
mpfr_exp_t exp;
|
||||||
|
+ MPFR_SAVE_EXPO_DECL (expo);
|
||||||
|
|
||||||
|
if (MPFR_UNLIKELY (!mpfr_fits_ulong_p (f, rnd)))
|
||||||
|
{
|
||||||
|
@@ -44,10 +45,16 @@
|
||||||
|
for (s = ULONG_MAX, prec = 0; s != 0; s /= 2, prec ++)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_MARK (expo);
|
||||||
|
+
|
||||||
|
/* first round to prec bits */
|
||||||
|
mpfr_init2 (x, prec);
|
||||||
|
mpfr_rint (x, f, rnd);
|
||||||
|
|
||||||
|
+ /* The flags from mpfr_rint are the wanted ones. In particular,
|
||||||
|
+ it sets the inexact flag when necessary. */
|
||||||
|
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
|
||||||
|
+
|
||||||
|
/* warning: if x=0, taking its exponent is illegal */
|
||||||
|
if (MPFR_IS_ZERO(x))
|
||||||
|
s = 0;
|
||||||
|
@@ -61,5 +68,7 @@
|
||||||
|
|
||||||
|
mpfr_clear (x);
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_FREE (expo);
|
||||||
|
+
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/get_uj.c mpfr-3.1.6-b/src/get_uj.c
|
||||||
|
--- mpfr-3.1.6-a/src/get_uj.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/get_uj.c 2017-10-26 13:55:51.208013252 +0000
|
||||||
|
@@ -35,6 +35,7 @@
|
||||||
|
uintmax_t r;
|
||||||
|
mpfr_prec_t prec;
|
||||||
|
mpfr_t x;
|
||||||
|
+ MPFR_SAVE_EXPO_DECL (expo);
|
||||||
|
|
||||||
|
if (MPFR_UNLIKELY (!mpfr_fits_uintmax_p (f, rnd)))
|
||||||
|
{
|
||||||
|
@@ -50,12 +51,18 @@
|
||||||
|
for (r = MPFR_UINTMAX_MAX, prec = 0; r != 0; r /= 2, prec++)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
- /* Now, r = 0. */
|
||||||
|
+ MPFR_ASSERTD (r == 0);
|
||||||
|
+
|
||||||
|
+ MPFR_SAVE_EXPO_MARK (expo);
|
||||||
|
|
||||||
|
mpfr_init2 (x, prec);
|
||||||
|
mpfr_rint (x, f, rnd);
|
||||||
|
MPFR_ASSERTN (MPFR_IS_FP (x));
|
||||||
|
|
||||||
|
+ /* The flags from mpfr_rint are the wanted ones. In particular,
|
||||||
|
+ it sets the inexact flag when necessary. */
|
||||||
|
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
|
||||||
|
+
|
||||||
|
if (MPFR_NOTZERO (x))
|
||||||
|
{
|
||||||
|
mp_limb_t *xp;
|
||||||
|
@@ -76,6 +83,8 @@
|
||||||
|
|
||||||
|
mpfr_clear (x);
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_FREE (expo);
|
||||||
|
+
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/get_z.c mpfr-3.1.6-b/src/get_z.c
|
||||||
|
--- mpfr-3.1.6-a/src/get_z.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/get_z.c 2017-10-26 13:55:51.208013252 +0000
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
int inex;
|
||||||
|
mpfr_t r;
|
||||||
|
mpfr_exp_t exp;
|
||||||
|
+ MPFR_SAVE_EXPO_DECL (expo);
|
||||||
|
|
||||||
|
if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f)))
|
||||||
|
{
|
||||||
|
@@ -41,6 +42,8 @@
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_MARK (expo);
|
||||||
|
+
|
||||||
|
exp = MPFR_GET_EXP (f);
|
||||||
|
/* if exp <= 0, then |f|<1, thus |o(f)|<=1 */
|
||||||
|
MPFR_ASSERTN (exp < 0 || exp <= MPFR_PREC_MAX);
|
||||||
|
@@ -50,6 +53,11 @@
|
||||||
|
MPFR_ASSERTN (inex != 1 && inex != -1); /* integral part of f is
|
||||||
|
representable in r */
|
||||||
|
MPFR_ASSERTN (MPFR_IS_FP (r));
|
||||||
|
+
|
||||||
|
+ /* The flags from mpfr_rint are the wanted ones. In particular,
|
||||||
|
+ it sets the inexact flag when necessary. */
|
||||||
|
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
|
||||||
|
+
|
||||||
|
exp = mpfr_get_z_2exp (z, r);
|
||||||
|
if (exp >= 0)
|
||||||
|
mpz_mul_2exp (z, z, exp);
|
||||||
|
@@ -57,5 +65,7 @@
|
||||||
|
mpz_fdiv_q_2exp (z, z, -exp);
|
||||||
|
mpfr_clear (r);
|
||||||
|
|
||||||
|
+ MPFR_SAVE_EXPO_FREE (expo);
|
||||||
|
+
|
||||||
|
return inex;
|
||||||
|
}
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/mpfr.h mpfr-3.1.6-b/src/mpfr.h
|
||||||
|
--- mpfr-3.1.6-a/src/mpfr.h 2017-09-07 11:36:44.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/mpfr.h 2017-10-26 13:55:51.232013138 +0000
|
||||||
|
@@ -27,7 +27,7 @@
|
||||||
|
#define MPFR_VERSION_MAJOR 3
|
||||||
|
#define MPFR_VERSION_MINOR 1
|
||||||
|
#define MPFR_VERSION_PATCHLEVEL 6
|
||||||
|
-#define MPFR_VERSION_STRING "3.1.6"
|
||||||
|
+#define MPFR_VERSION_STRING "3.1.6-p1"
|
||||||
|
|
||||||
|
/* Macros dealing with MPFR VERSION */
|
||||||
|
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/version.c mpfr-3.1.6-b/src/version.c
|
||||||
|
--- mpfr-3.1.6-a/src/version.c 2017-09-07 11:36:44.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/version.c 2017-10-26 13:55:51.232013138 +0000
|
||||||
|
@@ -25,5 +25,5 @@
|
||||||
|
const char *
|
||||||
|
mpfr_get_version (void)
|
||||||
|
{
|
||||||
|
- return "3.1.6";
|
||||||
|
+ return "3.1.6-p1";
|
||||||
|
}
|
||||||
111
rev11982.patch
Normal file
111
rev11982.patch
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
diff -Naurd mpfr-3.1.6-a/PATCHES mpfr-3.1.6-b/PATCHES
|
||||||
|
--- mpfr-3.1.6-a/PATCHES 2017-12-15 12:37:44.074256548 +0000
|
||||||
|
+++ mpfr-3.1.6-b/PATCHES 2017-12-15 12:37:44.146256304 +0000
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+root
|
||||||
|
diff -Naurd mpfr-3.1.6-a/VERSION mpfr-3.1.6-b/VERSION
|
||||||
|
--- mpfr-3.1.6-a/VERSION 2017-10-26 13:55:51.236013121 +0000
|
||||||
|
+++ mpfr-3.1.6-b/VERSION 2017-12-15 12:37:44.142256319 +0000
|
||||||
|
@@ -1 +1 @@
|
||||||
|
-3.1.6-p1
|
||||||
|
+3.1.6-p2
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/mpfr.h mpfr-3.1.6-b/src/mpfr.h
|
||||||
|
--- mpfr-3.1.6-a/src/mpfr.h 2017-10-26 13:55:51.232013138 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/mpfr.h 2017-12-15 12:37:44.142256319 +0000
|
||||||
|
@@ -27,7 +27,7 @@
|
||||||
|
#define MPFR_VERSION_MAJOR 3
|
||||||
|
#define MPFR_VERSION_MINOR 1
|
||||||
|
#define MPFR_VERSION_PATCHLEVEL 6
|
||||||
|
-#define MPFR_VERSION_STRING "3.1.6-p1"
|
||||||
|
+#define MPFR_VERSION_STRING "3.1.6-p2"
|
||||||
|
|
||||||
|
/* Macros dealing with MPFR VERSION */
|
||||||
|
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/root.c mpfr-3.1.6-b/src/root.c
|
||||||
|
--- mpfr-3.1.6-a/src/root.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/root.c 2017-12-15 12:37:44.118256398 +0000
|
||||||
|
@@ -107,6 +107,11 @@
|
||||||
|
MPFR_RET_NAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ /* Special case |x| = 1. Note that if x = -1, then k is odd
|
||||||
|
+ (NaN results have already been filtered), so that y = -1. */
|
||||||
|
+ if (mpfr_cmpabs (x, __gmpfr_one) == 0)
|
||||||
|
+ return mpfr_set (y, x, rnd_mode);
|
||||||
|
+
|
||||||
|
/* General case */
|
||||||
|
|
||||||
|
/* For large k, use exp(log(x)/k). The threshold of 100 seems to be quite
|
||||||
|
@@ -188,6 +193,14 @@
|
||||||
|
Assume all special cases have been eliminated before.
|
||||||
|
In the extended exponent range, overflows/underflows are not possible.
|
||||||
|
Assume x > 0, or x < 0 and k odd.
|
||||||
|
+ Also assume |x| <> 1 because log(1) = 0, which does not have an exponent
|
||||||
|
+ and would yield a failure in the error bound computation. A priori, this
|
||||||
|
+ constraint is quite artificial because if |x| is close enough to 1, then
|
||||||
|
+ the exponent of log|x| does not need to be used (in the code, err would
|
||||||
|
+ be 1 in such a domain). So this constraint |x| <> 1 could be avoided in
|
||||||
|
+ the code. However, this is an exact case easy to detect, so that such a
|
||||||
|
+ change would be useless. Values very close to 1 are not an issue, since
|
||||||
|
+ an underflow is not possible before the MPFR_GET_EXP.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
mpfr_root_aux (mpfr_ptr y, mpfr_srcptr x, unsigned long k, mpfr_rnd_t rnd_mode)
|
||||||
|
@@ -219,7 +232,8 @@
|
||||||
|
mpfr_log (t, absx, MPFR_RNDN);
|
||||||
|
/* t = log|x| * (1 + theta) with |theta| <= 2^(-w) */
|
||||||
|
mpfr_div_ui (t, t, k, MPFR_RNDN);
|
||||||
|
- expt = MPFR_GET_EXP (t);
|
||||||
|
+ /* No possible underflow in mpfr_log and mpfr_div_ui. */
|
||||||
|
+ expt = MPFR_GET_EXP (t); /* assumes t <> 0 */
|
||||||
|
/* t = log|x|/k * (1 + theta) + eps with |theta| <= 2^(-w)
|
||||||
|
and |eps| <= 1/2 ulp(t), thus the total error is bounded
|
||||||
|
by 1.5 * 2^(expt - w) */
|
||||||
|
diff -Naurd mpfr-3.1.6-a/src/version.c mpfr-3.1.6-b/src/version.c
|
||||||
|
--- mpfr-3.1.6-a/src/version.c 2017-10-26 13:55:51.232013138 +0000
|
||||||
|
+++ mpfr-3.1.6-b/src/version.c 2017-12-15 12:37:44.142256319 +0000
|
||||||
|
@@ -25,5 +25,5 @@
|
||||||
|
const char *
|
||||||
|
mpfr_get_version (void)
|
||||||
|
{
|
||||||
|
- return "3.1.6-p1";
|
||||||
|
+ return "3.1.6-p2";
|
||||||
|
}
|
||||||
|
diff -Naurd mpfr-3.1.6-a/tests/troot.c mpfr-3.1.6-b/tests/troot.c
|
||||||
|
--- mpfr-3.1.6-a/tests/troot.c 2017-01-01 01:39:09.000000000 +0000
|
||||||
|
+++ mpfr-3.1.6-b/tests/troot.c 2017-12-15 12:37:44.118256398 +0000
|
||||||
|
@@ -405,6 +405,26 @@
|
||||||
|
mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static void
|
||||||
|
+bug20171214 (void)
|
||||||
|
+{
|
||||||
|
+ mpfr_t x, y;
|
||||||
|
+ int inex;
|
||||||
|
+
|
||||||
|
+ mpfr_init2 (x, 805);
|
||||||
|
+ mpfr_init2 (y, 837);
|
||||||
|
+ mpfr_set_ui (x, 1, MPFR_RNDN);
|
||||||
|
+ inex = mpfr_root (y, x, 120, MPFR_RNDN);
|
||||||
|
+ MPFR_ASSERTN (inex == 0);
|
||||||
|
+ MPFR_ASSERTN (mpfr_cmp_ui (y, 1) == 0);
|
||||||
|
+ mpfr_set_si (x, -1, MPFR_RNDN);
|
||||||
|
+ inex = mpfr_root (y, x, 121, MPFR_RNDN);
|
||||||
|
+ MPFR_ASSERTN (inex == 0);
|
||||||
|
+ MPFR_ASSERTN (mpfr_cmp_si (y, -1) == 0);
|
||||||
|
+ mpfr_clear (x);
|
||||||
|
+ mpfr_clear (y);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
@@ -415,6 +435,7 @@
|
||||||
|
|
||||||
|
tests_start_mpfr ();
|
||||||
|
|
||||||
|
+ bug20171214 ();
|
||||||
|
exact_powers (3, 1000);
|
||||||
|
special ();
|
||||||
|
bigint ();
|
||||||
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (mpfr-4.1.0.tar.xz) = 1bd1c349741a6529dfa53af4f0da8d49254b164ece8a46928cdb13a99460285622d57fe6f68cef19c6727b3f9daa25ddb3d7d65c201c8f387e421c7f7bee6273
|
SHA512 (mpfr-3.1.6.tar.xz) = 746ee74d5026f267f74ab352d850ed30ff627d530aa840c71b24793e44875f8503946bd7399905dea2b2dd5744326254d7889337fe94cfe58d03c4066e9d8054
|
||||||
|
|||||||
@ -1,46 +0,0 @@
|
|||||||
- hosts: all
|
|
||||||
vars:
|
|
||||||
- ansible_python_interpreter: /usr/bin/python3
|
|
||||||
- artifacts: ./artifacts
|
|
||||||
tags:
|
|
||||||
- classic
|
|
||||||
- container
|
|
||||||
- atomic
|
|
||||||
tasks:
|
|
||||||
- name: create artifacts
|
|
||||||
file:
|
|
||||||
path: "{{ artifacts }}"
|
|
||||||
state: directory
|
|
||||||
delegate_to: localhost
|
|
||||||
|
|
||||||
- name: do it all
|
|
||||||
block:
|
|
||||||
- name: calculate Silvester number
|
|
||||||
command: |
|
|
||||||
gawk -M 'BEGIN {
|
|
||||||
s = 2
|
|
||||||
for (i = 1; i <= 7; i++)
|
|
||||||
s = s * (s - 1) + 1
|
|
||||||
print s
|
|
||||||
}'
|
|
||||||
register: silvester
|
|
||||||
|
|
||||||
- name: verify Silvester number
|
|
||||||
fail:
|
|
||||||
when: silvester.stdout != '113423713055421844361000443'
|
|
||||||
|
|
||||||
always:
|
|
||||||
- name: write log
|
|
||||||
copy:
|
|
||||||
content: |
|
|
||||||
stderr:
|
|
||||||
{{ silvester.stderr }}
|
|
||||||
stdout:
|
|
||||||
{{ silvester.stdout }}
|
|
||||||
dest: "{{ artifacts }}/test.log"
|
|
||||||
delegate_to: localhost
|
|
||||||
|
|
||||||
# fetch:
|
|
||||||
# dest: "{{ artifacts }}/"
|
|
||||||
# src: "/tmp/test.log"
|
|
||||||
# flat: yes
|
|
||||||
Loading…
Reference in New Issue
Block a user