Fisher F complemented quantile fails for two upper-tail probabilities

未关闭
#1,666 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@hector2394 已经在做这个了。

开始于 2026年11月20日。

  • #1667 来自 @hector2394 —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
15/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
cpp
领域
backend

调研方向

The reproducer calls quantile(complement(...)) on fisher_f_distribution<double, Policy> with promotion disabled. Start by running the provided C++17 example against the Boost.Math include directory and compare both results with the stated reference values. Done means the first probability returns approximately 5.272596610651114e306 and the second overflows to positive infinity; a linked pull request is already open.

由索引模型根据 Issue 内容生成。

描述

quantile(complement(fisher_f_distribution<double>(1, 0.1), q)) gives incorrect results for two upper-tail probabilities with promotion disabled. I reproduced this on Windows x64 with MSVC in C++17 mode, using Boost.Math commit 8b9e21b41a45443d8f77ad84295b2f372c9e2c19 from SciPy’s Boost upgrade PR.

q Expected from 100-digit reference Actual
3.85e-16 5.272596610651114e306 halley_iterate<double> throws because no root was found
1e-20 +inf because the quantile exceeds the double range 4.4942328371557913e306

Compile with BOOST_MATH_STANDALONE=1 and the Boost.Math include directory on the include path.

#include <boost/math/distributions/fisher_f.hpp>
#include <boost/math/policies/policy.hpp>
#include <exception>
#include <iomanip>
#include <initializer_list>
#include <iostream>

int main() {
    using namespace boost::math;
    using Policy = policies::policy<
        policies::promote_float<false>,
        policies::promote_double<false>,
        policies::max_root_iterations<400>,
        policies::overflow_error<policies::ignore_error>>;

    const fisher_f_distribution<double, Policy> dist(1, 0.1);
    std::cout << std::setprecision(17);
    for (double q : {3.85e-16, 1e-20}) {
        try {
            const double x = quantile(complement(dist, q));
            std::cout << q << " -> " << x << '\n';
        } catch (const std::exception& e) {
            std::cout << q << " -> " << e.what() << '\n';
        }
    }
}

Related SciPy discussion

I will open a PR for it myself.

主要语言
C++
星标
382
派生
274
平均合并
21 小时 14 分钟
30 天内合并 PR
51

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

boostorg/math 的其他 Issue

查看 boostorg/math 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。