Larger stack size
12-29-2020, 06:26 PM
Post: #24
 Dave Britten Senior Member Posts: 2,313 Joined: Dec 2013
RE: Larger stack size
(12-29-2020 05:56 PM)Allen Wrote:
(12-29-2020 04:59 PM)Valentin Albillo Wrote:  Wrong. Yout code above does not compute correctly that tower of exponentials.
V.

Symbolically it does.

In python it's off by the trailing digit, but the same could be true of either implementation on different calculators with different accuracy.

Code:
 pow(pow(pow(pow(2,1.8),1.6),1.4),1.2) Out[124]: 28.609056210554545 pow(2,1.8*1.6*1.4*1.2) Out[125]: 28.60905621055455

I would suggest that on a pocket calculator
$$2^{1.8*1.6*1.4*1.2}$$
is the better approach since there is only 1 opportunity to cascade floating point errors, rather than the nested exponential which propagates any round-off error from the first EXP several times before arriving at the final result.

I think there's some disagreement over the associativity of exponentiation. The 65 Notes article suggests it's right associative - i.e. 2^1.8^1.6^1.4^1.2 = 2^(1.8^(1.6^(1.4^1.2))) - which the 35's x^y is particularly well suited to handle. That is, of course, most definitely not equal to 2^(1.8*1.6*1.4*1.2). If we assume the exponents are left-associative, then you are correct.

It seems like TI treats it as left-associative (28.6) according to my 58C, 85, and 84 Plus, and Casio changed from left-associative to right-associative (9.72) at some point: my fx-7000G is left-associative, and the fx-5800P and fx-991EX both display the operator as ^( in line I/O mode, clearly showing the right associativity.
 « Next Oldest | Next Newest »

 Messages In This Thread Larger stack size - Dave Britten - 12-28-2020, 06:10 PM RE: Larger stack size - hth - 12-28-2020, 06:38 PM RE: Larger stack size - Dave Britten - 12-28-2020, 07:58 PM RE: Larger stack size - Massimo Gnerucci - 12-28-2020, 07:37 PM RE: Larger stack size - BruceH - 12-28-2020, 11:22 PM RE: Larger stack size - Sylvain Cote - 12-28-2020, 11:43 PM RE: Larger stack size - Peet - 12-29-2020, 12:36 AM RE: Larger stack size - Gene - 12-29-2020, 01:14 AM RE: Larger stack size - Dave Britten - 12-29-2020, 03:37 AM RE: Larger stack size - toml_12953 - 12-29-2020, 04:41 PM RE: Larger stack size - Valentin Albillo - 12-29-2020, 02:52 AM RE: Larger stack size - Peet - 12-29-2020, 08:46 AM RE: Larger stack size - Paul Dale - 12-29-2020, 08:54 AM RE: Larger stack size - RMollov - 12-29-2020, 12:18 PM RE: Larger stack size - Gene - 12-29-2020, 01:50 PM RE: Larger stack size - Dave Britten - 12-29-2020, 04:20 PM RE: Larger stack size - Allen - 12-29-2020, 04:47 PM RE: Larger stack size - Valentin Albillo - 12-29-2020, 04:59 PM RE: Larger stack size - Allen - 12-29-2020, 05:56 PM RE: Larger stack size - Albert Chan - 12-29-2020, 06:20 PM RE: Larger stack size - Dave Britten - 12-29-2020 06:26 PM RE: Larger stack size - Massimo Gnerucci - 12-29-2020, 06:29 PM RE: Larger stack size - Dave Britten - 12-29-2020, 06:31 PM RE: Larger stack size - ijabbott - 12-30-2020, 01:49 PM RE: Larger stack size - Dave Britten - 12-30-2020, 02:11 PM RE: Larger stack size - robve - 12-30-2020, 02:19 PM RE: Larger stack size - Valentin Albillo - 12-29-2020, 09:07 PM RE: Larger stack size - robve - 12-29-2020, 10:10 PM RE: Larger stack size - Gene - 12-29-2020, 05:23 PM RE: Larger stack size - Mike (Austria) - 12-29-2020, 06:18 PM RE: Larger stack size - Massimo Gnerucci - 12-29-2020, 06:23 PM RE: Larger stack size - JSBach - 01-04-2021, 12:21 PM RE: Larger stack size - John Keith - 01-04-2021, 03:58 PM

User(s) browsing this thread: 1 Guest(s)