summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-02-15 14:09:32 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-02-15 14:09:32 +0000
commitb0bbbc1a662fed3e657cc7639cc929a8616c00b7 (patch)
tree27789d2c3792e3fc76a8330afc1912fe431ce44f /tests
parent5024980fea4e2cc196cc02a6e3b88e9c3d313fa6 (diff)
downloadmpfr-b0bbbc1a662fed3e657cc7639cc929a8616c00b7.tar.gz
[src/digamma.c] fixed a bug in mpfr_digamma_reflection when the approximations
of Digamma(1-x) and Pi*cot(Pi*x) cancel exactly [tests/tdigamma.c] added corresponding non-regression test git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14430 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/tdigamma.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/tdigamma.c b/tests/tdigamma.c
index 612e5e098..c24537ee4 100644
--- a/tests/tdigamma.c
+++ b/tests/tdigamma.c
@@ -110,6 +110,26 @@ bug20210208 (void)
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_ui (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 @@ main (int argc, char *argv[])
special ();
bug20210206 ();
bug20210208 ();
+ bug20210215 ();
test_generic (MPFR_PREC_MIN, 200, 20);