Learn R Programming

ipd (version 0.1.4)

log1pexp: Log1p Exponential

Description

Computes the natural logarithm of 1 plus the exponential of the input, to handle large inputs.

Usage

log1pexp(x)

Value

(vector): A numeric vector where each element is the result of log(1 + exp(x)).

Arguments

x

(vector): A numeric vector of inputs.

Examples

Run this code

x <- c(-1, 0, 1, 10, 100)

log1pexp(x)

Run the code above in your browser using DataLab