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>
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>
17 .TH TGAMMA 3 2010-09-20 "GNU" "Linux Programmer's Manual"
20 .\"O tgamma, tgammaf, tgammal \- true gamma function
21 tgamma, tgammaf, tgammal \- ËÜÅö¤Î¥¬¥ó¥Þ´Ø¿ô
26 .BI "double tgamma(double " x );
28 .BI "float tgammaf(float " x );
30 .BI "long double tgammal(long double " x );
32 .\"O Link with \fI\-lm\fP.
33 \fI\-lm\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
36 .\"O Feature Test Macro Requirements for glibc (see
37 .\"O .BR feature_test_macros (7)):
38 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
39 .RB ( feature_test_macros (7)
48 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
49 _POSIX_C_SOURCE\ >=\ 200112L;
57 .\"O The Gamma function is defined by
59 .\"O Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt
61 .\"O It is defined for every real number except for nonpositive integers.
62 ¥¬¥ó¥Þ´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë:
64 Gamma(x) = t^(x\-1) e^\-t dt ¤Î 0 ¤«¤é̵¸ÂÂç¤Þ¤Ç¤ÎÀÑʬ
66 ¤³¤Î´Ø¿ô¤ÏÀµ¤Ç¤Ê¤¤À°¿ô¤ò½ü¤¯¤¹¤Ù¤Æ¤Î¼Â¿ô¤ËÂФ·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
67 .\"O For nonnegative integral \fIm\fP one has
71 .\"O and, more generally, for all \fIx\fP:
73 .\"O Gamma(x+1) = x * Gamma(x)
75 .\"O Furthermore, the following is valid for all values of \fIx\fP
76 .\"O outside the poles:
78 .\"O Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x)
80 ÈóÉé¤ÎÀ°¿ô \fIm\fP ¤Ë´Ø¤·¤Æ¡¢°Ê²¼¤¬À®Î©¤¹¤ë:
84 ¤è¤ê°ìÈÌŪ¤Ë¤Ï¡¢¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ë´Ø¤·¤Æ°Ê²¼¤¬À®Î©¤¹¤ë:
86 Gamma(x+1) = x * Gamma(x)
88 ¤µ¤é¤Ë¡¢¶Ë¤ò½ü¤¯¤¹¤Ù¤Æ¤Î \fIx\fP ¤Ç¼¡¼°¤âÀ®Î©¤¹¤ë:
90 Gamma(x) * Gamma(1 \- x) = PI / sin(PI * x)
94 .\"O On success, these functions return Gamma(x).
95 À®¸ù¤¹¤ë¤È¡¢¤³¤ì¤é¤Î´Ø¿ô¤Ï Gamma(x) ¤òÊÖ¤¹¡£
99 .\"O is a NaN, a NaN is returned.
101 ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£
105 .\"O is positive infinity, positive infinity is returned.
107 ¤¬Àµ¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£
111 .\"O is a negative integer, or is negative infinity,
112 .\"O a domain error occurs,
113 .\"O and a NaN is returned.
115 ¤¬Éé¤ÎÀ°¿ô¤«Éé¤Î̵¸ÂÂç¤Î¾ì¹ç¡¢Îΰ襨¥é¡¼ (domain error) ¤¬È¯À¸¤·¡¢
118 .\"O If the result overflows,
119 .\"O a range error occurs,
120 .\"O and the functions return
125 .\"O respectively, with the correct mathematical sign.
126 ·ë²Ì¤¬¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤¹¤ë¾ì¹ç¡¢ÈÏ°Ï¥¨¥é¡¼ (range error) ¤¬È¯À¸¤·¡¢
131 ¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
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 ¤ò¤òÊÖ¤¹¡£¤³¤ÎºÝ¡¢¿ô³ØŪ¤ËÀµ¤·¤¤Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
142 .\"O a pole error occurs,
143 .\"O and the functions return
148 .\"O respectively, with the same sign as the 0.
150 ¤¬ \-0 ¤« +0 ¤Î¾ì¹ç¡¢¶Ë¥¨¥é¡¼ (pole error) ¤¬È¯À¸¤·¡¢
156 0 ¤ÈƱ¤¸Éä¹æ¤¬ÉÕÍ¿¤µ¤ì¤ë¡£
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 ¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤¿ºÝ¤Ë¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¤ÎȽÄêÊýË¡¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
167 .\"O The following errors can occur:
168 °Ê²¼¤Î¥¨¥é¡¼¤¬È¯À¸¤¹¤ë²ÄǽÀ¤¬¤¢¤ë¡£
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
177 .\"O An invalid floating-point exception
178 .\"O .RB ( FE_INVALID )
179 .\"O is raised (but see BUGS).
184 ÉÔÀµ (invalid) ÉâÆ°¾®¿ôÅÀÎã³°
186 ¤¬¾å¤¬¤ë (¡Ö¥Ð¥°¡×¤ÎÀá¤ò»²¾È)¡£
188 .\"O Pole error: \fIx\fP is +0 or \-0
189 ¶Ë¥¨¥é¡¼ (pole error): \fIx\fP ¤¬ +0 ¤« \-0
193 .\"O A divide-by-zero floating-point exception
194 .\"O .RB ( FE_DIVBYZERO )
200 0 ¤Ë¤è¤ë½ü»» (divide-by-zero) ÉâÆ°¾®¿ôÅÀÎã³°
204 .\"O Range error: result overflow
205 ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤Î¥ª¡¼¥Ð¡¼¥Õ¥í¡¼
209 .\"O An overflow floating-point exception
210 .\"O .RB ( FE_OVERFLOW )
216 ¥ª¡¼¥Ð¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
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 ¤Çµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤°Ê²¼¤Î¥¨¥é¡¼¤â
225 .\"O Range error: result underflow
226 ÈÏ°Ï¥¨¥é¡¼ (range error): ·ë²Ì¤Î¥¢¥ó¥À¡¼¥Õ¥í¡¼
227 .\" e.g., tgamma(-172.5) on glibc 2.8/x86-32
231 .\"O An underflow floating-point exception
232 .\"O .RB ( FE_UNDERFLOW )
236 .\"O is not set for this case.
237 ¥¢¥ó¥À¡¼¥Õ¥í¡¼ÉâÆ°¾®¿ôÅÀÎã³°
243 .\" FIXME . Is it intentional that errno is not set:
244 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6810
246 .\" glibc (as at 2.8) also supports and an inexact
247 .\" exception for various cases.
250 .\"O These functions first appeared in glibc in version 2.1.
251 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
252 .\"O .SH "CONFORMING TO"
257 .\"O This function had to be called "true gamma function"
258 .\"O since there is already a function
260 .\"O that returns something else (see
263 ¤³¤Î´Ø¿ô¤ò¡ÖËÜÅö¤Î (true) ¥¬¥ó¥Þ´Ø¿ô¡×¤È¸Æ¤Ð¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£
264 ¤Ê¤¼¤Ê¤é¡¢Â¾¤ÎÃͤòÊÖ¤¹
266 ¤È¤¤¤¦´Ø¿ô¤¬¤¹¤Ç¤Ë¸ºß¤¹¤ë¤«¤é¤Ç¤¢¤ë (¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï
273 .\"O is negative infinity,
275 .\"O is not set (it should be set to
282 ¤¬ÀßÄꤵ¤ì¤ë¤Ù¤¤Ç¤¢¤ë)¡£
283 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6809
285 .\"O In glibc versions 2.3.3 and earlier,
286 .\"O an argument of +0 or \-0 incorrectly produced a domain error
292 .\"O exception raised), rather than a pole error.
293 glibc ¥Ð¡¼¥¸¥ç¥ó 2.3.3 °ÊÁ°¤Ç¤Ï¡¢
294 °ú¤¿ô¤Ë +0 ¤ä \-0 ¤òÅϤ¹¤È¡¢¶Ë¥¨¥é¡¼¤Ç¤Ï¤Ê¤¯¡¢
295 Îΰ襨¥é¡¼¤ò´Ö°ã¤Ã¤ÆȯÀ¸¤·¤Æ¤¤¤¿