Skip to content

Commit a377fe4

Browse files
Inline the symmetry relation
1 parent d3697a9 commit a377fe4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tensorflow_probability/python/math/special.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ def _betainc_der_continued_fraction(a, b, x, dtype, use_continued_fraction):
241241
# for x < (a - 1) / (a + b - 2). For x >= (a - 1) / (a + b - 2),
242242
# we can obtain an equivalent computation by using the symmetry
243243
# relation given here: https://dlmf.nist.gov/8.17#E4
244+
# betainc(a, b, x) = 1 - betainc(b, a, 1 - x)
244245
use_symmetry_relation = (x >= (a - one) / (a + b - two))
245246
a_orig = a
246247
a = tf.where(use_symmetry_relation, b, a)
@@ -290,7 +291,8 @@ def _betainc_der_power_series(a, b, x, dtype, use_power_series):
290291
safe_x = tf.where(use_power_series, x, half)
291292

292293
# When the condition C1 is false, we apply the symmetry relation given
293-
# here: http://dlmf.nist.gov/8.17.E4
294+
# here: https://dlmf.nist.gov/8.17#E4
295+
# betainc(a, b, x) = 1 - betainc(b, a, 1 - x)
294296
use_symmetry_relation = (safe_x >= safe_a / (safe_a + safe_b))
295297
safe_a_orig = safe_a
296298
safe_a = tf.where(use_symmetry_relation, safe_b, safe_a)

0 commit comments

Comments
 (0)