glibc/manual
Joseph Myers 18a218b74c Refine documentation of libm exceptions goals.
This patch refines the math.texi documentation of the goals for when
libm function raise the inexact and underflow exceptions.  The
previous text was problematic in some cases around the underflow
threshold.

* Strictly, it would have meant that if the mathematical result of pow
  was very slightly below DBL_MIN, for example, it was required to
  raise the underflow exception; although normally a few ulps error
  would be OK, if that error meant the computed value was slightly
  above DBL_MIN it would fail the previously described underflow
  exception goal.

* Similarly, strict IEEE semantics would imply that sin (DBL_MIN), in
  round-to-nearest mode, underflows on before-rounding but not
  after-rounding architectures, while returning DBL_MIN; the previous
  wording would have required an underflow exception, so preventing
  checks for a result with absolute value below DBL_MIN from being
  sufficient checks to determine whether the exception is required.
  (Under the previous wording, checks for a result with absolute value
  <= DBL_MIN wouldn't have been sufficient either, because in
  FE_TOWARDZERO mode a result of DBL_MIN definitely does not result
  from an underflowing infinite-precision result.)

* The previous wording about rounding infinite-precision values could
  be taken to mean all exceptions including "inexact" must be
  consistent with some such value.  That would mean that a result of
  DBL_MIN in FE_UPWARD mode with "inexact" raised must also have
  "underflow" raised on before-rounding architectures.  Again, that
  would cause problems for computing a result (possibly with spurious
  "inexact" exceptions) and then using a rounding-mode-independent
  test for results with absolute value below DBL_MIN to determine
  whether an underflow exception must be forced in case the underflows
  from intermediate computations happened to be exact.

By refining the documentation, this patch avoids stating goals for
accuracy close to the underflow threshold that were stricter than
applied anywhere else, and allows the implementation strategy of:
compute a result within a few ulps, taking care to avoid underflows in
intermediate computations, then force an underflow exception if that
result was subnormal.  Only fully-defined functions such as fma need
to take greater care about the exact underflow threshold (including
its dependence on whether the architecture is before-rounding or
after-rounding, and on the rounding mode on after-rounding
architectures).

(If the rounding mode is changed as part of the computation, it's
still necessary to ensure that not just intermediate computations, but
the final computation of the result to be returned, do not raise
underflow if that result is the least normal value and underflow would
be inconsistent with the original rounding mode.  Since such code can
readily discard exceptions as part of saving and restoring the
rounding mode - SET_RESTORE_ROUND_NOEX etc. - I don't think that
should be a problem in practice.)

	* manual/math.texi (Errors in Math Functions): Clarify goals
	regarding inexact and underflow exceptions.
2015-02-17 23:41:27 +00:00
..
examples Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
argp.texi
arith.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
charset.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
check-safety.sh Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
conf.texi
contrib.texi glibc 2.21 pre-release update. 2015-02-05 23:14:38 -05:00
creature.texi Remove _BSD_SOURCE and _SVID_SOURCE. 2014-02-11 23:40:07 +00:00
crypt.texi
ctype.texi
debug.texi
dir
errno.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
fdl-1.3.texi
filesys.texi manual: Update prototypes for alphasort and friends 2014-05-23 11:26:06 +02:00
freemanuals.texi
getopt.texi
header.texi
install-plain.texi
install.texi glibc 2.21 pre-release update. 2015-02-05 23:14:38 -05:00
intro.texi manual: Sort overview listing by manual order. 2014-04-17 19:41:09 -04:00
io.texi
ipc.texi manual/ipc.texi: Fix AC-safety notes. 2014-04-08 17:12:15 -04:00
job.texi ctermid: return string literal, document MT-Safety pitfall 2014-11-21 02:16:02 -02:00
lang.texi
lgpl-2.1.texi
libc-texinfo.sh
libc.texinfo Update copyright dates not handled by scripts/update-copyrights. 2015-01-02 16:54:45 +00:00
libcbook.texi
libdl.texi
libm-err-tab.pl Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
llio.texi manual/llio.texi: Comment on write atomicity. 2014-11-06 15:58:52 -05:00
locale.texi manual: Update the locale documentation 2014-07-10 16:30:40 +02:00
macros.texi * manual/macros.texi: Add comments before MTASC-safety macros. 2014-02-03 17:26:08 -02:00
maint.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
Makefile Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
math.texi Refine documentation of libm exceptions goals. 2015-02-17 23:41:27 +00:00
memory.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
message.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
nss.texi
nsswitch.texi
pattern.texi
pipe.texi
platform.texi
probes.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
process.texi Add a new "Inter-Process Communication" chapter. 2014-02-26 11:05:09 -05:00
resource.texi Fix typo in manual. 2014-06-05 01:13:04 +02:00
search.texi manual: Correct guarantee about pointers compared by qsort() 2014-12-21 14:11:32 +01:00
setjmp.texi manual/setjmp.texi: Clarify setcontext and signal handlers text 2014-04-17 11:40:36 +01:00
signal.texi Fix crossreference to nonexistent node BSD Handler 2014-11-18 11:19:20 +01:00
socket.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
startup.texi Remove _BSD_SOURCE and _SVID_SOURCE. 2014-02-11 23:40:07 +00:00
stdio-fp.c
stdio.texi Fix types of stream hook functions in manual. 2014-04-28 18:54:24 +02:00
string.texi Fix qsort argument order in collation example 2014-04-12 14:26:29 +10:00
summary.awk Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
sysinfo.texi manual: fix addmntent's MT-Safety race annotation 2014-11-21 02:45:02 -02:00
syslog.texi
terminal.texi * manual/terminal.texi: Document MTASC-safety properties. 2014-02-01 03:53:15 -02:00
texinfo.tex Update miscellaneous files from upstream sources. 2014-06-26 20:13:44 +00:00
texis.awk
threads.texi Add header and standard information to threads.texi. 2014-02-28 18:30:22 -05:00
time.texi * manual/time.texi (TZ Variable): glibc no longer comes with tzdata. 2015-02-16 15:32:34 -08:00
tsort.awk Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
users.texi manual: cuserid is mtasurace if not passed a string 2014-11-21 02:15:09 -02:00
xtract-typefun.awk