summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-02-03 15:44:41 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-02-03 15:44:41 +0000
commitbd28c414db0faf86ae13081c0d0c75aa9dc8a606 (patch)
tree740ee0dd0301f5de5cd258ee3be7ec5dd4f13f49 /src
parent944f9eaff82e2f56d5f9e43b766aa09eb4ed4630 (diff)
downloadmpfr-bd28c414db0faf86ae13081c0d0c75aa9dc8a606.tar.gz
[src/log2p1.c] added note about underflow
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14351 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src')
-rw-r--r--src/log2p1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/log2p1.c b/src/log2p1.c
index 835f77298..197e2876b 100644
--- a/src/log2p1.c
+++ b/src/log2p1.c
@@ -126,7 +126,10 @@ mpfr_log2p1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
mpfr_const_log2 (lg2, MPFR_RNDN);
mpfr_div (t, t, lg2, MPFR_RNDN);
/* t = log2(1+x) * (1 + theta)^3 where |theta| < 2^-prec,
- for prec >= 2 we have |(1 + theta)^3 - 1| < 4*theta. */
+ for prec >= 2 we have |(1 + theta)^3 - 1| < 4*theta.
+ Note: contrary to log10p1, no underflow is possible in extended
+ exponent range, since for tiny x, |log2(1+x)| ~ |x|/log(2) >= |x|,
+ and x is representable, thus x/log(2) too. */
if (MPFR_LIKELY (MPFR_CAN_ROUND (t, prec - 2, Ny, rnd_mode)))
break;