OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / draft / man3 / tgamma.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" Based on glibc infopages
4 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
5 .\"     <mtk.manpages@gmail.com>
6 .\" Modified 2004-11-15, fixed error noted by Fabian Kreutz
7 .\"      <kreutz@dbs.uni-hannover.de>
8 .\"
9 .\" Japanese Version Copyright (c) 2002 Akihiro MOTOKI
10 .\"         all rights reserved.
11 .\" Translated Sun Sep 22 09:31:52 2002
12 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
13 .\" Updated & Modified Sat Feb 12 12:00:00 2005
14 .\"         by SAITOH Akira <s-akira@users.sourceforge.net>
15 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
16 .\"
17 .TH TGAMMA 3 2010-09-20 "GNU" "Linux Programmer's Manual"
18 .\"O .SH NAME
19 .SH Ì¾Á°
20 .\"O tgamma, tgammaf, tgammal \- true gamma function
21 tgamma, tgammaf, tgammal \- ËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô
22 .\"O .SH SYNOPSIS
23 .SH ½ñ¼°
24 .B #include <math.h>
25 .sp
26 .BI "double tgamma(double " x );
27 .br
28 .BI "float tgammaf(float " x );
29 .br
30 .BI "long double tgammal(long double " x );
31 .sp
32 .\"O Link with \fI\-lm\fP.
33 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
34 .sp
35 .in -4n
36 .\"O Feature Test Macro Requirements for glibc (see
37 .\"O .BR feature_test_macros (7)):
38 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
39 .RB ( feature_test_macros (7)
40 »²¾È):
41 .in
42 .sp
43 .ad l
44 .BR tgamma (),
45 .BR tgammaf (),
46 .BR tgammal ():
47 .RS 4
48 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
49 _POSIX_C_SOURCE\ >=\ 200112L;
50 .br
51 or
52 .I cc\ -std=c99
53 .RE
54 .ad
55 .\"O .SH DESCRIPTION
56 .SH ÀâÌÀ
57 .\"O The Gamma function is defined by
58 .\"O .sp
59 .\"O     Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt
60 .\"O .sp
61 .\"O It is defined for every real number except for nonpositive integers.
62 ¥¬¥ó¥Þ´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë:
63 .sp
64      Gamma(x) = t^(x\-1) e^\-t dt ¤Î 0 ¤«¤é̵¸ÂÂç¤Þ¤Ç¤ÎÀÑʬ
65 .sp
66 ¤³¤Î´Ø¿ô¤ÏÀµ¤Ç¤Ê¤¤À°¿ô¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¼Â¿ô¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
67 .\"O For nonnegative integral \fIm\fP one has
68 .\"O .sp
69 .\"O     Gamma(m+1) = m!
70 .\"O .sp
71 .\"O and, more generally, for all \fIx\fP:
72 .\"O .sp
73 .\"O     Gamma(x+1) = x * Gamma(x)
74 .\"O .sp
75 .\"O Furthermore, the following is valid for all values of \fIx\fP
76 .\"O outside the poles:
77 .\"O .sp
78 .\"O     Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x)
79 .\"O .PP
80 ÈóÉé¤ÎÀ°¿ô \fIm\fP ¤Ë´Ø¤·¤Æ¡¢°Ê²¼¤¬À®Î©¤¹¤ë:
81 .sp
82     Gamma(m+1) = m!
83 .sp
84 ¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ë´Ø¤·¤Æ°Ê²¼¤¬À®Î©¤¹¤ë:
85 .sp
86     Gamma(x+1) = x * Gamma(x)
87 .sp
88 ¤µ¤é¤Ë¡¢¶Ë¤ò½ü¤¯¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ç¼¡¼°¤âÀ®Î©¤¹¤ë:
89 .sp
90     Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x)
91 .PP
92 .\"O .SH RETURN VALUE
93 .SH ÊÖ¤êÃÍ
94 .\"O On success, these functions return Gamma(x).
95 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤òÊÖ¤¹¡£
96
97 .\"O If
98 .\"O .I x
99 .\"O is a NaN, a NaN is returned.
100 .I x
101 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
102
103 .\"O If
104 .\"O .I x
105 .\"O is positive infinity, positive infinity is returned.
106 .I x
107 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
108
109 .\"O If
110 .\"O .I x
111 .\"O is a negative integer, or is negative infinity,
112 .\"O a domain error occurs,
113 .\"O and a NaN is returned.
114 .I x
115 ¤¬Éé¤ÎÀ°¿ô¤«Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
116 NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
117
118 .\"O If the result overflows,
119 .\"O a range error occurs,
120 .\"O and the functions return
121 .\"O .BR HUGE_VAL ,
122 .\"O .BR HUGE_VALF ,
123 .\"O or
124 .\"O .BR HUGE_VALL ,
125 .\"O respectively, with the correct mathematical sign.
126 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
127 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
128 .BR HUGE_VAL ,
129 .BR HUGE_VALF ,
130 .BR HUGE_VALL ,
131 ¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
132
133 .\"O If the result underflows,
134 .\"O a range error occurs,
135 .\"O and the functions return 0, with the correct mathematical sign.
136 ·ë²Ì¤¬¥¢¥ó¥À¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
137 ´Ø¿ô¤Ï 0 ¤ò¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
138
139 .\"O If
140 .\"O .I x
141 .\"O is \-0 or +0,
142 .\"O a pole error occurs,
143 .\"O and the functions return
144 .\"O .BR HUGE_VAL ,
145 .\"O .BR HUGE_VALF ,
146 .\"O or
147 .\"O .BR HUGE_VALL ,
148 .\"O respectively, with the same sign as the 0.
149 .I x
150 ¤¬ \-0 ¤« +0 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢
151 ³Æ´Ø¿ô¤Ï¤½¤ì¤¾¤ì
152 .BR HUGE_VAL ,
153 .BR HUGE_VALF ,
154 .BR HUGE_VALL ,
155 ¤òÊÖ¤¹¡£
156 0 ¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
157 .\"O .SH ERRORS
158 .SH ¥¨¥é¡¼
159 .\"O See
160 .\"O .BR math_error (7)
161 .\"O for information on how to determine whether an error has occurred
162 .\"O when calling these functions.
163 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
164 .BR math_error (7)
165 ¤ò»²¾È¤Î¤³¤È¡£
166 .PP
167 .\"O The following errors can occur:
168 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ­¤¬¤¢¤ë¡£
169 .TP
170 .\"O Domain error: \fIx\fP is a negative integer, or negative infinity
171 Îΰ襨¥é¡¼: \fIx\fP ¤¬Éé¤ÎÀ°¿ô¤«Éé¤Î̵¸ÂÂç
172 .\" FIXME . errno is not set to EDOM for x == -inf
173 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809
174 .\"O .I errno
175 .\"O is set to
176 .\"O .BR EDOM .
177 .\"O An invalid floating-point exception
178 .\"O .RB ( FE_INVALID )
179 .\"O is raised (but see BUGS).
180 .I errno
181 ¤Ë
182 .B EDOM
183 ¤¬ÀßÄꤵ¤ì¤ë¡£
184 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
185 .RB ( FE_INVALID )
186 ¤¬¾å¤¬¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£
187 .TP
188 .\"O Pole error: \fIx\fP is +0 or \-0
189 ¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ +0 ¤« \-0
190 .\"O .I errno
191 .\"O is set to
192 .\"O .BR ERANGE .
193 .\"O A divide-by-zero floating-point exception
194 .\"O .RB ( FE_DIVBYZERO )
195 .\"O is raised.
196 .I errno
197 ¤Ë
198 .B ERANGE
199 ¤¬ÀßÄꤵ¤ì¤ë¡£
200 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
201 .RB ( FE_DIVBYZERO )
202 ¤¬¾å¤¬¤ë¡£
203 .TP
204 .\"O Range error: result overflow
205 ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
206 .\"O .I errno
207 .\"O is set to
208 .\"O .BR ERANGE .
209 .\"O An overflow floating-point exception
210 .\"O .RB ( FE_OVERFLOW )
211 .\"O is raised.
212 .I errno
213 ¤Ë
214 .B ERANGE
215 ¤¬ÀßÄꤵ¤ì¤ë¡£
216 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
217 .RB ( FE_OVERFLOW )
218 ¤¬¾å¤¬¤ë¡£
219 .PP
220 .\"O glibc also gives the following error which is not specified
221 .\"O in C99 or POSIX.1-2001.
222 glibc ¤Ç¤Ï¡¢C99 ¤ä POSIX.1-2001 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤°Ê²¼¤Î¥¨¥é¡¼¤â
223 µ¯¤³¤êÆÀ¤ë¡£
224 .TP
225 .\"O Range error: result underflow
226 ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼
227 .\" e.g., tgamma(-172.5) on glibc 2.8/x86-32
228 .\" .I errno
229 .\" is set to
230 .\" .BR ERANGE .
231 .\"O An underflow floating-point exception
232 .\"O .RB ( FE_UNDERFLOW )
233 .\"O is raised.
234 .\"O .IP
235 .\"O .I errno
236 .\"O is not set for this case.
237 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
238 .RB ( FE_UNDERFLOW )
239 ¤¬¾å¤¬¤ë¡£
240 ¤³¤Î¾ì¹ç¤Ï
241 .I errno
242 ¤ÏÀßÄꤵ¤ì¤Ê¤¤¡£
243 .\" FIXME . Is it intentional that errno is not set:
244 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6810
245 .\"
246 .\" glibc (as at 2.8) also supports and an inexact
247 .\" exception for various cases.
248 .\"O .SH VERSIONS
249 .SH ¥Ð¡¼¥¸¥ç¥ó
250 .\"O These functions first appeared in glibc in version 2.1.
251 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
252 .\"O .SH "CONFORMING TO"
253 .SH ½àµò
254 C99, POSIX.1-2001.
255 .\"O .SH NOTES
256 .SH Ãí°Õ
257 .\"O This function had to be called "true gamma function"
258 .\"O since there is already a function
259 .\"O .BR gamma (3)
260 .\"O that returns something else (see
261 .\"O .BR gamma (3)
262 .\"O for details).
263 ¤³¤Î´Ø¿ô¤ò¡ÖËÜÅö¤Î (true) ¥¬¥ó¥Þ´Ø¿ô¡×¤È¸Æ¤Ð¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£
264 ¤Ê¤¼¤Ê¤é¡¢Â¾¤ÎÃͤòÊÖ¤¹
265 .BR gamma (3)
266 ¤È¤¤¤¦´Ø¿ô¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¤«¤é¤Ç¤¢¤ë (¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï
267 .BR gamma (3)
268 ¤ò»²¾È)¡£
269 .\"O .SH BUGS
270 .SH ¥Ð¥°
271 .\"O If
272 .\"O .I x
273 .\"O is negative infinity,
274 .\"O .I errno
275 .\"O is not set (it should be set to
276 .\"O .BR EDOM ).
277 .I x
278 ¤¬Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢
279 .I errno
280 ¤ÏÀßÄꤵ¤ì¤Ê¤¤
281 .RB ( EDOM
282 ¤¬ÀßÄꤵ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë)¡£
283 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809
284
285 .\"O In glibc versions 2.3.3 and earlier,
286 .\"O an argument of +0 or \-0 incorrectly produced a domain error
287 .\"O .RI ( errno
288 .\"O set to
289 .\"O .B EDOM
290 .\"O and an
291 .\"O .B FE_INVALID
292 .\"O exception raised), rather than a pole error.
293 glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.3 °ÊÁ°¤Ç¤Ï¡¢
294 °ú¤­¿ô¤Ë +0 ¤ä \-0 ¤òÅϤ¹¤È¡¢¶Ë¥¨¥é¡¼¤Ç¤Ï¤Ê¤¯¡¢
295 Îΰ襨¥é¡¼¤ò´Ö°ã¤Ã¤ÆȯÀ¸¤·¤Æ¤¤¤¿
296 (Îΰ襨¥é¡¼¤Î¾ì¹ç¡¢
297 .I errno
298 ¤Ë
299 .B EDOM
300 ¤òÀßÄꤵ¤ì¡¢
301 .B FE_INVALID
302 Îã³°¤¬È¯À¸¤¹¤ë)¡£
303 .\"O .SH "SEE ALSO"
304 .SH ´ØÏ¢¹àÌÜ
305 .BR gamma (3),
306 .BR lgamma (3)