Open
Description
Stan math contains numerically stable versions of functions in error prone areas such as log1p
, I suggest wrapping Boost's implementations of cospi()
, sinpi()
, tanpi()
. These are useful when the input is a multiple of 0.5.
For example,
> stanFunction("cos", x = c(pi * 0.5, pi * 1.5)) # compiles and returns non-zero values
[1] 6.123234e-17 -1.836970e-16
> cospi(c(0.5, 1.5))
[1] 0 0