add sincos function

未關閉
#3,082 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
25/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
cpp
領域
backend

研究方向

先閱讀 issue 中連結的 fastmath.jl Julia 實作,並檢視 Stan Math 如何提供純量與複數數學函式。釐清是否需要以 LLVM 為基礎的實作,然後將完成定義為:實作一個回傳與輸入型別相符之 tuple 的 sincos 函式,其中複數輸入使用分開的正弦與餘弦計算。

由索引模型根據 Issue 內容生成。

描述

good first issue

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.

主要語言
C++
星號
845
分支
225
平均合併
4 天 21 小時
30 天內合併 PR
13

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

stan-dev/math 的其他 Issue

查看 stan-dev/math 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。