37 @deftypefn {Mapping Function} {} gammainc (@var{x}, @var{a})\n\
38 @deftypefnx {Mapping Function} {} gammainc (@var{x}, @var{a}, \"lower\")\n\
39 @deftypefnx {Mapping Function} {} gammainc (@var{x}, @var{a}, \"upper\")\n\
40 Compute the normalized incomplete gamma function,\n\
43 \\gamma (x, a) = {1 \\over {\\Gamma (a)}}\\displaystyle{\\int_0^x t^{a-1} e^{-t} dt}\n\
52 gammainc (x, a) = --------- | exp (-t) t^(a-1) dt\n\
59 with the limiting value of 1 as @var{x} approaches infinity.\n\
60 The standard notation is @math{P(a,x)}, e.g., Abramowitz and Stegun (6.5.1).\n\
62 If @var{a} is scalar, then @code{gammainc (@var{x}, @var{a})} is returned\n\
63 for each element of @var{x} and vice versa.\n\
65 If neither @var{x} nor @var{a} is scalar, the sizes of @var{x} and\n\
66 @var{a} must agree, and @code{gammainc} is applied element-by-element.\n\
68 By default the incomplete gamma function integrated from 0 to @var{x} is\n\
69 computed. If @qcode{\"upper\"} is given then the complementary function\n\
70 integrated from @var{x} to infinity is calculated. It should be noted that\n\
73 gammainc (@var{x}, @var{a}) @equiv{} 1 - gammainc (@var{x}, @var{a}, \"upper\")\n\
75 @seealso{gamma, lgamma}\n\
81 int nargin = args.
length ();
85 if (args(2).is_string ())
87 std::string s = args(2).string_value ();
91 else if (s !=
"lower")
92 error (
"gammainc: third argument must be \"lower\" or \"upper\"");
95 error (
"gammainc: third argument must be \"lower\" or \"upper\"");
119 :
static_cast<float>(1)
128 :
static_cast<float>(1)
145 :
static_cast<float>(1)
154 :
static_cast<float>(1)