summaryrefslogtreecommitdiff
path: root/src/sub1sp.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-02-20 13:55:40 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-02-20 13:55:40 +0000
commit2cbcac1131b3ea3971d9fbb638a73f1b47e9eaf1 (patch)
tree61e3cd5ad949c135ac7e0f986f0ed0f59aa44fdc /src/sub1sp.c
parented2dd2c4bf856fd9e2a910bf80a8b15e5c33b9f5 (diff)
downloadmpfr-2cbcac1131b3ea3971d9fbb638a73f1b47e9eaf1.tar.gz
[src/{add,sub}1sp.c] Updated/added comments for MPFR_WANT_ASSERT >= 2.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12339 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/sub1sp.c')
-rw-r--r--src/sub1sp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/sub1sp.c b/src/sub1sp.c
index 0526d2d31..efd4802ac 100644
--- a/src/sub1sp.c
+++ b/src/sub1sp.c
@@ -24,8 +24,21 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-/* Check if we have to check the result of mpfr_sub1sp with mpfr_sub1 */
#if MPFR_WANT_ASSERT >= 2
+/* Check the result of mpfr_sub1sp with mpfr_sub1.
+
+ Note: mpfr_sub1sp itself has two algorithms: one always valid and one
+ faster for small precisions (up to 3 limbs). The latter one is disabled
+ if MPFR_GENERIC_ABI is defined. When MPFR_WANT_ASSERT >= 2, it could be
+ interesting to compare the results of these different algorithms. For
+ the time being, this is currently done by running the same code on the
+ same data with and without MPFR_GENERIC_ABI defined, where we have the
+ following comparisons in small precisions:
+ mpfr_sub1sp slow <-> mpfr_sub1 when MPFR_GENERIC_ABI is defined;
+ mpfr_sub1sp fast <-> mpfr_sub1 when MPFR_GENERIC_ABI is not defined.
+ By transitivity, the absence of failures implies that the 3 results are
+ the same.
+*/
int mpfr_sub1sp_ref (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)