相对误差和摆动 [英] Relative error and wobble

查看:95
本文介绍了相对误差和摆动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下内容的完整内容在每位计算机科学家都应了解的浮点运算法则.在下文中,通常,当基数为b时,以ulps表示的固定相对误差可能会波动高达b的因数."

The full context of the below is on page 8 of What Every Computer Scientist Should Know About Floating-Point Arithmetic. In the below it is stated "In general, when the base is b, a fixed relative error expressed in ulps can wobble by a factor of up to b."

有人可以提供详细的证明吗?并且,以ulps表示的固定的相对误差可能会以高达b的因数摆动"确切地表示什么.如果相对错误是固定的,那么如何摆动或更改?

Can someone give a detailed proof of this? And what exactly does it mean by "a fixed relative error expressed in ulps can wobble by a factor of up to b."; if the relative error is fixed then how can it wobble or change?

相对误差始终以e为边界,这被称为机器epsilon.

the relative error is always bounded by e, which is referred to as machine epsilon.

...

以说明两者之间的区别 肿块和相对误差,考虑真实 数x = 12.35.近似 通过 = 1.24 x 10 ^ 1.误差为0.5 ulps;这 相对误差为0.8 e.接下来考虑 计算 8倍精确值为8 x = 98.8,而计算值是8 = 9.92 x 10 ^ 1.现在的错误是4.0 ulps, 但是相对 误差仍为0.8 e.这 单位为ulps的误差是八倍 即使相对误差为 相同.通常,当底数为b时, 固定亲戚 以ulps表示的错误 最多可以摆动b倍.相反,如等式. (2)显示,固定误差为 1/2 ulps导致相对误差 可以按b摇摆.

To illustrate the difference between ulps and relative error, consider the real number x = 12.35. It is approximated by = 1.24 x 10^1. The error is 0.5 ulps; the relative error is 0.8 e. Next consider the computation 8x. The exact value is 8 x = 98.8, whereas, the computed value is 8 = 9.92 x 10^1. The error is now 4.0 ulps, but the relative error is still 0.8 e. The error measured in ulps is eight times larger, even though the relative error is the same. In general, when the base is b, a fixed relative error expressed in ulps can wobble by a factor of up to b. Conversely, as eq. (2) shows, a fixed error of 1/2 ulps results in a relative error that can wobble by b.

推荐答案

在与您提供的引号相同的页面上,在通常,当基数为b时,用小瘤最多可摆动b倍."

It is demonstrated on the same page as the quotes you give, in the paragraph before "In general, when the base is b, a fixed relative error expressed in ulps can wobble by a factor of up to b."

该段解释了从1.0000…0•b e 到d.dddd…d•b e 的数字,其中d是,正如我在此处使用的那样,数字b-1具有相同的ULP,因为ULP是最后一位的值,并且最后一位的值由b的指数(以及有效位数的位数确定),而b的位数是固定的.格式).

That paragraph explains that numbers from 1.0000…0 • be to d.dddd…d • be, where d is, as I use it here, the digit b-1, have the same ULP, because the ULP is the value of the last digit, and that value of the last digit is determined by the exponent of b (and the number of digits in the significand, which is fixed for the format).

这些数字的比率(几乎)为b,因为d.dddd…d几乎为b,所以d.dddd…d/1几乎为b.但是它们具有相同的ULP.因此,一个ULP 相对的数量级与b之比.

These numbers span a ratio of (almost) b, because d.dddd…d is almost b, so d.dddd…d / 1 is almost b. But they have the same ULP. Therefore, the magnitude of one ULP relative to the number spans a ratio of b.

< p>以ulps表示的固定的相对误差可能会波动高达b"的含义是什么?如果相对误差是固定的,那么它将如何摆动或变化?

And what exactly does it mean by "a fixed relative error expressed in ulps can wobble by a factor of up to b."; if the relative error is fixed then how can it wobble or change?

据说该错误是固定数量的ULP.但是相对于浮点值,ULP的值不是固定的或恒定的.

The error is said to be a fixed number of ULP. But the value of an ULP is not fixed or constant truly fixed or constant relative to floating-point values.

这里只是一个语言问题.将ULP称为固定相对误差"是不准确的.但是,人们有时会在ULP中表达误差范围或误差量,因为浮点会量化值,而这些量子就是ULP.

There is just a language issue here. It is not accurate to speak of an ULP as a "fixed relative error". However, people sometimes express error bounds or error amounts in ULPs because the nature of floating-point quantizes values, and those quanta are ULPs.

ULP 大约是相对错误.在浮点格式的整个范围内,它都保持在相同的范围内.考虑一个三位数的十进制格式:

ULP is approximately a relative error. It stays in the same range throughout the entire scale of a floating-point format. Consider a three-digit decimal format:

  • 在1.00到9.99之间的间隔中,ULP的绝对值为.005.相对于间隔中的数字的值,范围从.005到(几乎).0005.
  • 在1,000,000到990万之间,ULP的绝对值为5,000.相对于间隔中的数字的值,范围从.005到(几乎).0005.
  • 从1.00•10 -100 到9.99•10 -100 的时间间隔,ULP的绝对值为.005•10 -100 .相对于间隔中的数字的值,范围从.005到(几乎).0005.
  • In the interval from 1.00 to 9.99, the absolute value of the ULP is .005. Its value relative to numbers in the interval ranges from .005 to (almost) .0005.
  • In the interval from 1,000,000 to 9,990,000, the absolute value of the ULP is 5,000. Its value relative to numbers in the interval ranges from .005 to (almost) .0005.
  • In the interval from 1.00•10-100 to 9.99•10-100, the absolute value of the ULP is .005•10-100. Its value relative to numbers in the interval ranges from .005 to (almost) .0005.

如您所见,相对于浮点数的ULP值始终保持在很小的间隔内.因此,它可以作为相对误差的近似值.

As you see, the value of the ULP relative to floating-point numbers always stays within a small interval. Thus, it serves as an approximation of a relative error.

我们的浮点算术相对误差的表达式摆动b倍的事实来自两个数学事实:

The fact that our expressions of relative errors in floating-point arithmetic wobble by a factor of b comes from two mathematical facts:

  • 使用浮点算法并计算或得出有关可能发生的错误的证明时,您会发现自己以ULP为单位表达错误,因为浮点格式的量化会导致界限位于ULP中或半ULP.
  • 对于浮点值x,x的ULP值除以x会改变b,因为x在浮点格式的单个指数间隔内改变.当指数改变时,ULP(x)/x值将重置.
  • When you work with floating-point arithmetic and calculate or derive a proof about the errors that may occur, you will find yourself expressing errors in units of ULP, because the quantization of the floating-point format causes bounds to be in ULPs or half-ULPs.
  • For floating-point values x, the value of an ULP of x divided by x changes by a factor of b as x changes within a single exponent interval of the floating-point format. When the exponent changes, the value ULP(x)/x resets.

这篇关于相对误差和摆动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆