From f5d04977771893e941fab27b88c6aff7686df945 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 6 Apr 2017 16:05:16 +0200 Subject: Revert "atan: Drop assertion." This reverts commit 5d995df9dbe0e0dbd268f5b4a821b63a3f9a90f5. --- src/atan.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.1