From 35ae1e147a8fe5c9003320f4a76edf8fb4dbf096 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 10 Mar 2012 19:01:00 +0100 Subject: [PATCH] Fix some comments. * lib/expl.c: Fix an ambiguous comment. * lib/expm1.c: Likewise. * lib/expm1l.c: Likewise. * lib/exp2.c: Likewise. * lib/exp2l.c: Likewise. --- ChangeLog | 9 +++++++++ lib/exp2.c | 6 +++--- lib/exp2l.c | 6 +++--- lib/expl.c | 6 +++--- lib/expm1.c | 6 +++--- lib/expm1l.c | 6 +++--- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab2d85c795..039f54b99a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-03-10 Bruno Haible + + Fix some comments. + * lib/expl.c: Fix an ambiguous comment. + * lib/expm1.c: Likewise. + * lib/expm1l.c: Likewise. + * lib/exp2.c: Likewise. + * lib/exp2l.c: Likewise. + 2012-03-10 Paul Eggert regex: allow inclusion of before diff --git a/lib/exp2.c b/lib/exp2.c index 2107493940..9fb8ee1e8f 100644 --- a/lib/exp2.c +++ b/lib/exp2.c @@ -83,9 +83,9 @@ exp2 (double x) + 21844/6081075 * z^13 - 929569/638512875 * z^15 + ... - Since |z| <= log(2)/1024 < 0.0007, the relative error of the z^7 term - is < 0.0007^6 < 2^-60 <= 2^-DBL_MANT_DIG, therefore we can truncate - the series after the z^5 term. */ + Since |z| <= log(2)/1024 < 0.0007, the relative contribution of the + z^7 term is < 0.0007^6 < 2^-60 <= 2^-DBL_MANT_DIG, therefore we can + truncate the series after the z^5 term. */ { double nm = round (x * 256.0); /* = 256 * n + m */ diff --git a/lib/exp2l.c b/lib/exp2l.c index 70f6a69ef6..c6d786ab0d 100644 --- a/lib/exp2l.c +++ b/lib/exp2l.c @@ -96,9 +96,9 @@ exp2l (long double x) + 21844/6081075 * z^13 - 929569/638512875 * z^15 + ... - Since |z| <= log(2)/1024 < 0.0007, the relative error of the z^13 term - is < 0.0007^12 < 2^-120 <= 2^-LDBL_MANT_DIG, therefore we can truncate - the series after the z^11 term. */ + Since |z| <= log(2)/1024 < 0.0007, the relative contribution of the + z^13 term is < 0.0007^12 < 2^-120 <= 2^-LDBL_MANT_DIG, therefore we + can truncate the series after the z^11 term. */ { long double nm = roundl (x * 256.0L); /* = 256 * n + m */ diff --git a/lib/expl.c b/lib/expl.c index a6d8567e9f..992937ab06 100644 --- a/lib/expl.c +++ b/lib/expl.c @@ -99,9 +99,9 @@ expl (long double x) + 21844/6081075 * z^13 - 929569/638512875 * z^15 + ... - Since |z| <= log(2)/1024 < 0.0007, the relative error of the z^13 term - is < 0.0007^12 < 2^-120 <= 2^-LDBL_MANT_DIG, therefore we can truncate - the series after the z^11 term. + Since |z| <= log(2)/1024 < 0.0007, the relative contribution of the + z^13 term is < 0.0007^12 < 2^-120 <= 2^-LDBL_MANT_DIG, therefore we + can truncate the series after the z^11 term. Given the usual bounds LDBL_MAX_EXP <= 16384, LDBL_MIN_EXP >= -16381, LDBL_MANT_DIG <= 120, we can estimate x: -11440 <= x <= 11357. diff --git a/lib/expm1.c b/lib/expm1.c index 3595fa3a52..8bb85130b1 100644 --- a/lib/expm1.c +++ b/lib/expm1.c @@ -99,9 +99,9 @@ expm1 (double x) + 21844/6081075 * z^13 - 929569/638512875 * z^15 + ... - Since |z| <= log(2)/1024 < 0.0007, the relative error of the z^7 term - is < 0.0007^6 < 2^-60 <= 2^-DBL_MANT_DIG, therefore we can truncate - the series after the z^5 term. + Since |z| <= log(2)/1024 < 0.0007, the relative contribution of the + z^7 term is < 0.0007^6 < 2^-60 <= 2^-DBL_MANT_DIG, therefore we can + truncate the series after the z^5 term. Given the usual bounds DBL_MAX_EXP <= 16384, DBL_MANT_DIG <= 120, we can estimate x: -84 <= x <= 11357. diff --git a/lib/expm1l.c b/lib/expm1l.c index 2621dcde99..849b7aa591 100644 --- a/lib/expm1l.c +++ b/lib/expm1l.c @@ -109,9 +109,9 @@ expm1l (long double x) + 21844/6081075 * z^13 - 929569/638512875 * z^15 + ... - Since |z| <= log(2)/1024 < 0.0007, the relative error of the z^13 term - is < 0.0007^12 < 2^-120 <= 2^-LDBL_MANT_DIG, therefore we can truncate - the series after the z^11 term. + Since |z| <= log(2)/1024 < 0.0007, the relative contribution of the + z^13 term is < 0.0007^12 < 2^-120 <= 2^-LDBL_MANT_DIG, therefore we + can truncate the series after the z^11 term. Given the usual bounds LDBL_MAX_EXP <= 16384, LDBL_MANT_DIG <= 120, we can estimate x: -84 <= x <= 11357. -- 2.39.5