计算机科学 ›› 2026, Vol. 53 ›› Issue (10): 367-375.doi: 10.11896/jsjkx.250700073
牛梦锦, 王磊, 张旭林, 梁军达
NIU Mengjin, WANG Lei, ZHANG Xulin, LIANG Junda
摘要: 计算机用有限的二进制位表示实数,其固有的舍入误差在计算过程中可能会造成累积,在某些情况下,还会导致严重的错误。检测浮点误差对于确保程序正确输出至关重要。理论上,检测浮点误差最准确的方法是穷举搜索所有可能的浮点输入,但由于搜索空间巨大,该方法在实践中是不可行的。而浮点误差具有稀疏性,只有有限数量的输入值会导致严重的错误,如何有效地检测这些输入并选择合适的搜索技术,对于检测最大浮点误差是一项艰巨的挑战。为了应对这一挑战,基于分层搜索与分区间分析,设计并实现了一种针对浮点表达式进行误差检测的工具HSIBA。HSIBA修改双精度浮点数的尾数部分,通过模拟不同精度进行分层搜索结合分区间分析,检测可能的浮点误差极大值及对应的输入并报告。从FPBench标准测试集中选取28个表达式作为测试用例,并将HSIBA与先进检测工具PSOED和ATOMU进行对比。实验结果中,HSIBA有16个测试用例的检测效果优于PSOED,有20个测试用例的检测效果优于ATOMU。同时,PSOED耗费的平均时间是HSIBA的3.15倍,而HSIBA的性能不如ATOMU。
中图分类号:
| [1] QI H,XU J,GUO S.Detection of the maximum error of mathematical functions[J].The Journal of Supercomputing,2018,74(11):6275-6290. [2] XIAO A X,ZHANG S X,TANG E Y,et al.An empirical libra-ry-guided floating-point program optimization acceleration strategy[J].Chinese Journal of Computers,2022,45(9):2014-2028. [3] HAO J W,YANG H R,XIA Y Y,et al.A floating-point expression precision optimization method based on multiple types of computation rewriting[J].Computer Science,2024,51(4):86-94. [4] 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. [5] 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.2014:43-52. [6] YI X,CHEN L,MAO X,et al.Efficient automated repair ofhigh floating-point errors in numerical libraries[C]//Procee-dings of the ACM on Programming Languages(POPL).2019. [7] WANG Z,YI X,YU H,et al.Detecting High Floating-Point Errors via Ranking Analysis[C]//2022 29th Asia-Pacific Software Engineering Conference(APSEC).2022:397-406. [8] YAND H,XU J,HAO J,et al.Detecting Floating-Point Ex-pression Errors Based Improved PSO Algorithm[J].IET Software,2023,2023(1):6681267. [9] POLI R,KENNEDY J,BLACKWELL T.Particle swarm optimization:An overview[J].Swarm Intelligence,2007,1:33-57. [10] MULLER J M,BRUNIE N,DE DINECHIN F,et al.Handbook of floating-point arithmetic[M].Basel,Switzerland:Birkhäuser,2018. [11] IEEE Computer Society.IEEE Standard for Floating Point Arithmetic:IEEE Std 754-2008[S].Piscataway,NJ:IEEE,2008:1-70. [12] MULLER J M.On the definition of ulp(x)[R].Montbonnot,Saint Martin,France:Laboratoire de l’Informatique du Parallélisme,2005. [13] GOLDBERG D.What every computer scientist should know about floating-point arithmetic[J].ACM Computing Surveys,1991,23(1):5-48. [14] BAO T,ZHANG X.On-the-fly detection of instability problems in floating-point program execution[C]//Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages &Applications(OOPSLA).2013:817-832. [15] DAMOUCHE N,MARTEL M,PANCHEKHA P,et al.To-ward a Standard Benchmark Format and Suite for Floating-Point Analysis[C]//International Workshop on Numerical Software Verification.Cham:Springer International Publishing,2016:63-77. [16] ZOU D,WANG R,XIONG Y,et al.A genetic algorithm for detecting significant floating-pointinaccuracies[C]//2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.IEEE,2015:529-539. [17] BENZ F,HILDEBRANDT A,HACK S.A dynamic program analysis to find floating-point accuracy problems[J].ACM SIGPLAN Notices,2012,47(6):453-462. [18] PANCHEKHA P,SANCHEZ-STERN A,WILCOX J R,et al.Automatically improving accuracy for floating point expressions[J].ACM SIGPLAN Notices,2015,50(6):1-11. [19] GUO H,RUBIO-GONZÁLEZ C.Efficient generation of error-inducing floating-point inputs via symbolic execution[C]//Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering.2020:1261-1272. [20] COUSOTP,COUSOT R.Abstract interpretation:past,present and future[C]//Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic(CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science(LICS)(CSLLICS’14).Association for Computing Machinery,2004:1-10. [21] HICKEY T,JU Q,VAN EMDEN M H.Interval arithmetic:From principles to implementation[J].Journal of the ACM,2001,48(5):1038-1068. [22] BALDONI R,COPPA E,D’ELIAD C,et al.A Survey of Symbolic Execution Techniques[C]//ACM Computing Surveys.2018. [23] DARULOVA E,IZYCHEVA A,NASIR F,et al.Daisy-frame-work for analysis and optimization of numerical programs(Tool Paper)[C]//Tools and Algorithms for the Construction and Analysis of Systems:24th International Conference(TACAS 2018),Held as Part of the European Joint Conferences on Theory and Practice of Software(ETAPS 2018).Springer International Publishing,2018:270-287. [24] SOLOVYEV A,BARANOWSKI M S,BRIGGS I,et al.RigorousEstimation of Floating-Point Round-Off Errors with Symbolic Taylor Expansions[J].ACM Transactions on Programming Languages and Systems(TOPLAS),2018,41(1):1-39. [25] DARULOVA E,KUNCAK V.Towards a compiler for reals[J].ACM Transactions on Programming Languages and Systems(TOPLAS),2017,39(2):1-28. |
|
||