diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-11-22 22:44:40 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2009-11-22 22:44:40 +0000 |
commit | 04ebb48fd311ebf6789564e9919a3e621502e8e3 (patch) | |
tree | fc862e9b0c6f26f2b92ef45fdcf52233c7972f66 /tests/tsin_cos.c | |
parent | 236935780b3ef9f00ad9a40193a632961669ae12 (diff) | |
download | mpfr-04ebb48fd311ebf6789564e9919a3e621502e8e3.tar.gz |
tests/tsin_cos.c: ported bug20091122 from the 2.4 branch to the trunk.
But no failure in the trunk.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6556 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsin_cos.c')
-rw-r--r-- | tests/tsin_cos.c | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c index e4c3bbf7e..12bca40f2 100644 --- a/tests/tsin_cos.c +++ b/tests/tsin_cos.c @@ -512,6 +512,50 @@ bug20091013 (void) mpfr_clear (zref); } +/* Bug reported by Laurent Fousse for the 2.4 branch. + No problem in the trunk. + http://websympa.loria.fr/wwsympa/arc/mpfr/2009-11/msg00044.html */ +static void +bug20091122 (void) +{ + mpfr_t x, y, z, yref, zref; + mp_prec_t p = 3; + mpfr_rnd_t r = MPFR_RNDN; + + mpfr_init2 (x, 5); + mpfr_init2 (y, p); + mpfr_init2 (z, p); + mpfr_init2 (yref, p); + mpfr_init2 (zref, p); + + mpfr_set_str (x, "0.11111E49", 2, MPFR_RNDN); + mpfr_sin_cos (yref, zref, x, r); + + mpfr_sin (y, x, r); + mpfr_cos (z, x, r); + + if (! mpfr_equal_p (y, yref)) + { + printf ("mpfr_sin_cos and mpfr_sin disagree (bug20091122)\n"); + printf ("yref = "); mpfr_dump (yref); + printf ("y = "); mpfr_dump (y); + exit (1); + } + if (! mpfr_equal_p (z, zref)) + { + printf ("mpfr_sin_cos and mpfr_cos disagree (bug20091122)\n"); + printf ("zref = "); mpfr_dump (zref); + printf ("z = "); mpfr_dump (z); + exit (1); + } + + mpfr_clear (x); + mpfr_clear (y); + mpfr_clear (z); + mpfr_clear (yref); + mpfr_clear (zref); +} + static void consistency (void) { @@ -566,11 +610,9 @@ main (int argc, char *argv[]) } bug20091013 (); - bug20091008 (); - bug20091007 (); - + bug20091122 (); consistency (); test_mpfr_sincos_fast (); |