The following warnings occurred:
Warning [2] Undefined array key 151117 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151120 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151122 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151124 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151127 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151143 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151127 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151124 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 151143 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





The peculiar arithmetic of the SmartCalc 300s



#2

I've received my HP SmartCalc 300s and I'd like to share some findings about its arithmetic.
This calculator shows 10 digits but keeps 16 digits of internal precision in its registers.
So this machine should have impressive precision, right?

I'll do a little test that appeared on Fred Gruenberger's Computer Recreations in Scientific American, April, 1984
(I actually read it from the spanish "Investigación y Ciencia" in June 1984)
The test consists in computing (1.0000001)^(2^27) by applying the square operation 27 times starting with 1.0000001.
The correct answer is 674530.47074108455938....

First, to know what kind of precision we can expect we'll do some testing with a HP50G.
The HP50G has 15 internal digits and we can operate with that precision using the XREAL library
So let's try it:

  << 1.0000001 R~X 1 27 START XSQ NEXT >>
The result is 674530.467837207 with a percent error of 0.0000004305

But we can do better with 15 digits: the internal 15-digit arithmetic of the HP50G is truncated because
it's not meant to be seen; we can operate with 15 rounded digits (or any other rounding/number of digits) using the LongFloat library

  << 1.0000001 R<-->F 1 27 START FSQ NEXT >>
Now the result is 674530.469940699 and the percent error is 0.0000001186

So now we know what to expect with so many digits of precision; let's try the SmartCalc. We'll use the LinearIO mode so that we operate numerically and not with the mini-CAS that MathIO uses.

If we type 1.0000001 and then [x^2] [=] 27 times we get: 674529.1123 with a percent error of 0.0002014
(that's like 468 times larger than the XREAL result which one less digit and truncating the results!!) That's even worse that what can be achieved with 13 digits (percent error of 0.00002264 with LongFloat).

How can this be? Well, I wasn't too suprised becaused I'd played with Casio calculators before.

The reason is that following Casio tradition, some weird rounding if done on the internal numbers,
trying to hide the fact of a limited precision, so that for example
1-(4/3-1)*3 = 0 (which in a honest numerical calculator would reveal the internal precision.)
This rounding makes errors unpredictable and much larger than they could be. Note also that these attempts are bound to fail:
1/9-(10/9-1) = 0 but (1/9 - 0.01 - (10/9-1) + 0.01 = 1E-16

The results of the HP300S in the 1.0000001 test can be explained by a special rounding of the result
of arithmetic operations performed after normalization:

  • if the trailing 6 digits are less than 000050, they are rounded down to 000000.
  • if the trailing 4 digits are greater than 9949, the number is rounded up (so it ends in 0000)

You can see these rules in action here

     1E9 + 1.000050 - 1E9 = 1.00005
1E9 + 1.000049 - 1E9 = 1
1E9 + 0.100049 - 1E9 = 0.100049
1E9 + 0.009950 - 1E9 = 0.01
1E9 + 0.009949 - 1E9 = 0.009949

Note that numbers typed in the calculator are truncated to 15 digits; if you need to enter a value
with full 16 digits you must add a pair of numbers or do some other operation.

The special rounding explains all the intermediate results of the test, which are show here with full internal precision

  1.0000002
1.0000004
1.00000080000016
1.00000160000096
1.00000320000448
1.0000064000192
1.00001280007936
1.000025600322562
1.0000512013005
1.000102405222573
1.000204820931975
1.000409683815564
1.000819535471956
1.001639742582301
1.003282173920338
1.006575120506319
1.01319347322231
1.026561014180287
1.053827515834859
1.110552433130669
1.233326706732449
1.521094765539508
2.31372928575169
5.353343207745025
28.65828349990979
821.2972131612017
674529.1123463563

I've traced similar magic rounding in a Casio FX9960G (using an emulator) and in an old Casio FX750P.
These machines have more complicated rounding rules and the results of the test are similarly poor.
In the case of the FX750P we can operate either at the internal precision of 12 digits (using variables)
or at the displayed precision of 10 digits. Due to the idiosincratic rounding the result of the test using 10 digits
is more precise than with 12 digits!

It's a shame that the SmartCalc tries so hard to be smart. The result of computing 1-(4/3-1)*3 numerically should be 1E-15 showing that it is operating with limited precision. It should be 0 only if fractions or the MathIO mode are used, but the user should know the distinction between exact and approximate computations and be able to compute numerically with predictable results. The SmartCalc is very unreliable, with some results in accordance to its high internal precision and others randomly affected by large errors.


And now for something totally different:
My HP300S has a sticker on the back "Prototype Not for Sale" I saw it after ripping the package and then noticed
the sticker on it too:

Quote:
Prototype - Not For Sale. The unit and contents of this packaging are currently undergoing quality testing and
verification and are subjected to changes. ...

I wonder if there's any difference with a production unit; my keyboard misses keystrokes quite often and the cover cannot
be snapped on the back as the user manual suggests.

Anybody with a production 300S can tell about that?


Edited: 27 May 2009, 6:53 a.m.


#3

this is very interesting. i am wondering if this rounding is actually to disguise the fact that the 300 works in binary internally rather than BCD.

I first noticed a new and weird kind of rounding in the 30s. This is the calculator that not many people liked because it was one of the first not really made by HP at all. afaik the 30s and 9g use binary math internally and perform some weirdo rounding to hide it.

i spend a while trying to figure this out, but i found the rounding not consistent. both these models work to approx 25 digits, but the effective accuracy is around 12 due to the fact that it will round at every stage.

is the 300s really a binary machine?


#4

Quote:
is the 300s really a binary machine?

I don't think so. All the results reveal exactly 16 decimal digits. Also, the result of 1/9 - 0.001 - (10/9-1) + 0.001 is exactly 1E-16 which I find hard to explain in a binary machine.

#5

Quote:
I'll do a little test that appeared on Fred Gruenberger's Computer Recreations in Scientific American, April, 1984 (I actually read it from the spanish "Investigación y Ciencia" in June 1984) The test consists in computing (1.0000001)^(2^27) by applying the square operation 27 times starting with 1.0000001.

Interesting article! I read it back then in the university library and I still keep a copy of it.

Quote:
The reason is that following Casio tradition, some weird rounding if done on the internal numbers, trying to hide the fact of a limited precision,

Roger Rosenbaum has shed some light on this subject in the following threads:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=103356

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=103151

I just hope the HP SmartCalc 300s gives the right answer to expressions like '3979/LN((sqrt2+sqrt3)/sqrt3)'

Regards,

Gerson.


#6

Quote:
I just hope the HP SmartCalc 300s gives the right answer to expressions like '3979/LN((sqrt2+sqrt3)/sqrt3)'

The result is 6666.000006 (internally it is 6666.000005835731 which I believe is the correct result rounded to 16 digits). The results look very good except when the special rounding is triggered.

Thank you for the links, I'll have a look at them.

#7

There was a recent discussion in the French MySilicium forum (this part is even in English). Some Casio BASIC machines have a means of turning the weird rounding behavior on and off via MODE 10 and MODE 11 commands.

Edited: 28 May 2009, 2:45 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Layout of arithmetic keys on early calculators Walter B 10 3,417 11-20-2013, 11:13 AM
Last Post: Jake Schwartz
  HP 300s+: Too expensive ! Dimitri 5 1,903 09-06-2013, 02:19 PM
Last Post: Mic
  Crate of HP 300s+ Mic 0 809 04-22-2013, 12:56 PM
Last Post: Mic
  HP 300S+ Erturk Kocalar 2 1,278 03-19-2013, 07:16 AM
Last Post: Cristian Arezzini
  Free emulator of the new HP-300S+ available ! Mic 18 5,607 02-03-2013, 08:34 AM
Last Post: Marcus von Cube, Germany
  Review of the HP-300S+ Mic 22 5,309 01-01-2013, 06:07 PM
Last Post: chris smith
  Arithmetic programs for HP39gII Mic 0 959 12-19-2012, 12:23 PM
Last Post: Mic
  HP-34C Storage Register Arithmetic & Programming Matt Agajanian 14 4,011 05-08-2012, 11:04 AM
Last Post: Matt Agajanian
  A show review of the SmartCalc 300s... Jose Gonzalez Divasson 3 1,448 02-22-2012, 05:10 PM
Last Post: Chris Smith
  38E/C, 12C, 12CP date arithmetic bug Katie Wasserman 26 5,461 10-19-2011, 08:57 PM
Last Post: Miguel Toro

Forum Jump: