Computer Science ›› 2025, Vol. 52 ›› Issue (6A): 240800070-8.doi: 10.11896/jsjkx.240800070

• Computer Software & Architecture • Previous Articles     Next Articles

CNFED:An Error Detection Tool for Floating-point Expressions Based on Condition Number

WANG Panlong1, WANG Lei1, YING Jinrui1, LIU Bowen1, GAO Zhiyong2   

  1. 1 School of Cyberspace Security,Zhongyuan University of Technology,Zhengzhou 450007,China
    2 School of Computer and Artificial Intelligence,School of Software,Zhengzhou University,Zhengzhou 450001,China
  • Online:2025-06-16 Published:2025-06-12
  • About author:WANG Panlong,born in 2000,postgra-duate.His main research interests include high performance computing and so on.
    WANG Lei,born in 1977,professor,is a member of CCF(No.12516M).His main research interests include research and development of highperformance computing and domestic independent and controlable basic software.
  • Supported by:
    Research and Development of Basic Mathematical Library Software Based on High-Performance Computing(22001742).

Abstract: Floating-point numbers use finite precision to represent real numbers,and their inherent rounding errors can accumulate during calculations,potentially leading to serious errors that jeopardize program safety and reliability.Theoretically,the most precise method for detecting floating-point errors is exhaustive search of all possible floating-point inputs to determine the maximum error between actual computation results and theoretical values.However,the search space is enormous.Effectively and efficiently detecting maximum floating-point errors has been a challenge.Based on the study on condition numbers,a tool for floating-point expression error detection,CNFED,has been designed and implemented.CNFED divides the input interval into multiple sub-intervals,conducts random sampling and evaluation for each sub-interval to quickly locate multiple hotspot sub-intervals.It then hierarchically applies global and local search algorithms to these hotspot sub-intervals,using corresponding evaluation functions for filtering,ultimately identifying potential maximum floating-point errors and reporting the corresponding input values.Experiment selects 26 expressions from the FPBench standard test suite as test cases and compare CNFED with advanced detection tools ATOMU and HSED.The experimental results indicate that CNFED outperforms ATOMU in 96.15% of cases(25/26).Compared to the detection tool HSED for floating-point expressions,CNFED surpasses HSED in 34.62% of cases(9/26),while the average time taken by HSED is 4.8 times that of CNFED.

Key words: Error detection, Floating-point arithmetic, Condition number, Dynamic analysis, Hierarchical search

CLC Number: 

  • TP311
[1]XIAO A X,ZHANG S X,TANG E Y,et al.An empirical library-guided floating-point program optimization acceleration strategy [J].Chinese Journal of Computers,2022,45(9):2014-2028.
[2]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.
[3]NETHERCOTE N,SEWARD J.Valgrind:a framework forheavy weight dynamic binary ins-trumentation[J].SIGPLAN Not,2007,42(6):89-100.
[4]BENZ F,HILDEBRANDT A,HACK S.2012.A dynamic program analysis to find floating-point accuracy problems[J].SIGPLAN Not,2012,47(6):453-462.
[5]ZOU D,WANG R,XIONG Y,et al.AG-enetic Algorithm forDetecting Significant Floating-Point Inaccuracies[C]//2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.Florence,Italy,2015:529-539.
[6]SANCHEZ-STERN A,PANCHEKHA P,LERNER S,et al.Finding root causes of floating point error[C]//Proceedings of the 39th ACMSIGPLAN Conference on Programming Language Design and Implementation(PLDI 2018).Association for Computing Machinery,New York,NY,USA,2018:256-269.
[7]PANCHEKHA P,SANCHEZ-STERN A,WILCOX J R,et al.Automatically improving accuracy for floating point expressions[J].SIGPLAN Not,2015,50(6):1-11.
[8]ZOU D,ZENG M,XIONG Y,et al.Detecting floating-point errors via atomic conditions[C]//Proceedings of the ACM on Programming Languages(POPL).2020.
[9]CHIANG W F,GOPALAKRISHNAN G,RAKAMARIC Z,et al.Efficient search for inputs causing high floating-point errors[J].SIGPLAN Not,2014,49(8):43-52.
[10]YI X,CHEN L,MAO X,et al.Efficient automated repair of high floating-point errorsin numerical libraries[C]//Proceedings of the ACM on Programming Languages(POPL).2019.
[11]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).Japan,2022:397-406.
[12]ZHANG Z,XU J,HAO J,et al.Hierarchical search algorithm for error detection in floating-point arithmetic expressions[J].J Super Comput,2024,80:1183-1205.
[13]COUSOT P,COUSOT R..Abstract interpretation:past,pre-sent 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)(CSL-LICS’14).Association for Computing Machinery,New York,NY,USA,2004:1-10.
[14]HICKEY T,JU Q,VAN EMDEN M H.Interval arithmetic:From principles to implementation[J].J.ACM,2001,48(5):1038-1068.
[15]BALDONI R,COPPA E,D’ELIA D C,et al.A Survey of Symbolic Execution Techniques[C]//ACM Computing Surveys.2018:39.
[16]IEEE Computer Society.IEEE Standard for Floating-PointArithmetic:IEEE Std 754-2008[S].Piscataway,NJ:IEEE,2008:1-70.
[17]LEE W,SHARMA R,AIKEN A.On automatically proving the correctness of math.h implementations[C]// Proc.ACM Program.Lang.,2017:247:1-47:32.
[18]GOLDBERG D.What every computer scientist should knowabout floating-point arithmetic[J]ACM Computing Surveys,1991,23(1):5-48.
[19]HIGHAM N J.Accuracy and stability of numerical algorithms(2.ed.)[M].SIAM,2002.
[20]KLINE M.Calculus:an intuitive and physical approach[J].Courier Corporation,1998.
[21]FU Z,BAI Z,SU Z.Automated back ward error analysis for nu-merical code[J].SIGPLAN Not.,2015,50(10):639-654.
[22]BAO T,ZHANG X.On-the-fly detectionofinstability 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.
[1] YAN Rui, CHEN Zhe. Dynamic Analysis Method for Memory Safety of Multithreaded C Programs [J]. Computer Science, 2024, 51(6A): 230900115-6.
[2] MA Yingzi, CHEN Zhe, YIN Jiale, MAO Ruiqi. Memory Security Vulnerability Detection Combining Fuzzy Testing and Dynamic Analysis [J]. Computer Science, 2024, 51(2): 352-358.
[3] ZHONG Kai, GUO Chun, LI Xianchao, SHEN Guowei. Cryptomining Malware Early Detection Method Based on SDR [J]. Computer Science, 2024, 51(12): 303-309.
[4] JIN Jiexi, XIE Hehu, DU Peibing, QUAN Zhe, JIANG Hao. QR Decomposition Based on Double-double Precision Gram-Schmidt Orthogonalization Method [J]. Computer Science, 2023, 50(6): 45-51.
[5] DING Xuhui, ZHANG Linlin, ZHAO Kai, WANG Xusheng. Android Application Privacy Disclosure Detection Method Based on Static and Dynamic Combination [J]. Computer Science, 2023, 50(10): 327-335.
[6] ZHAO Jing-wen, FU Yan, WU Yan-xia, CHEN Jun-wen, FENG Yun, DONG Ji-bin, LIU Jia-qi. Survey on Multithreaded Data Race Detection Techniques [J]. Computer Science, 2022, 49(6): 89-98.
[7] ZHANG Zhou, ZHU Jun-guo, YU Zheng-tao. Incorporating Part of Speech and Tonal Features for Vietnamese Grammatical Error Detection [J]. Computer Science, 2022, 49(11): 221-227.
[8] LV Zhao-jin, SHEN Li-wei and ZHAO Wen-yun. Scenario-oriented Location Method of Android Applications [J]. Computer Science, 2017, 44(2): 216-221.
[9] GONG Wei-gang, YOU Wei, LI Zan, SHI Wen-chang and LIANG Bin. JavaScript Counterfactual Execution Method Based on Dynamic Instrumentation [J]. Computer Science, 2017, 44(11): 22-26.
[10] ZHANG Guang-mei and LI Jing-xia. Data-flow Analysis for Software Error Detection [J]. Computer Science, 2016, 43(Z6): 497-501.
[11] NING Zhuo, HU Ting and SUN Zhi-xin. Security Survey on Android Application Based on Dynamic Analysis [J]. Computer Science, 2016, 43(Z11): 324-328.
[12] ZHANG Guo-yin, QU Jia-xing, FU Xiao-jing and HE Zhi-chang. Android Malicious Behavior Detection Method Based on Composite-event Trigged Behaviors [J]. Computer Science, 2016, 43(5): 96-99.
[13] LIU Peng, ZHAO Rong-cai and LI Peng-yuan. Dynamic Pointer Alias Analysis Framework for Vectorization [J]. Computer Science, 2015, 42(3): 26-30.
[14] . Exploring Multiple Execution Paths Based on Execution Path Driven [J]. Computer Science, 2013, 40(2): 145-147.
[15] . Malware Detection Model Based on the Sandbox [J]. Computer Science, 2012, 39(Z6): 12-14.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!