add sincos function
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 839
- Forks
- 220
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 14
Description
Neither boost nor Eigen has a sincos function however Julia has a succinct implementation in C at https://github.com/JuliaLang/julia/blob/eabd0212ed974b7128ec77180424090edb4a6d04/base/fastmath.jl#L299. The code is MIT license that is compatible with ours.
A few questions:
- Is it possible to add llvm code like this?
- Do we want to?
The output from this function will be a tuple of whatever the input type was. So if the input is a real the output will be a tuple of reals. If the input is complex then this falls back to calculating sin and cos separately and returning a tuple of complex types.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Julia fastmath.jl implementation linked in the issue and reviewing how Stan Math exposes scalar and complex math functions. Clarify whether an LLVM-based implementation is wanted, then define completion as a sincos function returning a tuple matching the input type, with complex inputs using separate sine and cosine calculations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100