It may be somewhat interesting to mention why expm1(x) = exp(x) - 1 and
log1p(x) = log(1 + x) are provided and what their historical purpose is.
However, as mlarkin@ put it: are any of our users of exp(3) going to
seriously be asking themselves "hmm, is OpenBSD's exp compatible with
BASIC on the HP-71B?"

I suggest to keep a little bit of the historical background but strip
away the extra verbiage.

While there, use \(mi instead of - for the mathematical minus sign, as
mandoc_char(7) recommends.  I'd also like to add some spaces surrounding
the arithmetic operations.  I think this makes the formulas much easier
to parse:  I had to think for a second to be sure whether (1+x)**n-1
means (1+x)**(n-1) or ((1+x)**n)-1, while (1 + x)**n - 1 is hard to
misinterpret at first glance.

Index: exp.3
===================================================================
RCS file: /var/cvs/src/lib/libm/man/exp.3,v
retrieving revision 1.33
diff -u -p -r1.33 exp.3
--- exp.3       26 Apr 2016 19:49:22 -0000      1.33
+++ exp.3       30 May 2016 12:02:21 -0000
@@ -139,7 +139,7 @@ function is an extended precision versio
 .Pp
 The
 .Fn expm1
-function computes the value exp(x)\-1 accurately even for tiny argument
+function computes the value exp(x) \(mi 1 accurately even for tiny argument
 .Fa x .
 The
 .Fn expm1f
@@ -194,7 +194,7 @@ function is an extended precision versio
 The
 .Fn log1p
 function computes
-the value of log(1+x) accurately even for tiny argument
+the value of log(1 + x) accurately even for tiny argument
 .Fa x .
 The
 .Fn log1pf
@@ -277,12 +277,9 @@ are accurate enough that
 .Fn pow integer integer
 is exact until it is bigger than 2**53 for IEEE 754.
 .Sh NOTES
-The functions exp(x)\-1 and log(1+x) are called
-expm1 and logp1 in BASIC on the Hewlett\-Packard HP-71B
-and APPLE Macintosh, EXP1 and LN1 in Pascal, exp1 and log1 in C
-on APPLE Macintoshes, where they have been provided to make
-sure financial calculations of ((1+x)**n\-1)/x, namely
-expm1(n*log1p(x))/x, will be accurate when x is tiny.
+The historical use of expm1(x) = exp(x) \(mi 1 and log1p(x) = log(1 + x)
+is to make sure financial calculations of ((1 + x)**n \(mi 1) / x,
+namely expm1(n * log1p(x)) / x, will be accurate when x is tiny.
 They also provide accurate inverse hyperbolic functions.
 .Pp
 The function

Reply via email to