summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-08-26 17:04:29 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-08-26 17:04:29 +0000
commit31643b27652c00df77f0fc614879fe0977d4df2e (patch)
tree8e547b33483a9dd2e23a8405f60ad0cdb30c782d /lib
parent81ff305f18aded28ec80b5cb5246b3a69fde9465 (diff)
For exceptional cases of mathematical formulae that can't reasonably
be represented otherwise, use eqn(7). Idea originally from bentley@, feedback and OK bentley@, OK tb@, and no objection from jmc@.
Diffstat (limited to 'lib')
-rw-r--r--lib/libm/man/erf.318
-rw-r--r--lib/libm/man/lgamma.323
2 files changed, 23 insertions, 18 deletions
diff --git a/lib/libm/man/erf.3 b/lib/libm/man/erf.3
index bb1cba2070a..a3d2bb37b37 100644
--- a/lib/libm/man/erf.3
+++ b/lib/libm/man/erf.3
@@ -1,4 +1,5 @@
-.\" $OpenBSD: erf.3,v 1.15 2016/04/26 19:49:22 tb Exp $
+'\" e
+.\" $OpenBSD: erf.3,v 1.16 2017/08/26 17:04:28 schwarze Exp $
.\" Copyright (c) 1985, 1991 Regents of the University of California.
.\" All rights reserved.
.\"
@@ -28,7 +29,7 @@
.\"
.\" from: @(#)erf.3 6.4 (Berkeley) 4/20/91
.\"
-.Dd $Mdocdate: April 26 2016 $
+.Dd $Mdocdate: August 26 2017 $
.Dt ERFC 3
.Os
.Sh NAME
@@ -59,7 +60,7 @@ These functions calculate the error function of
.Pp
The
.Fn erf
-calculates the error function of x, and
+function calculates the error function of x, and
the
.Fn erff
and
@@ -67,12 +68,11 @@ and
functions are single and double precision versions of
.Fn erf .
The error function is defined as:
-.Bd -filled -offset indent
-.if n \{\
-erf(x) = 2/sqrt(pi)*\|integral from 0 to x of exp(\-t*t) dt. \}
-.if t \{\
-erf\|(x) :=
-(2/\(sr pi)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt. \}
+.Bd -unfilled -offset indent
+.EQ
+roman erf left ( x right ) =
+2 over sqrt pi int from 0 to x e sup {- t sup 2} dt
+.EN
.Ed
.Pp
The
diff --git a/lib/libm/man/lgamma.3 b/lib/libm/man/lgamma.3
index 8aab5564140..136b8ed5e1e 100644
--- a/lib/libm/man/lgamma.3
+++ b/lib/libm/man/lgamma.3
@@ -1,4 +1,5 @@
-.\" $OpenBSD: lgamma.3,v 1.27 2016/04/26 19:49:22 tb Exp $
+'\" e
+.\" $OpenBSD: lgamma.3,v 1.28 2017/08/26 17:04:28 schwarze Exp $
.\" Copyright (c) 1985, 1991 Regents of the University of California.
.\" All rights reserved.
.\"
@@ -28,7 +29,7 @@
.\"
.\" from: @(#)lgamma.3 6.6 (Berkeley) 12/3/92
.\"
-.Dd $Mdocdate: April 26 2016 $
+.Dd $Mdocdate: August 26 2017 $
.Dt LGAMMA 3
.Os
.Sh NAME
@@ -67,16 +68,20 @@
.Fn tgammal "long double x"
.Sh DESCRIPTION
.Fn lgamma x
-.if t \{\
returns ln\||\(*G(x)| where
-.Bd -unfilled -offset indent
-\(*G(x) = \(is\d\s8\z0\s10\u\u\s8\(if\s10\d t\u\s8x\-1\s10\d e\u\s8\-t\s10\d dt for x > 0 and
+.Bd -filled -offset indent
+.EQ
+GAMMA left ( x right ) =
+int from 0 to inf t sup {x - 1} e sup -t dt
+.EN
+\ \ \ for x > 0 and
.br
-\(*G(x) = \(*p/(\(*G(1\-x)\|sin(\(*px)) for x < 1.
+.EQ
+GAMMA left ( x right ) =
+pi over { GAMMA left ( 1 - x right ) sin left ( pi x right ) }
+.EN
+\ \ \ for x < 1.
.Ed
-.\}
-.if n \
-returns ln\||\(*G(x)|.
.Pp
The external integer
.Va signgam