safe_log: Take logarithm avoiding underflow

Description Usage Arguments Value Examples

View source: R/safe_log.R

Description

Returns the normal log if there is no underflow. If there is underflow, then returns the minimum for which log can return (-744.4401)

Usage

1

Arguments

x

vector

Value

vector log in base e of input or minimum possible log value of -744.4401

Examples

1
2
log(c(1e-323, 1e-324))      # gives -Inf for the second value
safe_log(c(1e-323, 1e-324)) # gives the minimum value of -744.4401

nathanlazar/BaTFLED3D documentation built on May 23, 2019, 12:19 p.m.