summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Enge <andreas.enge@inria.fr>2017-04-06 16:05:16 +0200
committerAndreas Enge <andreas.enge@inria.fr>2017-04-06 16:05:48 +0200
commitf5d04977771893e941fab27b88c6aff7686df945 (patch)
treec43d93ae5fb7e07ddd45eb3dcca8705009107b32
parente42ff90fa72e881dd5f4ab8902142d42d1bb0069 (diff)
downloadmpc-git-f5d04977771893e941fab27b88c6aff7686df945.tar.gz
Revert "atan: Drop assertion."
This reverts commit 5d995df9dbe0e0dbd268f5b4a821b63a3f9a90f5.
-rw-r--r--src/atan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/atan.c b/src/atan.c
index 345d006..1fa5267 100644
--- a/src/atan.c
+++ b/src/atan.c
@@ -182,6 +182,8 @@ mpc_atan (mpc_ptr rop, mpc_srcptr op, mpc_rnd_t rnd)
so we need to round down |a^2-1|, which means rounding up
a^2 since |a|<1. */
mpfr_sqr (z, y, MPFR_RNDU);
+ /* since |y| > 1, we should have |a| <= 1, thus a^2 <= 1 */
+ MPC_ASSERT(mpfr_cmp_ui (z, 1) <= 0);
/* in case z=1, we should try again with more precision */
if (mpfr_cmp_ui (z, 1) == 0)
continue;