计算机科学 ›› 2026, Vol. 53 ›› Issue (6): 408-415.doi: 10.11896/jsjkx.250600214
段孟瑶, 许瑾晨, 杨鸿儒, 张嘉宁, 张涛, 李飞, 周蓓
DUAN Mengyao, XU Jinchen, YANG Hongru, ZHANG Jianing, ZHANG Tao, LI Fei, ZHOU Bei
摘要: 浮点误差是计算机科学中不可避免的问题,特别是在科学计算、金融分析等对精度要求较高的领域,误差可能会带来严重后果。该研究对浮点误差特征进行了分析,选取了4个具有代表性的测试集,构成了109个测试程序,主要研究了浮点数精度、指数和表达式类型对误差的影响,探讨了浮点误差是否存在规律。研究结果表明,浮点误差的分布存在一定的规律性,其中包括:1)对于浮点表达式,有98.46%的表达式单精度和双精度的误差分布趋势相同;2)在双参数表达式中,当两个参数之间存在乘除关系时,有86.67%的显著误差集中在两个参数的指数位呈线性关系时;3)90.91%的分式型表达式的最大误差集中在使分母趋近于零的临界点领域。通过对浮点误差特征进行研究,揭示了浮点误差的规律性,并为改进误差检测工具、优化数值计算算法以及制定更严谨的误差控制策略提供了依据。
中图分类号:
| [1]SAIKI B,FLATT O,NANDI C,et al.Combining Precision Tu-ning and Rewriting[C]//2021 IEEE 28th Symposium on Computer Arithmetic(ARITH).IEEE Computer Society,2021:1-8. [2]DAMOUCHE N,MARTEL M.Salsa:An Automatic Tool toImprove the Numerical Accuracy of Programs [J].Automated Formal Methods,2018,5:63-76. [3]QI H Y,XU J C,GUO S Z.Detection of the maximum error of mathematical functions [J].The Journal of Supercomputing,2018,74(11):6275-6290. [4]IEEE Standards Association.IEEE Standard for Floating-Point Arithmetic:IEEE Std 754-2019(Revision of IEEE 754-2008) [S].New York:Institute of Electrical and Electronics Engineers,2019. [5]LOOSEMORE S,STALLMAN R M,MCGRATH R,et al.The GNU C Library Reference Manual(Version 2.31)[EB/OL].(2019) [2025-6-23].https://www.gnu.org/software/libc/manual/2.35/html_node/Errors-in-Math-Functions.html. [6]United States General Accounting Office.Patriot Missile De-fense:Software Problem Led to System Failure at Dhahran,Saudi Arabia:GAO/IMTEC-92-26[R].Washington,DC:US Government Accountability Office,1992. [7]Wikipedia.Ariane 5 Flight 501 [EB/OL].[2025-03-15].http://en.wikipedia.org/wiki/Ariane_5_Flight_501. [8]BAGNARA R,BAGNARA A,BISELLI F,et al.Correct ap-proximation of IEEE 754 floating-point arithmetic for program verification [J].Constraints,2022,27(1/2):29-69. [9]DUTTA S,LEGUNSEN O,HUANG Z,et al.Testing probabilistic programming systems[C]//Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Confe-rence and Symposium on the Foundations of Software Enginee-ring.ACM,2018:574-586. [10]ZHANG Z,ZHOU B,HAO J,et al.Eiffel:Inferring Input Ranges of Significant Floating-point Errors via Polynomial Extrapolation[C]//2023 38th IEEE/ACM International Conference on Automated Software Engineering(ASE).IEEE Computer Society,2023:1441-1453. [11]CHERUBIN S,CATTANEO D,CHIARI M,et al.TAFFO:Tuning Assistant for Floating to Fixed Point Optimization [J].IEEE Embedded Systems Letters,2020,12(1):5-8. [12]CHOWDHARY S,NAGARAKATTE S.Fast shadow execution for debugging numerical errors using error free transformations [C]//Proceedings of the ACM on Programming Languages(PACMPL).2022:1845-1872. [13]YI X,CHEN L Q,MAO X G,et al.Efficient automated repair of high floating-point errors in numerical libraries [C]//Procee-dings of the ACM Programming Languages.2019:1-29. [14]YI X,YU H,CHEN L,et al.FPCC:Detecting Floating-Point Errors via Chain Conditions [C]//Proceedings of the ACM on Programming Languages(PACMPL).2024:324:1-324:28. [15]YANG H R,XU J C,HAO J W,et al.Detecting Floating-Point Expression Errors Based Improved PSO Algorithm [J/OL].IET Software,2023.http://doi.org/10.1049/2023/6681267. [16]DAMOUCHE N,MARTEL M,PANCHEKHA P,et al.To-ward a Standard Benchmark Format and Suite for Floating-Point Analysis[C]//Numerical Software Verification.Springer,2017:63-77. [17]PANCHEKHA P,SANCHEZ-STERN A,WILCOX J R,et al.Automatically improving accuracy for floating point expressions[C]//Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation(PLDI 2015).ACM,2015:1-11. [18]DARULOVA E,IZYCHEVA A,NASIR F,et al.Daisy-Framework for Analysis and Optimization of Numerical Programs(Tool Paper)[C]//International Conference on Tools and Algorithms for Construction and Analysis of Systems.Springer,2018:270-287. [19]CHEVILLARD S,JOLDEŞ M,LAUTER C.Sollya:An Environment for the Development of Numerical Codes[C]//Mathematical Software(ICMS 2010).Berlin:Springer,2010:28-31. [20]ZOU D M,ZENG M H,XIONG Y F,et al.Detecting floating-point errors via atomic conditions [C]//Proceedings of the ACM on Programming Languages.2019:1-27. [21] ZOU D M,WANG R,XIONG Y F,et al.A genetic algorithm for detecting significant floating-point inaccuracies[C]//Procee-dings of the 37th International Conference on Software Enginee-ring.IEEE,2015:529-539. [22]CHIANG W F,GOPALAKRISHNAN G,RAKAMARIC Z,et al.Efficient search for inputs causing high floating-point errors[C]//Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming(PPoPP '14).ACM,2014:43-52. [23]YI X,CHEN L,MAO X,et al.Efficient Global Search for Inputs Triggering High Floating-Point Inaccuracies[C]//2017 24th Asia-Pacific Software Engineering Conference(APSEC).IEEE Computer Society,2017:11-20. [24]XU J,CUI M,LI F,et al.Arfa:An Agile Regime-Based Floa-ting-Point Optimization Approach for Rounding Errors[C]//Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis(ISSTA 2024).ACM,2024:1516-1528. |
|
||