Cosine rounding failure on macOS
まだ誰も着手していません。
評価
調査の方向性
まず Apple Clang で最小限の C++ 再現コードをコンパイルして実行し、その後 rounded_transc_std と rounded_transc_exact を比較します。boost/numeric/interval.hpp を通じて到達する区間実装と、その超越関数の丸めポリシーを読みます。Clang で cosine が境界の順序が正しい空でない区間を生成し、報告されている GCC の動作を維持できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I am running into issues with the interval library when compiling with Clang. This is the simple failure case:
#include <iomanip>
#include <iostream>
#include <boost/numeric/interval.hpp>
typedef boost::numeric::interval<
double,
boost::numeric::interval_lib::policies<
boost::numeric::interval_lib::save_state<
boost::numeric::interval_lib::rounded_transc_std<double> >,
boost::numeric::interval_lib::checking_base<double> > >
Interval;
int main(int argc, char* argv[])
{
Interval theta = Interval(0.79358805865013693);
Interval output = cos(theta);
std::cout << std::setprecision(std::numeric_limits<double>::digits10 + 1)
<< "[" << output.lower() << ", " << output.upper() << "]"
<< std::endl;
std::cout << "is empty: "
<< (output.lower() > output.upper() ? "true" : "false")
<< std::endl;
}
The output when compiled with clang is:
[0.7012920012119436, 0.7012920012119435]
is empty: true
You can see that the last digit was rounded improperly resulting in an empty interval. If I try the same case but use rounded_transc_exact for the rounding policy It works as expected:
[0.7012920012119437, 0.7012920012119437]
is empty: false
My compiler info is
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
and the example is compiled in debug mode. The examples works fine on GCC (specifically I tested on gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008)
Is this an expected failure for Clang?
- 主要言語
- C++
- スター
- 31
- フォーク
- 48
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/interval のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
boostorg/interval の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
メンテナーはふだん 1 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CleverRaven/Cataclysm-DDA#89159 ·
メンテナーはふだん 1 日以内に返信
-
area:libnvmpi bug P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gjrtimmer/jetson-nvmpi#33 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
bug(wasi_crypto): ArrayOutput::pull reports the wrong all-pulled flag対応中かも @Yashbhu が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信