hypergeometric_0F1 loses about 20 ulps for b = 1.5 and −10 < z < 0

クローズ
#1,612 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

関連するプルリクエストがすでにマージされています。

  • #1618 @NAThompson による — マージ済み

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
22/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
backend

調査の方向性

Start with boost/math/special_functions/hypergeometric_0F1.hpp, which the reproducer includes, and compare the Taylor series branch (-5 <= z < 0) with the Bessel relation branch (z < -5). Build the reproducer, print the three listed values, and check them against sin(2√−z)/(2√−z). Done means the error on -10 < z < 0 falls under the ulp bounds the report gives for other ranges. Expect numerical analysis work, not a one-line edit.

索引モデルが issue の本文から書いたものです。

説明

For b = 3/2 and z < 0, 0F1(; 3/2; z) = sin(2√−z) / (2√−z), so the correct values are easy to check:

#include <boost/math/special_functions/hypergeometric_0F1.hpp>
#include <cstdio>

int main()
{
   for (double z : {-3.1499999999999986, -4.5625, -6.0})
   {
      std::printf("%.17g\n", boost::math::hypergeometric_0F1(1.5, z));
   }
}
z Boost correctly rounded error condition number |z f′/f|
−3.1499999999999986 −0.11179277162022014 −0.11179277162022051 +27.2 ulps 3.6
−4.5625 −0.21174773278219308 −0.2117477327821936 +19.2 ulps 0.51
−6 −0.20058104804562102 −0.20058104804562038 −23.4 ulps 0.96

Over 2001 points on [−20, 5], at points with condition number below 4 the error is under 3.5 ulps for z > 0 and under 7.2 ulps for z < −10, but up to 27.2 ulps on −10 < z < 0. Both branches used there show it: the Taylor series (−5 ≤ z < 0) and the Bessel relation (z < −5). Same function as #1538, which #1547 closed.

Apple clang -O2 on arm64 at develop b8c1f01dd; an Emscripten (WebAssembly) build gives the same errors.

主要言語
C++
スター
378
フォーク
271
平均マージ
12時間 37分
マージ済み PR(30日)
66

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

boostorg/math のほかの issue

boostorg/math の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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