summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-05-13 10:58:38 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2005-05-13 10:58:38 +0000
commitf621c4664ae6c2fd29da01cd6b39ee6d1efc3f56 (patch)
tree803c6e3eb0dba7f7da4637e8f3935abc49312ae7
parentc6886d89cffaf84ae342b9875dcdcec8f2992821 (diff)
downloadmpfr-f621c4664ae6c2fd29da01cd6b39ee6d1efc3f56.tar.gz
Add round_near_x support for small arguments.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3551 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--atan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/atan.c b/atan.c
index c48a25318..8847c6f58 100644
--- a/atan.c
+++ b/atan.c
@@ -223,6 +223,11 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mp_rnd_t rnd_mode)
return inexact;
}
+ /* atan(x) = x - x^3/3 + x^5/5...
+ so the error is < 2^(3*EXP(x)-1)
+ so `EXP(x)-(3*EXP(x)-1)` = -2*EXP(x)+1 */
+ MPFR_FAST_COMPUTE_IF_SMALL_INPUT (atan,x, -2*MPFR_GET_EXP (x)+1,0,rnd_mode,);
+
realprec = MPFR_PREC (atan) + MPFR_INT_CEIL_LOG2 (MPFR_PREC (atan)) + 4;
/* if (MPFR_PREC (atan) + 5 > MPFR_PREC (x) && MPFR_GET_EXP (x) < 0)
{