View source code
Display the source code in std/mathspecial.d from which thispage was generated on github.
Report a bug
If you spot a problem with this page, click here to create aGitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinglocal clone.
Function std.mathspecial.betaIncompleteCompl
Regularized incomplete beta function complement ICx(a,b)
real betaIncompleteCompl(
real a,
real b,
real x
) pure nothrow @nogc @safe;
Mathematically, if a > 0, b > 0, and 0 ≤ x ≤ 1, then ICx(a,b) = ∫x1ta-1(1-t)b-1dt/B(a,b) where B is the beta function. It is also the complement of the cumulative distribution function of the beta distribution. It can be shown that ICx(a,b) = I1-x(b,a).
Parameters
| Name | Description |
|---|---|
| a | the first argument of B, must be positive |
| b | the second argument of B, must be positive |
| x | the fraction of integration completion from above, 0 ≤ x ≤ 1 |
Returns
It returns ICx(a,b), an element of [0,1].
| a | b | x | betaIncompleteCompl(a, b, x) |
|---|---|---|---|
| negative | b | x | NAN |
| a | negative | x | NAN |
| a | b | < 0 | NAN |
| a | b | > 1 | NAN |
| +0 | +0 | (0,1) | NAN |
| ∞ | ∞ | (0,1) | NAN |
If one or more of the input parameters are NAN, the one with the largest payload is returned. For equal payloads but with possibly different signs, the order of preference is x, a, b.
See Also
Example
writeln(betaIncompleteCompl(.1, .2, 0)); // betaIncomplete(.2, .1, 1)
Authors
Stephen L. Moshier (original C code). Conversion to D by Don Clugston
License
Copyright © 1999-2026 by the D Language Foundation | Page generated by ddox.