1 .\" $OpenBSD: lgamma.3,v 1.22 2015/01/15 19:06:31 schwarze Exp $
2 .\" Copyright (c) 1985, 1991 Regents of the University of California.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the University nor the names of its contributors
14 .\" may be used to endorse or promote products derived from this software
15 .\" without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" from: @(#)lgamma.3 6.6 (Berkeley) 12/3/92
31 .Dd $Mdocdate: January 15 2015 $
44 .Nd log gamma functions
55 .Fn lgammal "long double x"
57 .Fn lgamma_r "double x" "int *signgamp"
59 .Fn lgammaf_r "float x" "int *signgamp"
61 .\".Fn lgammal_r "long double x" "int *signgamp"
67 .Fn tgammal "long double x"
71 returns ln\||\(*G(x)| where
72 .Bd -unfilled -offset indent
73 \(*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
75 \(*G(x) = \(*p/(\(*G(1\-x)\|sin(\(*px)) for x < 1.
79 returns ln\||\(*G(x)|.
83 returns the sign of \(*G(x).
86 function is a single precision version of
90 function is an extended precision version of
99 functions are thread-safe versions of
105 that return the sign via the
107 pointer instead of modifying
115 functions return \(*G(x), with no effect on
118 Do not use the expression
119 .Sq Li signgam\(**exp(lgamma(x))
120 to compute g := \(*G(x).
121 Instead use a program like this (in C):
122 .Bd -literal -offset indent
123 lg = lgamma(x); g = signgam\(**exp(lg);
128 has returned can signgam be correct.
130 For arguments in its range,
132 is preferred, as for positive arguments
133 it is accurate to within one unit in the last place.
136 returns appropriate values unless an argument is out of range.
137 Overflow will occur for sufficiently large positive values, and
138 non-positive integers.
139 For large non-integer negative values,
142 On the VAX, the reserved operator is returned, and
157 functions are expected to conform to
173 are deprecated aliases for
181 function first appeared in
185 function first appeared in
189 function first appeared in
193 function that appeared in
195 as a function to compute \(*G(x).