Reasoning about floating-point arithmetic is notoriously hard. While static and dynamic analysis techniques or program repair have made significant progress, more work is still needed to make them relevant to real-world code. On the critical path to that goal is understanding what real-world floating-point code looks like. To close that knowledge gap, this paper presents the first large-scale empirical study of floating-point arithmetic usage across public GitHub repositories. We focus on statically typed languages to allow our study to scale to millions of repositories. We follow state-of the art mining practices including random sampling and filtering based on only intrinsic properties to avoid bias, and identify floating-point usage by searching for keywords in the source code, and programming language constructs (e.g., loops) by parsing the code. Our evaluation supports the claim often made in papers that floating-point arithmetic is widely used. Comparing statistics such as size and usage of certain constructs and functions, we find that benchmarks used in literature to evaluate automated reasoning techniques for floating-point arithmetic are in certain aspects representative of 'real-world' code, but not in all. We publish a dataset of 10 million real-world floating-point functions extracted from our study. We demonstrate in a case study how it may be used to identify new floating-point benchmarks and help future techniques for floating-point arithmetic to be designed and evaluated to match actual users' expectations.


翻译:浮点运算的推理众所周知是困难的。尽管静态与动态分析技术或程序修复已取得显著进展,但要使这些技术适用于实际代码仍需要更多工作。实现该目标的关键路径在于理解真实世界中的浮点代码究竟是什么样的。为填补这一知识空白,本文首次对公开 GitHub 仓库中的浮点运算使用情况进行了大规模实证研究。我们聚焦于静态类型语言,以使研究能够扩展到数百万个仓库。我们遵循最先进的挖掘实践,包括随机抽样和仅基于内在属性的过滤以避免偏差,并通过在源代码中搜索关键词来识别浮点数的使用,同时通过解析代码来识别编程语言结构(例如循环)。我们的评估支持了论文中经常提出的主张,即浮点运算被广泛使用。通过比较代码规模、特定结构和函数的使用情况等统计数据,我们发现文献中用于评估浮点运算自动推理技术的基准测试在某些方面能代表“真实世界”代码,但并非在所有方面都能代表。我们发布了从研究中提取的 1000 万个真实世界浮点函数的数据集。我们通过一个案例研究展示了如何利用该数据集识别新的浮点基准测试,并帮助未来的浮点运算技术得以设计和评估,以符合实际用户的期望。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【牛津大学博士论文】学习理解大规模3D点云,191页pdf
专知会员服务
38+阅读 · 2023年6月22日
专知会员服务
30+阅读 · 2020年9月21日
【经典书】算法C语言实现,Algorithms in C. 672页pdf
专知会员服务
82+阅读 · 2020年8月13日
【泡泡点云时空】PointConv: 3D点云的深度卷积网络
泡泡机器人SLAM
23+阅读 · 2019年6月12日
【泡泡点云时空】Potree:基于Web浏览器的大规模点云渲染
PointNet系列论文解读
人工智能前沿讲习班
17+阅读 · 2019年5月3日
CVPR 2019 | PointConv:在点云上高效实现卷积操作
机器之心
10+阅读 · 2019年4月21日
GitHub获赞过千:PyTorch 自然语言处理项目Top 5
新智元
12+阅读 · 2018年7月10日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
VIP会员
最新内容
学习数据的几何:形状空间分析数学综述
专知会员服务
7+阅读 · 6月17日
定向能反无人机系统最新发展动态
专知会员服务
8+阅读 · 6月17日
从燃煤战舰到算法战争:水面指挥的永恒要求
专知会员服务
6+阅读 · 6月17日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员