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

Đã đóng
#1,612 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Một pull request liên quan đã được merge.

  • #1618 của @NAThompson — đã merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
378
Fork
271
Merge trung bình
12 giờ 37 phút
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của boostorg/math

Tất cả issue của boostorg/math

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.