tf.keras.ops.gammainc

Computes the regularized lower incomplete gamma function.

The regularized lower incomplete gamma function is defined as: P(x1, x2) = 1 / Γ(x1) * ∫₀ˣ² t^(x1 - 1) e^(-t) dt where Γ(x1) is the gamma function.

x1 A tensor containing the shape parameter.
x2 A tensor containing the upper limit of integration. Must be broadcast-compatible with x1.

A tensor containing the regularized lower incomplete gamma function evaluated elementwise.

Example:

x1 = keras.ops.convert_to_tensor([1.0, 2.0, 3.0])
x2 = keras.ops.convert_to_tensor([0.5, 1.0, 2.0])
keras.ops.gammainc(x1, x2)
array([0.39346936, 0.26424113, 0.3233236 ], dtype=float32)