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)
See also
Boost Documentation) for more details on the mathematical background.
Examples
# sin(pi * 0.5)
sin_pi(0.5)
#> [1] 1
# cos(pi * 0.5)
cos_pi(0.5)
#> [1] 0
# log(1 + 0.5)
log1p_boost(0.5)
#> [1] 0.4054651
# exp(0.5) - 1
expm1_boost(0.5)
#> [1] 0.6487213
cbrt(8)
#> [1] 2
# sqrt(1 + 0.5) - 1
sqrt1pm1(0.5)
#> [1] 0.2247449
# 2^3 - 1
powm1(2, 3)
#> [1] 7
hypot(3, 4)
#> [1] 5
rsqrt(4)
#> [1] 0.5