Skip to content

add cospi(), sinpi(), tanpi() #2376

Open
@spinkney

Description

@spinkney

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions