Fisher F complemented quantile fails for two upper-tail probabilities
维护者通常 1 天内回复
评估
调研方向
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';
}
}
}
I will open a PR for it myself.
- 主要语言
- C++
- 星标
- 382
- 派生
- 274
- 平均合并
- 21 小时 14 分钟
- 30 天内合并 PR
- 51
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/math 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
Feature Wishlist未关闭enhancement
难度 5/5 一周以上 新手友好度 20/100
维护者通常 1 天内回复
相似的 Issue
-
agent:WSL code-review linux pri:medium refactoring
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
kind/enhancement
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
psi29a/d2decomped#691 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
CachyOS/packageinstaller#144 ·
维护者通常 1 天内回复
-
(S1 - Need confirmation)
难度 2/5 1-3 小时 新手友好度 62/100
CleverRaven/Cataclysm-DDA#89715 ·
维护者通常 1 天内回复