add sincos function

オープン
#3,082 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
backend

調査の方向性

まず、issue にリンクされている fastmath.jl の Julia 実装を読み、Stan Math がスカラーおよび複素数の数学関数をどのように公開しているかを確認します。LLVM ベースの実装が求められているかを明確にし、入力型に一致するタプルを返す 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時間
マージ済み PR(30日)
13

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

stan-dev/math のほかの issue

stan-dev/math の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。