- 세상의 모든 계산기 계산기 이야기
계산기 사용시 rounding errors (올림/반올림/탈락)에 의한 결과의 오류 가능성
출처 : HP-15C ADVANCED FUNCTIONS HANDBOOK (p.145)
ㄴ Appendix : Accuracy of Numerical Calculations
Example 2: Many Pennies.
A corporation retains Susan as a scientific and engineering consultant at a fee of one penny per second for her thoughts, paid every second of every day for a year. Rather than distract her with the sounds of pennies dropping, the corporation proposes to deposit them for her into a bank account in which interest accrues at the rate of 11¼ percent per annum compounded every second. At year's end these pennies will accumulate to a sum
where
payment = $0.01 = one penny per second,
i = 0.1125 = 11.25 percent per annum interest rate,
n = 60×60×24×365 = number of seconds in a year.
Using her HP-15C, Susan reckons that the total will be $376,877.67. But at year's end the bank account is found to hold $333,783.35. Is Susan entitled to the $43,094.32 difference?
In both examples the discrepancies are caused by rounding errors that could have been avoided. This appendix explains how.
The war against error begins with a salvo against wishful thinking, which might confuse what we want with what we get. To avoid confusion, the true and calculated results must be given different names even though their difference may be so small that the distinction seems pedantic.
HP-15C는 1982년 출시해 1989년 단종된 공학용 계산기입니다. 구형 기종이다보니 계산에 사용된 유효자릿수가 크지 않았던 듯 싶습니다. 오차율이 무려 12.91%에 달하는데... 이 정도면 (이 용도로는) 못쓴다고 봐야 맞을 겁니다.
그러니 설명서 appendix에 이와 관련하여 오차가 발생할 수 있음을 강력하게? 경고하고 있습니다. 경고할 수밖에 없겠죠. 이 데이터를 그대로 썻다가는... 끔찍한 사태가 발생할 수도 있으니까요. 물론 이 예제는 좀 극단적인 계산에 해당한다고 할 수 있겠습니다만...
https://en.wikipedia.org/wiki/HP-15C
요즘 계산기는 어떨까요? (feat. 울프람 알파)
= 333783.34994842833172198487646142620143147263335390407812403560738...
≒ 333783.35
댓글 8
-
-
-
TI-nspire CX (CAS) Finance Solver
오차 ≒ 0.000000002 오차율 ≒ 0%
단지 우연인지...
-
-
-
HP 39gII
오차 ≒ 262.01175, 오차율 ≒ 0.0785%
-
-
-
HP-50g 는 HP 39gII 와 동일
-
-
-
CASIO fx-570ES (Emul)
오차 ≒ -0.15815, 오차율 ≒ 0.0000474 %
* fx-991EX 결과 동일
-
-
-
여기 있던 사진은 다 어디로 사라졌나요
-
-
-
.tk 로 링크되어 있어서 안보였던 것 같습니다.
db에서 일괄변경했는데 왜 빠졌는지?
-
-
-
WP-34S
결괏값 : 333783.3897002807
오차 ≒ 0.039751, 오차율 ≒ 0.0000119%
(Double Precision Mode)
결괏값 : 333783.3499484283317219848945304508
오차 ≒ 1.80690248×10^-20, 오차율 ≒ 0%
-
TI-nspire CX (CAS)
오차 ≒ 4.78829, 오차율 ≒ 0.0014%