Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root

Lucas M. Dutton, Christopher Kumar Anand, Robert Enenkel, Silvia Melitta Müller
{"title":"Inexactness and Correction of Floating-Point Reciprocal, Division and Square Root","authors":"Lucas M. Dutton, Christopher Kumar Anand, Robert Enenkel, Silvia Melitta Müller","doi":"arxiv-2404.00387","DOIUrl":null,"url":null,"abstract":"Floating-point arithmetic performance determines the overall performance of\nimportant applications, from graphics to AI. Meeting the IEEE-754 specification\nfor floating-point requires that final results of addition, subtraction,\nmultiplication, division, and square root are correctly rounded based on the\nuser-selected rounding mode. A frustrating fact for implementers is that naive\nrounding methods will not produce correctly rounded results even when\nintermediate results with greater accuracy and precision are available. In\ncontrast, our novel algorithm can correct approximations of reciprocal,\ndivision and square root, even ones with slightly lower than target precision.\nIn this paper, we present a family of algorithms that can both increase the\naccuracy (and potentially the precision) of an estimate and correctly round it\naccording to all binary IEEE-754 rounding modes. We explain how it may be\nefficiently implemented in hardware, and for completeness, we present proofs\nthat it is not necessary to include equality tests associated with\nround-to-nearest-even mode for reciprocal, division and square root functions,\nbecause it is impossible for input(s) in a given precision to have exact\nanswers exactly midway between representable floating-point numbers in that\nprecision. In fact, our simpler proofs are sometimes stronger.","PeriodicalId":501256,"journal":{"name":"arXiv - CS - Mathematical Software","volume":"25 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-03-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Mathematical Software","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2404.00387","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Floating-point arithmetic performance determines the overall performance of important applications, from graphics to AI. Meeting the IEEE-754 specification for floating-point requires that final results of addition, subtraction, multiplication, division, and square root are correctly rounded based on the user-selected rounding mode. A frustrating fact for implementers is that naive rounding methods will not produce correctly rounded results even when intermediate results with greater accuracy and precision are available. In contrast, our novel algorithm can correct approximations of reciprocal, division and square root, even ones with slightly lower than target precision. In this paper, we present a family of algorithms that can both increase the accuracy (and potentially the precision) of an estimate and correctly round it according to all binary IEEE-754 rounding modes. We explain how it may be efficiently implemented in hardware, and for completeness, we present proofs that it is not necessary to include equality tests associated with round-to-nearest-even mode for reciprocal, division and square root functions, because it is impossible for input(s) in a given precision to have exact answers exactly midway between representable floating-point numbers in that precision. In fact, our simpler proofs are sometimes stronger.
浮点倒数、除法和平方根的不精确性和修正
浮点运算性能决定了从图形到人工智能等重要应用的整体性能。要满足 IEEE-754 浮点规范的要求,加法、减法、乘法、除法和平方根的最终结果必须根据用户选择的舍入模式正确舍入。一个令实施者沮丧的事实是,即使有精度和准确度更高的中间结果,传统的舍入方法也不会产生正确的舍入结果。与此相反,我们的新型算法可以修正倒数、除法和平方根的近似值,甚至可以修正精度略低于目标值的近似值。在本文中,我们提出了一系列算法,这些算法既能提高估计值的精度(也可能提高精度),又能根据所有二进制 IEEE-754 舍入模式对估计值进行正确舍入。我们解释了如何在硬件中有效地实现该算法,并且为了完整起见,我们提出了一个证明,即没有必要在倒数、除法和平方根函数中加入与舍入到最近偶数模式相关的相等检验,因为给定精度的输入不可能在该精度的可表示浮点数中间有精确的答案。事实上,我们的简单证明有时更强。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信