Rounding of 10^x Olivier De Smet Unregistered Posts: 275 Threads: 41 Joined: Mar 2010 08-26-2013, 09:06 AM By playing on various of my emulators I observe the classical behavior : 8 ENTER 10^X -> 9999999.60 on pre HP67 model and 100000000 after ... By looking at DATES the 67 was intro on 7/76 My question is the following: The 25 was intro on 8/75 and my emulation go25c gives 9999999.60 BUT the 25C was intro the same day as the 67, and my question is about its rom, is it the same as the 25 or was it corrected as on the 67 ? (in fact I don't know if I use a 25 rom or a 25C one ...) Same apply on the 29C et all, Could you confirm the behavior for the 25, the 22, the 91, the 27 the 25C, the 19C ... Just for curiosity :) Edited: 26 Aug 2013, 9:10 a.m. Andrés C. Rodríguez (Argentina) Unregistered Posts: 1,193 Threads: 43 Joined: Jul 2005 08-26-2013, 10:32 AM Just from memory, I think that the 25 and 25C had the same behavior, and I believe some improvements in math functions appeared in the 29C. For instance, (-8)^(1/3) gives -2 in the 29C, but not in previous models. Just my AR\$ 0.1 Dieter Unregistered Posts: 653 Threads: 26 Joined: Aug 2010 08-26-2013, 03:08 PM There is a simple answer to this: early HP machines did not benefit from the three additional guard digits that were introduced later, around 1976. That's why you get the mentioned result with 10 digits working precision - both for the result as well as for internal calculations: ``` 10^8 = e^(8 * ln 10) = e^(8 * 2,302585093) ' ln 10 rounds very nicely to 10 digits, = e^18,42068074 ' but 8 * ln 10 does not - the exact result ' is nearly halfway between ...74 and ...75 = 99999999,60... ``` This topic was discussed in HP Journal 11/1976, page 16 f.: "The new accuracy - making 2^3 = 8", here with regard to the then new HP-91. Several examples for roundoff errors of earlier HPs are given, very similar to the one you posted, e.g. 9^5, 25^5, 10^52 etc. Dieter Thomas Klemm Unregistered Posts: 735 Threads: 34 Joined: May 2007 08-26-2013, 03:21 PM Quote: For instance, (-8)^(1/3) gives -2 in the 29C That's amazing! Are you sure about that? How could you enter 1/3? Cheers Thomas Matt Agajanian Unregistered Posts: 980 Threads: 239 Joined: Aug 2006 08-27-2013, 12:30 AM In light of these precision errors, how was it that users of the Classics and Woodstocks (or desktop predecessors) could compensate for these inaccuracies? Paul Dale Unregistered Posts: 3,229 Threads: 42 Joined: Jul 2006 08-27-2013, 01:25 AM Compare the inaccuracy here with that of a slide rule. - Pauli Andrés C. Rodríguez (Argentina) Unregistered Posts: 1,193 Threads: 43 Joined: Jul 2005 08-27-2013, 08:44 AM As I said, these comments are just from some 35 years old memories, I don't have a 29C to try, but I do recall there was an improvement in the management of integer powers of negative numbers. It's very likely I made a mistake yesterday and the correct example should have been (-2)^3 = -8. My apologies. BShoring Unregistered Posts: 67 Threads: 7 Joined: Mar 2013 08-27-2013, 11:16 PM There is a related issue in the earliest HP's. If you take 1.000001 to the power of 1 million you get the value "e" (2.718281828). On the scientifics, this isn't of much use, but for a financial like the HP-80, it gives you an easy way to get "e." The classics and earliest Woodstocks get this result, but I believe later Woodstocks do not. Bob Dieter Unregistered Posts: 653 Threads: 26 Joined: Aug 2010 08-28-2013, 06:33 AM Compare it to the inaccuracy that's still present on today's machines: let's consider the yx function, which is evaluated as e x ln y. On classic HPs with a working range up to 9,999...E+99, the largest possible exponent in this equation is 230,25..., so that even a perfectly rounded 10-digit result still may have an absolute error of +/- 5E-8 in the exponent. Which quite exactly equals a relative error of 5E-8 in the final result, i.e. up to 5 units in the 8th significant digit. So the result has merely 7 digits that can be trusted. The loss of accuracy is caused by the three digits in the integer portion of the exponent (230). Maybe this was (one) reason why HP chose to add three guard digits in the mid-seventies, and not two or four. So far, so good. Things get worse as soon as the mentioned exponent may get larger: in current 12-digit machines with working range up to 9,999...E+499 it may exceed 1000 (up to 1151,29...) an thus four digits are lost. Since there are still no more than three internal guard digits, roundoff errors similar to those discussed for early HPs may show up in the last digit. Try this e.g. with an HP35s: ``` 10 [ENTER] 450,9 [yx] 7,943 2823 4729 E+450 450,9 [10x] 7,943 2823 4729 E+450   correct result 7,943 2823 4724 E+450 10 [ENTER] -450,1 [yx] 7,943 2823 4719 E-451 -450,1 [10x] 7,943 2823 4719 E-451   correct result 7,943 2823 4724 E-451 ``` Dieter Edited: 28 Aug 2013, 6:41 a.m. « Next Oldest | Next Newest »

 Possibly Related Threads… Thread Author Replies Views Last Post Shutdown with the Apps key and more than 10 variables in a program. Davi Ribeiro de Oliveira 10 3,397 11-05-2013, 01:26 PM Last Post: Han HP Prime program: rounding to a fraction Patrice 3 1,528 10-31-2013, 06:16 AM Last Post: Joe Horn HP Prime: Rounding error in determinant Stephan Matthys 3 1,460 10-25-2013, 09:29 PM Last Post: Walter B Updated PPC DVD Version 2.10: HP-41 Searchable Program Files and Scannable Barcode Jake Schwartz 3 1,624 09-27-2013, 09:51 PM Last Post: Olivier (Wa) HHC 2012 RPN Programming Contest - 10-Step Way-After-Nashville Solution Jeff O. 32 6,016 10-12-2012, 01:41 AM Last Post: Paul Dale Library 4 update on 10/2/2012 ? Gene Wright 10 2,751 10-11-2012, 02:31 AM Last Post: Ángel Martin Estimating Accumulated Rounding Errors Egan Ford 13 2,912 08-16-2012, 01:49 PM Last Post: Egan Ford e^pi - pi + 9/10^4 + 1/(10^4*ln(2) + sqrt(10)/6)^2 Gerson W. Barbosa 47 10,547 08-08-2012, 10:58 PM Last Post: Les Koller [WP-34S] Upgrade in 10 mins. now v 3.1 2988 Chris Tvergard 12 3,345 06-01-2012, 02:39 AM Last Post: Walter B Link for SAMBA v2.10 download Tom Sauntry 9 2,364 05-28-2012, 11:41 AM Last Post: Tom Sauntry

Forum Jump: