HP Forums
A quick precision test - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: A quick precision test (/thread-1521.html)

Pages: 1 2 3 4


A quick precision test - pito - 06-02-2014 10:37 PM

A friend of mine has advised me today there is following quick precision test when testing better calculators in the shop:

Take 1.0000001 and do x^2 27times..

Windows calculator (most probably using at least 34digits decimal fp) gives me:
674530.4707410845593826891780296

Wp34s emulator shows:
674530.47054

It seems to me all the relevant digits in this test fits into 39digits standard precision the wp34s uses. Why the diff then?

UPDATE:
Basic precision:

Code:
Calculator        Display           Display-INT           Note
=======================================================================
W.Alfa (Ref)      674530.470741     .4707410845           The reference
-----------------------------------------------------------------------
Citizen SRP-325G  674530.4707411                          ? basic precision, web source
Citizen SRP-400G  674530.4707411                          ? basic precision, web source
Canon X Mk I Pro  674530.4707       .4707399243
Casio CPad300Plus 674530.4706                             web source
WP-34s            674530.47054      .4705396874
WP-31s            674530.47054      .4705396874
Canon F-715SG     674530.4702       .470205499
Olympia LCD-8110  674530.4702       .470205499
Ti-80             674530.318        .3180426
TI-83 Plus Silver 674529.4131                             web source
Ti-89             674529.413051     .41305068
TI-92 Plus        674529.413051                           web source
Casio fx-9860     674529.1121                             web source
Casio FX-6910AG   674529.1097                             web source
Sharp EL-W506X    674523.3747       .3747398
SR-52             674520.6053                             web source
TI-59             674520.6053                             web source
HP-50g            674514.86877      .86877
HP-35s            674514.86877      .86877
HP-39GII          674514.86877                            web source
HP Prime          674514.86877                            web source
HP-49g            674514.86877                            web source
HP-30b            674514.86877                            web source
Sigma GC 500      674512.576        .576
Casio FX-602p     674494.0561                             web source
HP-25             674494.05         .0561
Anitech SC100     674492.7511       .75112
Casio fx-3650P    674475.4416                             web source
Casio FX-702p     674475.3961                             web source
Casio fx-991MS    674472.4416       .441611
TI-57             674432.82                               web source
Truly SC106A      674294.1172       .1172
Casio FX-502p     674185.8477                             web source



RE: A quick precison test - Paul Dale - 06-02-2014 11:04 PM

This test is not testing precision. At least when used as you seem to have.


1.0000001 has eight digits.
1.0000001^2 has sixteen digits (x^2 once).
1.0000001^4 has thirty two digits (x^2 twice).

Doing x^2 twenty seven times is raising the original number to the power 2^27 = 134,217,728. This has 8 * 134,217,728 = 1,073,741,824 decimal digits. That is a thousand million digits there. No calculator known can deal with that many, many desktop systems would fail or at best struggle.

Since you are doing each squaring separately, there is a rounding step each time. I'm confident these roundings explain the differing results. The 34S has guaranteed correctly rounded multiplication in single precision so it is giving the precise correct answer for a sixteen digit decimal device.


- Pauli


RE: A quick precison test - pito - 06-03-2014 12:07 AM

Quote:Since you are doing each squaring separately, there is a rounding step each time.
Is the rounding done upon the 39th digit?


RE: A quick precison test - Paul Dale - 06-03-2014 12:13 AM

16th in single precision, 34th in double.

39 digits are only used internally and are not available to the user.


- Pauli


RE: A quick precison test - pito - 06-03-2014 12:27 AM

Now I am little bit confused. Markus wrote in the cordic topic the standard precision used is 39 digits.
Does it mean you do rounding on 16th place with "single precision" and 34th in "double" after each calculation? Why do you use the 39digit precision as the standard one then?
My naive understanding (sorry I am newbie with wp34s) is the 39digit precision is used across any calculations inside the box so it is always maintained as 39.


RE: A quick precison test - Paul Dale - 06-03-2014 12:36 AM

We always round to 16 or 34 digits when we return the result to the stack. These are the only precisions a user or a keystroke program can access. Unless you are coding numerics in C, this is all you get.

The 39 digits are used inside but only during the evaluation of a built in function. Once the result is known, it is rounded. The reason is simple: guard digits. I don't need to and generally cannot get all 39 digits correct but having the extra digits gives some headroom to get the rounded result correct or at least close.


- Pauli


RE: A quick precison test - Gerson W. Barbosa - 06-03-2014 01:51 AM

(06-02-2014 10:37 PM)pito Wrote:  A friend of mine has advised me today there is following quick precision test when testing better calculators in the shop:

Take 1.0000001 and do x^2 27times..

This is from an old Scientific American article, "How to handle numbers with thousands of digits, and why one might want to", by Fred Gruenberger (Computer Recreations, April 1984). ( "Come e perché trattare numeri con migliaia di cifre", in Le Scienze )

In double precision the WP 34S return:

674530,4707410845593826891847277722

Comparing this result with

674530,4707410845593826891780297468 ( 1,0000001 ENTER 27 f 2^x f y^x )

we get

Percent error = 9,92990782557e-25 ( excellent! )

As a comparison, Hewlett-Packard 33, 67, 41C returns

"674494,0561"

Percent error = 0,00540 ( not so bad in 1984 )

Regards,

Gerson.

Note: "DECIMAL-POINT IS COMMA"


RE: A quick precison test - Massimo Gnerucci - 06-03-2014 06:21 AM

(06-03-2014 01:51 AM)Gerson W. Barbosa Wrote:  Note: "DECIMAL-POINT IS COMMA"

My friend! ;)


RE: A quick precison test - pito - 06-03-2014 07:23 AM

Gerson, thanks!
P.


RE: A quick precison test - HP67 - 06-03-2014 09:06 AM

(06-03-2014 01:51 AM)Gerson W. Barbosa Wrote:  Note: "DECIMAL-POINT IS COMMA"

COBOL!


RE: A quick precison test - Massimo Gnerucci - 06-03-2014 09:15 AM

(06-03-2014 09:06 AM)HP67 Wrote:  
(06-03-2014 01:51 AM)Gerson W. Barbosa Wrote:  Note: "DECIMAL-POINT IS COMMA"

COBOL!

Right! ;)


RE: A quick precison test - walter b - 06-03-2014 11:24 AM

(06-03-2014 06:21 AM)Massimo Gnerucci Wrote:  
(06-03-2014 01:51 AM)Gerson W. Barbosa Wrote:  Note: "DECIMAL-POINT IS COMMA"

My friend! Wink

Quite natural, isn't it? Wink

d:-)


RE: A quick precison test - Massimo Gnerucci - 06-03-2014 11:31 AM

(06-03-2014 11:24 AM)walter b Wrote:  
(06-03-2014 06:21 AM)Massimo Gnerucci Wrote:  My friend! ;)

Quite natural, isn't it? ;)

d:-)

To us, yes.
Cobol sentence mandatory in every program I wrote... :)


RE: A quick precison test - HP67 - 06-03-2014 11:50 AM

Hah! I never used it, and I never saw a piece of code that used it. I just remember it from the manuals.


RE: A quick precison test - Paul Dale - 06-03-2014 12:25 PM

Code:
ALTER THERE TO PROCEED TO ELSEWHERE.

Pure brilliance.

Almost as good as the RAMBOTRAN:
Code:
COME FROM

Does anyone here have a scan of the RAMBOTRAN document? I read it a couple of decades or more ago and haven't been able to locate it again.


- Pauli


RE: A quick precison test - HP67 - 06-03-2014 12:41 PM

I thought that was from Intercal COME FROM

Have never heard of RAMBOTRAN.

You can do some hilarious stuff in PL/I since it has no reserved words. I can't find the example I used to like but here is something similar:

Code:
if then then then=else; else else=then;

And this
Code:
IF IF THEN THEN = ELSE ;



RE: A quick precision test - Massimo Gnerucci - 06-03-2014 12:57 PM

(06-03-2014 12:25 PM)Paul Dale Wrote:  
Code:
ALTER THERE TO PROCEED TO ELSEWHERE.

Pure brilliance.

Almost as good as the RAMBOTRAN:
Code:
COME FROM

Does anyone here have a scan of the RAMBOTRAN document? I read it a couple of decades or more ago and haven't been able to locate it again.


- Pauli

This one?


RE: A quick precision test - HP67 - 06-03-2014 01:01 PM

That was posted 13 years after INTERCAL implemented the COME FROM statement.

And honestly, I don't see from that post that RAMBOTRAN is that much different from RPG Wink


RE: A quick precision test - walter b - 06-03-2014 01:52 PM

Big Grin Great text - you made my day! Big Grin

d:-)


RE: A quick precision test - walter b - 06-03-2014 01:56 PM

That COME FROM statement is what's obviously missing on this very forum in Linear Mode. Wink

d:-)