On Mon, 9 Nov 2015, Garrett Cooper wrote:

Log:
 Document powl(3)

powl was garbage that was intentionally undocumented.  At least, I
intentionally ignored its non-documentation together with it.

Modified: head/lib/msun/man/exp.3
==============================================================================
--- head/lib/msun/man/exp.3     Mon Nov  9 10:35:33 2015        (r290604)
+++ head/lib/msun/man/exp.3     Mon Nov  9 10:40:16 2015        (r290605)
@@ -99,9 +102,10 @@ functions compute the value exp(x)\-1 ac
.Fa x .
.Pp
The
-.Fn pow
+.Fn pow ,
+.Fn powf ,
and the
-.Fn powf
+.Fn powl
functions compute the value
of
.Ar x

powl doesn't compute the value of .Ar x to the exponent .Ar y.  It computes
the value of (double)(.Ar x) to the exponent (double)(.Ar y), converted to
double.

@@ -122,9 +126,10 @@ Otherwise the error in these functions i
These functions will return the appropriate computation unless an error
occurs or an argument is out of range.

powl() almost never returns the appropriate computation.  Its bugs are
most obvious when an argument is too large for double but not out of range.

The functions
-.Fn pow x y
+.Fn pow x y ,
+.Fn powf x y ,
and
-.Fn powf x y
+.Fn powl x y
raise an invalid exception and return an \*(Na if
.Fa x
< 0 and

I doubt that the rest of this section (about exception handling) is
correct for powl().

The section on errors wasn't changed since it uses generic pow().  It
claims that the error is generally less than 1 ulp.  But for powl(),
the error is generally more that 4096 ulps.  Much more when the
error exponentiates.  powf() and pow() do well to avoid exponentiation
of roundoff errors.

Bruce
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to