The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

HP-15C LE calculator forensics?
Message #1 Posted by Joel Setton (France) on 10 Sept 2011, 11:43 a.m.

Folks,
Has anyone run the Calculator Forensics formula on the HP-15C LE?
Just being curious, mine is still awaiting shipment in some distant warehouse...
Joel Setton

      
Re: HP-15C LE calculator forensics?
Message #2 Posted by Katie Wasserman on 10 Sept 2011, 12:21 p.m.,
in response to message #1 by Joel Setton (France)

It has to be the same as the original 15c, it's just an emulator running the 15c ROM image.

            
Re: HP-15C LE calculator forensics?
Message #3 Posted by Mike Morrow on 10 Sept 2011, 12:51 p.m.,
in response to message #2 by Katie Wasserman

Yes, the numerical results are always identical between the 15C and 15C-LE. Even the sequence of random numbers generated after reset with the RAN# command is identical.

                  
Re: HP-15C LE calculator forensics?
Message #4 Posted by Gerson W. Barbosa on 10 Sept 2011, 3:01 p.m.,
in response to message #3 by Mike Morrow

BTW, even the 12C Platinum can be programmed to replicate the original 15C forensic results. From article #654:

1) asin(acos(atan(tan(cos(sin(9)))))): 

Keystrokes Display

9 9. R/S 0.156434465 g GTO 090 R/S 0.999996273 g GTO 100 R/S 0.017455000 g GTO 178 R/S 0.999996272 g GTO 157 R/S 0.156441660 g GTO 137 R/S 9.000417403

Quote:
Even the sequence of random numbers generated after reset with the RAN# command is identical.

I will run the program in message #19 of this thread. The result should be

534,912,768.0
That's a solution to Karl Schneider's interesting challenge, that is,
5/34 + 9/12 + 7/68 = 1
No one should try this on his/her new HP-15C LE as it will take about 7 hours to run. I hope the batteries last that long :-) (Valentin Albillo presented later a faster 15C program, about 850 times as fast).

      
Re: HP-15C LE calculator forensics?
Message #5 Posted by John B. Smitherman on 10 Sept 2011, 2:20 p.m.,
in response to message #1 by Joel Setton (France)

I would be interested in the results of the calculator torture tests:Torture

John

            
Re: HP-15C LE calculator forensics?
Message #6 Posted by Thomas Klemm on 10 Sept 2011, 5:33 p.m.,
in response to message #5 by John B. Smitherman

I don't quite agree with the results for the HP-15C.

round #1: accuracy of tan(355/226)

Quote:
correct answer, tan(355/226) = -7497258.18532

But there's no way to enter 355/226 into this calculator. The best you can do is to calculate that number which is 1.570796460. That's why we have to compare the result of tan(1.570796460).

  • HP-15C: -7,507,225.705
  • Correct answer: -7,507,219.878
  • Relative error: 7.7619 10-7 instead of 1.33x10-3

round #2: cube root of -27

After setting complex mode (SF 8) I get the correct answer: 1.5000 + 2.5981i instead of Error 0.

round #3: definite integration

3.5: integrate(sqrt(abs(x-1)), 0, 2)

The HP-15C has an issue with this integral. However it's interesting that the correct answer is given rather fast when using 1 as the lower limit. I was astonished that this calculator has a problem with this function while both HP-32Sii and HP-48G don't have it since I assumed all use the same algorithm.

Thanks for pointing out this torture test.
Thomas

                  
Re: HP-15C LE calculator forensics?
Message #7 Posted by Dieter on 10 Sept 2011, 6:57 p.m.,
in response to message #6 by Thomas Klemm

Since we had this discussion on how the new 15C compares to the 35s, here are the results for the latter:

  • Tan 355/226 = tan 1,57079646018 = -7497089,06507601...
    The 35s result is -7497089,2551 => rel. error is just 2,5E-8.
    If 10 digits are used (like in the 15C LE example, i.e. tan 1,570796460) the error in the 35s result still is only 2,5E-8.

  • Cuberoot of -27: simply enter -27 [ENTER] 3 [XROOT] => -3. No error message, no complex mode required.
    This also is another example that shows how useful an XROOT function is. It returns results where the usual approach -27 [ENTER] 3 [1/x] [y^x] will not work and throw an error - simply because 0,3333.... is not the same als 1/3.

    Want a complex result? -27i0 [ENTER] 3 [1/x] [y^x] => 1,5000i2,5981.

  • Integrate sqrt(abs(x-1)) from 0 to 2: In FIX 4 it takes a moment, but finally the 35s comes back with the correct result 1,3333.
That's why I still think the 35s is a nice calculator. Yes, it has its bugs, but these are known and I can work around them. ;-)

Dieter

Edited: 10 Sept 2011, 7:03 p.m.

                        
Re: HP-15C LE calculator forensics?
Message #8 Posted by Paul Dale on 10 Sept 2011, 9:04 p.m.,
in response to message #7 by Dieter

Quote:
Yes, it has its bugs, but these are known and I can work around them. ;-)

Some are known. How much faith do you have that all are? :-)

- Pauli

                              
Re: HP-15C LE calculator forensics?
Message #9 Posted by Dieter on 11 Sept 2011, 9:12 a.m.,
in response to message #8 by Paul Dale

Well, after four years of use now I am quite sure that all relevant bugs are known. As opposed to the brand new 15C which the community will still have to scrutinize. ;-)

Dieter

                        
Re: HP-15C LE calculator forensics?
Message #10 Posted by Thomas Klemm on 11 Sept 2011, 1:50 a.m.,
in response to message #7 by Dieter

Quote:
Integrate sqrt(abs(x-1)) from 0 to 2: In FIX 4 it takes a moment, but finally the 35s comes back with the correct result 1,3333.

How long is a moment? Because I stopped the integration on my HP-35s after a minute or so. I've tried both ways: using a program and an equation.

Does anybody have an idea what's going wrong here? To me this function doesn't apear to be wild. Ok, there's a singularity of the first derivative at x = 1. But why isn't it a problem when it is used as lower limit?


This is another function most HP calculators seem to have a problem with: f(x) = Sqrt[|x| (2 - |x|)]. It describes a circle with radius r = 1 and center at (1, 0) or (-1, 0).

Integrating this function from 0 to 2 is not a problem. But when the interval [-1, 1] is used it takes much longer or seems to never end.

While I knew that Romberg-integration has a problem with these kind of singularities I wasn't aware that this happens only when they are located inside the interval.

Thomas

Edited: 11 Sept 2011, 4:22 a.m.

                              
Re: HP-15C LE calculator forensics?
Message #11 Posted by Dieter on 11 Sept 2011, 7:44 a.m.,
in response to message #10 by Thomas Klemm

The 35s took 40 - 45 seconds for the integral in FIX4 mode. The function had been entered as an equation. Since this elegant feature is available: use it. ;-)

Edit: I also tried the function you mentioned over [-1; 1] on the 35s. For a first look at the result I set FIX2 and the result was returned immediately as 1,52 (last digit is off). FIX3 returns 1,570 (correct within 1 ULP) after 16 seconds. Finally, FIX4 requires two minutes, but comes back with the correct result 1,5708 as well. :-)

Dieter

Edited: 11 Sept 2011, 8:52 a.m.

                        
Re: HP-15C LE calculator forensics?
Message #12 Posted by Thomas Klemm on 11 Sept 2011, 3:47 a.m.,
in response to message #7 by Dieter

Quote:
Want a complex result? -27i0 [ENTER] 3 [1/x] [y^x] => 1,5000i2,5981.

Quote:
This also is another example that shows how useful an XROOT function is.

Just never try this in combination: -27 i 0 [ENTER] 3 [XROOT] => INVALID DATA

Duh!

                              
Re: HP-15C LE calculator forensics?
Message #13 Posted by Dieter on 11 Sept 2011, 7:46 a.m.,
in response to message #12 by Thomas Klemm

Yes, this combination cannot be used since XROOT does not work in the complex domain. This is documented in the manual.

But let us not forget that other calculators do not have such a function at all. ;-)

Dieter

Edited: 11 Sept 2011, 8:35 a.m.

                  
Re: HP-15C LE calculator forensics?
Message #14 Posted by Gerson W. Barbosa on 10 Sept 2011, 7:37 p.m.,
in response to message #6 by Thomas Klemm

Quote:
But there's no way to enter 355/226 into this calculator. The best you can do is to calculate that number which is 1.570796460. That's why we have to compare the result of tan(1.570796460).
  • HP-15C: -7,507,225.705
  • Correct answer: -7,507,219.878
  • Relative error: 7.7619 10-7 instead of 1.33x10-3

You are right. It would not be fair to compare the calculators results with the exact result of tan(355/226).

correct 16-digit answer, tan(1.570796460) = -7507219.878366671	

calculator displayed result relative error

HP-45 -7.516790992E+06 1.27E-03 HP-29C, 32E, 15C, 41CX -7507225.705 7.76E-07 HP-20S, 32SII, 28S, 48G -7507219.87837 4.44E-13 hp 33s, 35s -7507220.0689 2.54E-08 HP-25 -7518796.992 1.54E-03 wp34s -7507219.878366671 0.00E+00

Gerson.

Edited: 10 Sept 2011, 7:48 p.m.

                        
Re: HP-15C LE calculator forensics?
Message #15 Posted by Paul Dale on 11 Sept 2011, 4:14 a.m.,
in response to message #14 by Gerson W. Barbosa

I kind of hope you weren't using the 34S as the 16 digit benchmark for this.

In this case, the 34S is correct but please nobody assume it is everywhere, I've done no theoretic error analysis and the number of values actually validated is tiny.

That all said, definitely let me know when it isn't correct within +/- 1 in the last digit :-)

- Pauli

                              
Re: HP-15C LE calculator forensics?
Message #16 Posted by Dieter on 11 Sept 2011, 7:48 a.m.,
in response to message #15 by Paul Dale

Pauli, if 39 digits of internal precision were not able to provide a correct 16 digit result you would have done something seriously wrong. ;-)

Dieter

                                    
Re: HP-15C LE calculator forensics?
Message #17 Posted by Paul Dale on 11 Sept 2011, 8:10 a.m.,
in response to message #16 by Dieter

And to be honest, I'm not at all sure I haven't done something seriously wrong somewhere. There is a *lot* of numeric code in the 34S and some of it is bound to be slightly incorrect (or worse).

- Pauli

                                          
Re: HP-15C LE calculator forensics?
Message #18 Posted by ngel Martin on 11 Sept 2011, 1:13 p.m.,
in response to message #17 by Paul Dale

I think that's called "programmer's remorse" (akin to the buyer's but more lonely :-)

I know, it also happens to me...

                              
Re: HP-15C LE calculator forensics?
Message #19 Posted by Gerson W. Barbosa on 11 Sept 2011, 12:38 p.m.,
in response to message #15 by Paul Dale

Quote:
I kind of hope you weren't using the 34S as the 16 digit benchmark for this.
.

I used WolframAlpha's result truncated at the second zero:

-7.5072198783666710922545119574391592156309211475564175...  10^6

This, of course, would sure match the wp34s's result :-)

Gerson.

                        
Re: HP-15C LE calculator forensics?
Message #20 Posted by Dieter on 11 Sept 2011, 8:01 a.m.,
in response to message #14 by Gerson W. Barbosa

Quote:
You are right. It would not be fair to compare the calculators results with the exact result of tan(355/226).
correct 16-digit answer, tan(1.570796460) = -7507219.878366671
As already mentioned in a previous message, this tangent evaluation is extremely prone to errors. Since the argument may always be off by plus or minus 5E-10, the tangent may vary by ~28000 (!) or a relative error of 3,7E-3.

Yes, the tangent of 1,57079646000000000000000000000.... has the mentioned value, but in real life we are dealing with irrational numbers (i.e. #digits is infinite), so we cannot expect correct results for tan(x_close_to_pi/2) at all.

Dieter


[ Return to Index | Top of Index ]

Go back to the main exhibit hall