查看“︁灾难性抵消”︁的源代码
←
灾难性抵消
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{Refimprove|time=2022-06-10T13:20:53+00:00}} 在[[数值分析]]中,'''灾难性抵消'''({{Lang-en|catastrophic cancellation}})<ref name="handbook">{{Cite book|last=Muller|first=Jean-Michel|last2=Brunie|first2=Nicolas|last3=de Dinechin|first3=Florent|last4=Jeannerod|first4=Claude-Pierre|last5=Joldes|first5=Mioara|last6=Lefèvre|first6=Vincent|last7=Melquiond|first7=Guillaume|last8=Revol|first8=Nathalie|authorlink8=Nathalie Revol|last9=Torres|first9=Serge|title=Handbook of Floating-Point Arithmetic|date=2018|publisher=Birkhäuser|location=Gewerbestrasse 11, 6330 Cham, Switzerland|isbn=978-3-319-76525-9|page=102|doi=10.1007/978-3-319-76526-6|edition=2nd|url=https://doi.org/10.1007/978-3-319-76526-6|access-date=2022-06-10|archive-date=2023-04-28|archive-url=https://web.archive.org/web/20230428173828/https://link.springer.com/book/10.1007/978-3-319-76526-6|dead-url=no}}</ref><ref name="goldberg">{{Cite journal |last=Goldberg |first=David |date=March 1991 |title=What every computer scientist should know about floating-point arithmetic |url=https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html |journal=ACM Computing Surveys |location=New York, NY, United States |publisher=Association for Computing Machinery |volume=23 |issue=1 |page=5–48 |doi=10.1145/103162.103163 |issn=0360-0300 |s2cid=222008826 |access-date=2020-09-17 |archive-date=2019-03-09 |archive-url=https://web.archive.org/web/20190309030009/https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html }}</ref>是指两个大小相近的数值的近似值相减,得到的差值可能和原始数值相减得到的真实的差值有很大差异,因而近似值的差值不能用作真实值差值的近似值。 例如,如果有两个螺柱,一个长<math>L_1 = 254.5\,\text{cm}</math>,另一个长<math>L_2 = 253.5\,\text{cm}</math>,用厘米刻度的尺子测量其长度,得到的近似值为<math>\tilde L_1 = 255\,\text{cm}</math>和<math>\tilde L_2 = 253\,\text{cm}</math>。在[[逼近误差|相对误差]]方面,它们是真实长度的良好的近似值:近似值的误差小于真实长度的2%,即<math>|L_1 - \tilde L_1|/|L_1| < 2\%</math> 。 但是,如果用这些近似长度相减,则差值为<math>\tilde L_1 - \tilde L_2 = 255\,\text{cm} - 253\,\text{cm} = 2\,\text{cm}</math>,而长度之间的真实差值是<math>L_1 - L_2 = 254.5\,\text{cm} - 253.5\,\text{cm} = 1\,\text{cm}</math>。用近似值算出的差<math>2\,\text{cm}</math>,和用真实值算出的差<math>1\,\text{cm}</math>相比,偏离了100%。 即使差值计算本身是精确的,灾难性抵消仍然有可能发生,如上例所示——它不是哪种类型的运算(如[[浮点数|浮点]]运算)的属性;当输入值本身是近似值时,进行减法运算就必有灾难性抵消。实际上,根据{{Link-en|Sterbenz引理|Sterbenz lemma}},浮点运算中,当输入值足够接近时,浮点差可以精确计算——浮点减法运算本身并未引入[[捨入誤差]]。 == 形式分析 == 形式上,发生灾难性抵消是因为减法运算对邻近数值的输入是[[条件数|病态的]]:即使近似值<math>\tilde x = x (1 + \delta_x)</math>和<math>\tilde y = y (1 + \delta_y)</math>与真实值<math>x</math>和<math>y</math> 相比,[[逼近误差|相对误差]]<math>|\delta_x| = |x - \tilde x|/|x|</math>和<math>|\delta_y| = |y - \tilde y|/|y|</math>不大,近似值差<math>\tilde x - \tilde y</math>的与真实值差相对误差也会与真实值差<math>x - y</math>成反比: : <math> \begin{align} \tilde x - \tilde y &= x (1 + \delta_x) - y (1 + \delta_y) = x - y + x \delta_x - y \delta_y \\ &= x - y + (x - y) \frac{x \delta_x - y \delta_y}{x - y} \\ &= (x - y) \biggr(1 + \frac{x \delta_x - y \delta_y}{x - y}\biggr) \end{align} </math> 因此,两个近似值的精确差值<math>\tilde x - \tilde y</math>与真实数字差值<math>x - y</math>的相对误差为: : <math>\left|\frac{x \delta_x - y \delta_y}{x - y}\right|</math> 如果真实输入<math>x</math>和<math>y</math>很接近,结果可能会非常大。 ==参考文献== {{reflist}} [[Category:数值分析]]
该页面使用的模板:
Template:Cite book
(
查看源代码
)
Template:Cite journal
(
查看源代码
)
Template:Lang-en
(
查看源代码
)
Template:Link-en
(
查看源代码
)
Template:Refimprove
(
查看源代码
)
Template:Reflist
(
查看源代码
)
返回
灾难性抵消
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息