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\
45 \\gamma (x, a) = {1 \\over {\\Gamma (a)}}\\displaystyle{\\int_0^x t^{a-1} e^{-t} dt}\n\
54 gammainc (x, a) = --------- | exp (-t) t^(a-1) dt\n\
61 with the limiting value of 1 as @var{x} approaches infinity.\n\
62 The standard notation is @math{P(a,x)}, e.g., @nospell{Abramowitz} and\n\
63 @nospell{Stegun} (6.5.1).\n\
65 If @var{a} is scalar, then @code{gammainc (@var{x}, @var{a})} is returned\n\
66 for each element of @var{x} and vice versa.\n\
68 If neither @var{x} nor @var{a} is scalar, the sizes of @var{x} and\n\
69 @var{a} must agree, and @code{gammainc} is applied element-by-element.\n\
71 By default the incomplete gamma function integrated from 0 to @var{x} is\n\
72 computed. If @qcode{\"upper\"} is given then the complementary function\n\
73 integrated from @var{x} to infinity is calculated. It should be noted that\n\
76 gammainc (@var{x}, @var{a}) @equiv{} 1 - gammainc (@var{x}, @var{a}, \"upper\")\n\
78 @seealso{gamma, gammaln}\n\
84 int nargin = args.
length ();
88 if (args(2).is_string ())
90 std::string s = args(2).string_value ();
94 else if (s !=
"lower")
95 error (
"gammainc: third argument must be \"lower\" or \"upper\"");
98 error (
"gammainc: third argument must be \"lower\" or \"upper\"");
OCTINTERP_API void print_usage(void)
bool is_scalar_type(void) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
float float_value(bool frc_str_conv=false) const
double gammainc(double x, double a, bool &err)
FloatNDArray float_array_value(bool frc_str_conv=false) const
octave_idx_type length(void) const
NDArray array_value(bool frc_str_conv=false) const
ColumnVector transform(const Matrix &m, double x, double y, double z)
bool is_single_type(void) const
double double_value(bool frc_str_conv=false) const
F77_RET_T const double * x