Skip to content

Commit 7ca4f31

Browse files
committed
Get more digits :)
1 parent c3fcc96 commit 7ca4f31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc3/math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def log1mexp(x):
226226
For details, see
227227
https://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf
228228
"""
229-
return tt.switch(tt.lt(x, 0.693147), tt.log(-tt.expm1(-x)), tt.log1p(-tt.exp(-x)))
229+
return tt.switch(tt.lt(x, 0.6931471805599453), tt.log(-tt.expm1(-x)), tt.log1p(-tt.exp(-x)))
230230

231231

232232
def log1mexp_numpy(x):
@@ -235,7 +235,7 @@ def log1mexp_numpy(x):
235235
For details, see
236236
https://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf
237237
"""
238-
return np.where(x < 0.693147, np.log(-np.expm1(-x)), np.log1p(-np.exp(-x)))
238+
return np.where(x < 0.6931471805599453, np.log(-np.expm1(-x)), np.log1p(-np.exp(-x)))
239239

240240

241241
def flatten_list(tensors):

0 commit comments

Comments
 (0)