網路城邦
回本城市首頁 STORY OF CITY
市長:Story Sharing  副市長:
加入本城市推薦本城市加入我的最愛訂閱最新文章
udn城市不分類不分類【STORY OF CITY】城市/討論區/
討論區不分版 字體:
上一個討論主題 回文章列表 下一個討論主題
Floating-Point Math of Computer Systems
 瀏覽414|回應0推薦0

Story Sharing
等級:3
留言加入好友

Builders of computer systems often need information about floating-point arithmetic. There are, however, remarkably few sources of detailed information about it. One of the few books on the subject, Floating-Point Computation by Pat Sterbenz, is long out of print. This paper is a tutorial on those aspects of floating-point arithmetic (floating-point hereafter) that have a direct connection to systems building. It consists of three loosely connected parts. The first Section, "Rounding Error," on page 173, discusses the implications of using different rounding strategies for the basic operations of addition, subtraction, multiplication and division. It also contains background information on the two methods of measuring rounding error, ulps and relative error. The second part discuses the IEEE floating-point standard, which is becoming rapidly accepted by commercial hardware manufacturers. Included in the IEEE standard is the rounding method for basic operations. The discussion of the standard draws on the material in the Section , "Rounding Error," on page 173. The third part discusses the onnections between floating-point and the design of various aspects of computer systems. Topics include instruction set design, optimizing compilers and exception handling.





I have tried to avoid making statements about floating-point without also giving reasons why the statements are true, especially since the justifications involve nothing more complicated than elementary calculus. Those explanations that are not central to the main argument have been grouped into a section called "The Details," so that they can be skipped if desired. In particular, the proofs of many of the theorems appear in this section. The end of each proof is marked with the * symbol; when a proof is not included, the * appears immediately following the statement of the theorem.





Squeezing infinitely many real numbers into a finite number of bits requires an approximate representation. Although there are infinitely many integers, in most programs the result of integer computations can be stored in 32 bits. In contrast, given any fixed number of bits, most calculations with real numbers will produce quantities that cannot be exactly represented using that many bits. Therefore the result of a floating-point calculation must often be rounded in order to fit back into its finite representation. This rounding error is the characteristic feature of floating-point computation. "Relative Error and Ulps" on page 176 describes how it is measured.





Since most floating-point calculations have rounding error anyway, does it matter if the basic arithmetic operations introduce a little bit more rounding error than necessary? That question is a main theme throughout this section. "Guard Digits" on page 178 discusses guard digits, a means of reducing the error when subtracting two nearby numbers. Guard digits were considered sufficiently important by IBM that in 1968 it added a guard digit to the double precision format in the System/360 architecture (single precision already had a guard digit), and retrofitted all existing machines in the field. Two examples are given to illustrate the utility of guard digits.





The IEEE standard goes further than just requiring the use of a guard digit. It gives an algorithm for addition, subtraction, multiplication, division and square root, and requires that implementations produce the same result as that algorithm. Thus, when a program is moved from one machine to another, the results of the basic operations will be the same in every bit if both machines support the IEEE standard. This greatly simplifies the porting of programs. Other uses of this precise specification are given in "Exactly Rounded Operations" on page 185.





Many of us have come to understand that it is the powers of nature rather than spooks in the sky that drives all species to compete for survival, and realize that we must devise ways to overcome the need to compete for the earthly resources that sustain our livelihood. We now have the transportation and communication technology to govern the planet with a single administration, and could prevent the costs and sorrows of war by uniting the nations. Then we would no longer need large populations to supply us with plentiful cannon fodder, or the modern technical weaponry to defeat each other with. By eliminating the need for trade and immigration restrictions we could save still more. By offering such huge savings to the public we should, in effect, be able to bribe the masses into abandoning their attempts to gain legislated advantages over each other. By so doing, we could additionally save the enormous expense of holding periodic elections, and the high salaries and perks of the representatives that gain their support through providing the majorities with legislation that economically appeases them: ridding ourselves of the scoundrels that lead us to commit such atrocities upon each other.





Without politicians and governmental programs for the unemployable, we would have to revert back to the times where family groups cared for their own invalids and elders, and with the tax money retained, could again provide assistance or disability insurance for the truly needy. This would prevent the present welfare scams, and second generations that become accustomed to living on the dole: for relatives wouldn't continue to slave for those that were inconsiderate of them. People should be more concerned with the able bodied, and strive to prevent further deterioration of the planet's life supporting environment. As well we must use our advancing intelligence to overcome our need to compete, rather than by using our animalistic instincts to compete to the best of our ability. Avoiding remaining our own worst enemy, and providing ourselves with an environment where we are able to respect each others equality through taking the initiative to use our advancing wisdom and abilities to guide our civilization to its highest potential for all time. However, don't vote for me, I'm only trying to tell you how you should run the whole shebang. It is you that must learn to lead yourselves: rather than be led to an untimely end, like a herd of sheep. Probably we should arrange to have weekly gatherings and use modern communication devises as we do in the present, to convert us from our present national, political, and religious conflictions, to bring us to the bountifulness that a species that is one of mind and purpose can provide for itself.





The underlying causes leading to the crisis had been reported in business journals for many months before September 2008, with commentary about the financial stability of leading U.S. and European investment banks, insurance firms and mortgage banks consequent to the subprime mortgage crisis.





Beginning with failures caused by misapplication of risk controls for bad debts, collateralization of debt insurance and fraud, large financial institutions in the United States and Europe faced a credit crisis and a slowdown in economic activity. The impacts rapidly developed and spread into a global shock resulting in a number of European bank failures and declines in various stock indexes, and large reductions in the market value of equities and commodities. The credit crisis was exacerbated by Section 128 of the US Emergency Economic Stabilization Act of 2008 which allowed the Federal Reserve to pay interest on excess reserve requirement balances held on deposit from banks, removing the incentive for banks to extend credit instead of placing cash on deposit with the Fed. Moreover, the de-leveraging of financial institutions further accelerated the liquidity crisis and caused a decrease in international trade. World political leaders, national ministers of finance and central bank directors coordinated their efforts to reduce fears, but the crisis continued. At the end of October a currency crisis developed, with investors transferring vast capital resources into stronger currencies such as the yen, the dollar and the Swiss franc, leading many emergent economies to seek aid from the International Monetary Fund.









Many of us have come to understand that it is the powers of nature rather than spooks in the sky that drives all species to compete for survival, and realize that we must devise ways to overcome the need to compete for the earthly resources that sustain our livelihood. We now have the transportation and communication technology to govern the planet with a single administration, and could prevent the costs and sorrows of war by uniting the nations. Then we would no longer need large populations to supply us with plentiful cannon fodder, or the modern technical weaponry to defeat each other with. By eliminating the need for trade and immigration restrictions we could save still more. By offering such huge savings to the public we should, in effect, be able to bribe the masses into abandoning their attempts to gain legislated advantages over each other. By so doing, we could additionally save the enormous expense of holding periodic elections, and the high salaries and perks of the representatives that gain their support through providing the majorities with legislation that economically appeases them: ridding ourselves of the scoundrels that lead us to commit such atrocities upon each other.





Without politicians and governmental programs for the unemployable, we would have to revert back to the times where family groups cared for their own invalids and elders, and with the tax money retained, could again provide assistance or disability insurance for the truly needy. This would prevent the present welfare scams, and second generations that become accustomed to living on the dole: for relatives wouldn't continue to slave for those that were inconsiderate of them. People should be more concerned with the able bodied, and strive to prevent further deterioration of the planet's life supporting environment. As well we must use our advancing intelligence to overcome our need to compete, rather than by using our animalistic instincts to compete to the best of our ability. Avoiding remaining our own worst enemy, and providing ourselves with an environment where we are able to respect each others equality through taking the initiative to use our advancing wisdom and abilities to guide our civilization to its highest potential for all time. However, don't vote for me, I'm only trying to tell you how you should run the whole shebang. It is you that must learn to lead yourselves: rather than be led to an untimely end, like a herd of sheep. Probably we should arrange to have weekly gatherings and use modern communication devises as we do in the present, to convert us from our present national, political, and religious conflictions, to bring us to the bountifulness that a species that is one of mind and purpose can provide for itself.

回應 回應給此人 推薦文章 列印 加入我的文摘

引用
引用網址:https://city.udn.com/forum/trackback.jsp?no=62823&aid=3412301