已关闭
[Bug-Report|缺陷反馈]: SIMT修复bessel函数精度问题 #1637
shaonaite创建于 9月4日关闭于 9月8日
9月4日 添加了label:bug-report
9月4日 关联了pull request:修复bessel函数精度问题
9月4日 修改了issue 的描述
9月4日 修改了issue 的描述
shaonaite
9月7日 评论:
9月7日 评论:
预计9.10日前闭环


9月8日 issue状态由 待办的 改变为 已完成
9月8日 关闭了 issue
9月8日 添加了label:resolved
12 天前 删除了关联的pull request:修复bessel函数精度问题
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
SIMT Bessel 函数族(
j0f/j1f/jnf/y0f/y1f/ynf)在以下输入区间存在精度问题:1. j0f/j1f/y0f/y1f 大 x(x ≳ 4e8)输出完全错误
原
>8段用__internal_trig_red_slowpath_f_fast_mode(uint64 两步 Cody-Waite 相位规约),x > ~4e8 后a * (2/π)的 float 舍入把相位低位吃掉,fmaf(q, -π/2_hi, a)消差后相位全错,sin/cos 多项式喂入大残差 → 输出 1e22~1e28 量级垃圾值或 -inf。>1e13直接return 0放弃精度。典型数据(y0f,x ≈ 1e12):
2. ynf 小 x / subnormal 段 ULP 超标
__internal_yn_case1用powf(2/x, n)走exp(n·log(2/x))链,subnormal x 下 log 精度有限 + n 次幂放大误差,且(2/x)^n易溢出 -inf。典型数据(ynf):
3. 特殊值语义不完整
nan返回INF/INF(payload 不固定,非标准传播);+inf走 larger8 的isinf → 0,但与 golden(scipy 返回 nan)不一致;ynf对x<0返回 NaN 正确但±0语义未显式处理。Environment / 环境信息 (Mandatory / 必填)
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
同上典型数据
Describe the expected behavior / 预期结果 (Mandatory / 必填)
|x|<8走 9 ULP,|x|≥8走 atol 2.2e-6|x|<n走 ULPceil(2+2.5n),否则走 atol 2.2e-6Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
见上方典型数据表。
Special notes for this issue/备注 (Optional / 选填)
修复方案见 PR #5661:
__internal_bessel_middle_*等)