Learn R Programming

limma (version 3.28.14)

logcosh: Logarithm of cosh

Description

Compute log(cosh(x)) without floating overflow or underflow

Usage

logcosh(x)

Arguments

x
a numeric vector or matrix.

Value

x.

Details

The computation uses asymptotic expressions for very large or very small arguments. For intermediate arguments, log(cosh(x)) is returned.

Examples

Run this code
x <- c(1e-8,1e-7,1e-6,1e-5,1e-4,1,3,50,800)
logcosh(x)
log(cosh(x))

Run the code above in your browser using DataLab