summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-06-16 08:21:53 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2000-06-16 08:21:53 +0000
commit0e7a6fc95fca512270355f2950b6bc5e28366c7e (patch)
tree5adf1138891964eaa679515490607145df8002fb /log.c
parent41d28f8350073f96d1092f33586b4b33caecdaa9 (diff)
downloadmpfr-0e7a6fc95fca512270355f2950b6bc5e28366c7e.tar.gz
improved choice of initial precision
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@621 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'log.c')
-rw-r--r--log.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/log.c b/log.c
index 3405e267f..5cda5403d 100644
--- a/log.c
+++ b/log.c
@@ -78,7 +78,9 @@ mpfr_log()
if (ref<0)
ref=-ref;
- p=q+4;
+ /* use initial precision about q+lg(q)+5 */
+ p=q+5; m=q; while (m) { p++; m >>= 1; }
+
/* adjust to entire limb */
if (p%BITS_PER_MP_LIMB) p += BITS_PER_MP_LIMB - (p%BITS_PER_MP_LIMB);