about summary refs log tree commit diff
path: root/manual/math.texi
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-30 06:56:10 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-30 06:56:10 +0000
commitaaa1276ee31ca872190cd097c7b4d845996fed39 (patch)
treed14e77b1744c5713f4cfff6e86c9417d7ddd8ce8 /manual/math.texi
parent6491b8094e929133e3eb8793bb6296f69fb54a78 (diff)
downloadglibc-aaa1276ee31ca872190cd097c7b4d845996fed39.tar.gz
glibc-aaa1276ee31ca872190cd097c7b4d845996fed39.tar.xz
glibc-aaa1276ee31ca872190cd097c7b4d845996fed39.zip
Update.
	* manual/math.texi (Errors in Math Functions): New section.
	* math/libm-err-tab.pl: Moved to...
	* manual/libm-err-tab.pl: ...here.
	* manual/Makefile: Add rules for math function error table generation.
Diffstat (limited to 'manual/math.texi')
-rw-r--r--manual/math.texi42
1 files changed, 42 insertions, 0 deletions
diff --git a/manual/math.texi b/manual/math.texi
index f2736c2c45..c9a4c3a611 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -61,6 +61,7 @@ same as @code{double}.
 * Exponents and Logarithms::    Also pow and sqrt.
 * Hyperbolic Functions::        sinh, cosh, tanh, etc.
 * Special Functions::           Bessel, gamma, erf.
+* Errors in Math Functions::    Known Maximum Errors in Math Functions.
 * Pseudo-Random Numbers::       Functions for generating pseudo-random
 				 numbers.
 * FP Function Optimizations::   Fast code or small code.
@@ -1203,6 +1204,47 @@ is negative, @code{yn} signals a domain error; if it is zero,
 @code{yn} signals overflow and returns @math{-@infinity}.
 @end deftypefun
 
+@node Errors in Math Functions
+@section Known Maximum Errors in Math Functions
+@cindex math errors
+@cindex ulps
+
+This section lists the known errors of the functions in the math
+library.  Errors are measured in ``units of the last place''.  This is a
+measure for the relative error.  For a number @math{z} with the
+representation @math{d.d@dots{}d@mul{}2^e} (we assume IEEE
+floating-point numbers with base 2) the ULP is represented by
+
+@tex
+$$\frac{|{\mathrm d.d\dots d - (z/2^e)|}{2^{p-1}}$$
+@end tex
+@ifnottex
+@smallexample
+|d.d...d - (z / 2^e)| / 2^(p - 1)
+@end smallexample
+@end ifnottex
+
+@noindent
+where @math{p} is the number of bits in the mantissa of the
+floating-point number representation.  Ideally the error for all
+functions is always less than 0.5ulps.  Using rounding bits this is also
+possible and normally implemented for the basic operations.  To achieve
+the same for the complex math functions requires a lot more work and
+this was not spend so far.
+
+Therefore many of the functions in the math library have errors.  The
+table lists the maximum error for each function which is exposed by one
+of the existing tests in the test suite.  It is tried to cover as much
+as possible and really list the maximum error (or at least a ballpark
+figure) but this is often not achieved due to the large search space.
+
+The table lists the ULP values for different architectures.  Different
+architectures have different results since their hardware support for
+floating-point operations varies and also the existing hardware support
+is different.
+
+@include libm-err.texi
+
 @node Pseudo-Random Numbers
 @section Pseudo-Random Numbers
 @cindex random numbers