Learn R Programming

boostmath (version 1.0.0)

basic_functions: Basic Mathematical Functions

Description

Functions to compute sine, cosine, logarithm, exponential, cube root, square root, power, hypotenuse, and inverse square root.

Usage

sin_pi(x)

cos_pi(x)

log1p_boost(x)

expm1_boost(x)

cbrt(x)

sqrt1pm1(x)

powm1(x, y)

hypot(x, y)

rsqrt(x)

Value

A single numeric value with the computed result of the function.

Arguments

x

Input numeric value

y

Second input numeric value (for power and hypotenuse functions)

See Also

Boost Documentation) for more details on the mathematical background.

Examples

Run this code
# sin(pi * 0.5)
sin_pi(0.5)
# cos(pi * 0.5)
cos_pi(0.5)
# log(1 + 0.5)
log1p_boost(0.5)
# exp(0.5) - 1
expm1_boost(0.5)
cbrt(8)
# sqrt(1 + 0.5) - 1
sqrt1pm1(0.5)
# 2^3 - 1
powm1(2, 3)
hypot(3, 4)
rsqrt(4)

Run the code above in your browser using DataLab