823906a3efcf66897eac8a4c89052d9153bca49e,pymc3/math.py,,log1mexp_numpy,#Any#,240

Before Change


    For details, see
    https://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf
    
    return np.where(x < 0.6931471805599453, np.log(-np.expm1(-x)), np.log1p(-np.exp(-x)))


def flatten_list(tensors):

After Change


    For details, see
    https://cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf
    
    x = np.asarray(x)
    out = np.empty_like(x)
    mask = x < 0.6931471805599453  // log(2)
    out[mask] = np.log(-np.expm1(-x[mask]))
    mask = ~mask
    out[mask] = np.log1p(-np.exp(-x[mask]))
    return out
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pymc-devs/pymc3
Commit Name: 823906a3efcf66897eac8a4c89052d9153bca49e
Time: 2021-01-22
Author: 28983449+ricardoV94@users.noreply.github.com
File Name: pymc3/math.py
Class Name:
Method Name: log1mexp_numpy


Project Name: statsmodels/statsmodels
Commit Name: f8cf06797ad15a3f6f5be203ed3514ee8dc7cbe4
Time: 2021-01-20
Author: josef.pktd@gmail.com
File Name: statsmodels/sandbox/distributions/copula.py
Class Name: TransfFrank
Method Name: deriv2


Project Name: keras-team/keras
Commit Name: 01d5e7bc4782daafcfa99e035c1bdbe13a985145
Time: 2016-07-16
Author: francois.chollet@gmail.com
File Name: examples/lstm_text_generation.py
Class Name:
Method Name: sample