summaryrefslogtreecommitdiff
path: root/tests/tsin_cos.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2007-12-14 09:24:11 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2007-12-14 09:24:11 +0000
commit27e9fe99dcdd54aa906f7db6c2edf1f17b86c8da (patch)
tree17dff98738b367688bc413554d74be89c6c9d257 /tests/tsin_cos.c
parent175719e83fb945722ec9ff2cceab1307d2fcd99a (diff)
downloadmpfr-27e9fe99dcdd54aa906f7db6c2edf1f17b86c8da.tar.gz
sin_cos.c, tsin_cos.c: fixed bug occurring when arguments overlap and
MPFR_FAST_COMPUTE_IF_SMALL_INPUT fails reuse.c: improved output in case of error git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5084 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsin_cos.c')
-rw-r--r--tests/tsin_cos.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c
index d8cc1a7b5..d4877bb69 100644
--- a/tests/tsin_cos.c
+++ b/tests/tsin_cos.c
@@ -273,19 +273,37 @@ tiny (void)
mpfr_clears (x, s, c, (void *) 0);
}
+/* bug found in nightly tests */
+static void
+test20071214 (void)
+{
+ mpfr_t a, b;
+
+ mpfr_init2 (a, 4);
+ mpfr_init2 (b, 4);
+
+ mpfr_set_ui_2exp (a, 3, -4, GMP_RNDN);
+ mpfr_sin_cos (a, b, a, GMP_RNDD);
+ MPFR_ASSERTN(mpfr_cmp_ui_2exp (a, 11, -6) == 0);
+ MPFR_ASSERTN(mpfr_cmp_ui_2exp (b, 15, -4) == 0);
+
+ mpfr_clear (a);
+ mpfr_clear (b);
+}
+
/* tsin_cos prec [N] performs N tests with prec bits */
int
main(int argc, char *argv[])
{
tests_start_mpfr ();
- check_nans ();
-
if (argc > 1)
{
large_test (atoi (argv[1]), (argc > 2) ? atoi (argv[2]) : 1);
}
+ check_nans ();
+
/* worst case from PhD thesis of Vincent Lefe`vre: x=8980155785351021/2^54 */
check53 ("4.984987858808754279e-1", "4.781075595393330379e-1",
"8.783012931285841817e-1", GMP_RNDN);
@@ -310,6 +328,7 @@ main(int argc, char *argv[])
overflowed_sin_cos0 ();
tiny ();
+ test20071214 ();
tests_end_mpfr ();
return 0;