diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-05-13 10:58:38 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2005-05-13 10:58:38 +0000 |
commit | f621c4664ae6c2fd29da01cd6b39ee6d1efc3f56 (patch) | |
tree | 803c6e3eb0dba7f7da4637e8f3935abc49312ae7 | |
parent | c6886d89cffaf84ae342b9875dcdcec8f2992821 (diff) | |
download | mpfr-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) { |