Metrics icon indicating copy to clipboard operation
Metrics copied to clipboard

Use log1p(x) instead of log(1+x)

Open mllg opened this issue 6 years ago • 1 comments

log1p is numerically accurate for small x with 1 + x == 1:

x = 1e-20
log(1 + x)
log1p(x)

mllg avatar Sep 19 '19 22:09 mllg

Codecov Report

Merging #39 into master will decrease coverage by 0.06%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
- Coverage      98%   97.93%   -0.07%     
==========================================
  Files           5        5              
  Lines         100       97       -3     
==========================================
- Hits           98       95       -3     
  Misses          2        2
Impacted Files Coverage Δ
R/regression.R 100% <100%> (ø) :arrow_up:
R/information_retrieval.R 96.77% <0%> (-0.29%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ca12765...d729087. Read the comment docs.

codecov-io avatar Sep 19 '19 22:09 codecov-io