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.gammaIncompleteComplInverse

Inverse regularized upper incomplete gamma function Q-1(a,p) with respect to p

real gammaIncompleteComplInverse(
  real a,
  real p
) pure nothrow @nogc @safe;

Given a and p, the function finds x such that p = Q(a,x).

Parameters

NameDescription
a the shape parameter, must be positive
p Q(a,x), must be in the interval [0,1]

Returns

It returns x, a value ≥ 0

Special Values
a p gammaIncompleteComplInverse(a, p)
negative NAN
< 0 NAN
> 1 NAN
+0 < 1 NAN
> 0 NAN
> 0 0
< ∞ 1 0

See Also

gammaIncompleteCompl

Example

const a = 2, p = 0.5L;
assert(isClose(gammaIncompleteComplInverse(a, gammaIncompleteCompl(a, p)), p));

assert(isClose(gammaIncompleteComplInverse(1, 1/E), 1));
assert(isNaN(gammaIncompleteComplInverse(+0.0L, 0.1)));
assert(isNaN(gammaIncompleteComplInverse(real.infinity, 0.2)));
assert(gammaIncompleteComplInverse(3, 0) is real.infinity);
writeln(gammaIncompleteComplInverse(4, 1)); // 0

Authors

Stephen L. Moshier (original C code). Conversion to D by Don Clugston

License

Boost License 1.0.