Post Reply 
I became one of the 15c collecting Crowd
10-27-2023, 07:05 PM
Post: #1
I became one of the 15c collecting Crowd
I became on of the 15c collecting crowd, bought from (https://sciencestudio.co.uk/collections/...cts/hp-15c) seems the best price including postage in the UK at the moment has been in stock for a while.
But I was a bit disappointed that it it will not integrate e^(x^3) between the limits of 0 and 6. the pc emulator does it in a fraction of a second, but I let mine run for 30 minutes and it didn't supply an answer or report a fault ( the DM15c is faster in lower values but couldn't wait for it on range 0 to 6), . I know you might say a pc is a lot faster but over 3,500 times faster?
Thought someone else would have mentioned it as it is quite a common test.
Find all posts by this user
Quote this message in a reply
10-27-2023, 08:02 PM (This post was last modified: 10-27-2023 09:55 PM by Johnh.)
Post: #2
RE: I became one of the 15c collecting Crowd
Congrats on your new machine.

But I don't blame it for having trouble with that integral, given that the function gets up to 6.4 x 10^93 . That's not a number that comes up very often in day-to-day engineering. Smile And in the last 5% of the x range, the function is increasing at a crazy rate. Very difficult for the algorithm to converge to what it thinks is adequate accuracy.

Still, I guess it's an extreme case . Do we know what the true result is?

I've also been exploring the integrate function. A nice simple one is to integrate a quarter of a circle of radius 2, for which the result is Pi.

y= (4-x^2)^0.5 with x from 0 to 2

It can also be numerically challenging if high accuracy is needed, since the function goes vertical as x approaches 2.

The more sig figs in the FIX display setting you ask for, the longer it takes. Using Touch 15i on my Samsung S22 and display FIX8, it took 50 seconds to arrive at Pi to 7 decimal places with the last digit 5 instead of 6. That's with the emulator set to mimic the speed of an original hp15C. It took about a second at full speed.

On a real calc, it took about a second on my hp15C CE, with the same result.
Find all posts by this user
Quote this message in a reply
10-27-2023, 08:18 PM
Post: #3
RE: I became one of the 15c collecting Crowd
Also, reading the appendix E of the accompanying manual might be of help.
Find all posts by this user
Quote this message in a reply
10-27-2023, 10:38 PM
Post: #4
RE: I became one of the 15c collecting Crowd
(10-27-2023 08:02 PM)Johnh Wrote:  But I don't blame it for having trouble with that integral, given that the function gets up to 6.4 x 10^93 [...]Still, I guess it's an extreme test Do we know what the true result is ?

This integral has been discussed many times in these fora, just for instance:

here
  here
    here
      here
        here
          and here

to mention but a few.

V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
10-27-2023, 11:05 PM (This post was last modified: 10-28-2023 12:45 AM by carey.)
Post: #5
RE: I became one of the 15c collecting Crowd
(10-27-2023 07:05 PM)thenozone Wrote:  But I was a bit disappointed that it it will not integrate e^(x^3) between the limits of 0 and 6...

For perspective, any function that grows more rapidly than e^(x^2) doesn't have a Laplace transform. Hence, the likelihood that the exponential function (itself rapidly growing) raised to the power of x^3 represents any physical process is nil. While, between limits of 0 and 1, the numerical result is a nice 1.3419..., between 0 and 6, Wolfram Alpha gives 5.9639380 x 10^91 (approximately 6, followed by 91 zeros).

As famed numerical analyst William Kahan said in an interview (available on YouTube), his goal for the 15c integral, solve, and complex features was so it could handle 1st and 2nd year needs of engineering students (except for, he said, vector calculus).

Hence, while of theoretical interest if the 15c struggles with this non-Laplace transformable function between limits that give an answer of order of magnitude 10^91, and while it's always interesting to challenge an algorithm or device, it would be of no practical significance.
Find all posts by this user
Quote this message in a reply
10-28-2023, 12:19 AM (This post was last modified: 10-28-2023 12:44 AM by Johnh.)
Post: #6
RE: I became one of the 15c collecting Crowd
Thanks for the links to previous discussions.

I tried integrating e^(x^3) , x= 0 to 6, on the hp15C CE and Touch 15i emulator at full speed. It did indeed converge, using display SCI 6, which is an many digits as can be displayed directly. The calculator got there in 17 seconds, and the emulator in about 2 seconds. With SCI 5 it was about 7sec and 1sec respectively.

Exactly the same value was produced by the calculator and emulator. In SCI 6:

5.963 938 x 10^91

From the previous discussions, that seems like a credible result. Wolfram Alpha thinks so too:
   

Actually I find it amazing and impressive that this works!
Find all posts by this user
Quote this message in a reply
10-28-2023, 01:54 AM
Post: #7
RE: I became one of the 15c collecting Crowd
(10-28-2023 12:19 AM)Johnh Wrote:  I tried integrating e^(x^3) , x= 0 to 6, on the hp15C CE and Touch 15i emulator at full speed. It did indeed converge, using display SCI 6, which is an many digits as can be displayed directly. The calculator got there in 17 seconds, and the emulator in about 2 seconds. With SCI 5 it was about 7sec and 1sec respectively.

Exactly the same value was produced by the calculator and emulator. In SCI 6:

5.963 938 x 10^91

Try integrating from x = 5 to x = 6 and compare the results and times. The HP-15C app by HP gives the answers instantly (too bad the blinking display bug still persists after all those years).
Find all posts by this user
Quote this message in a reply
10-28-2023, 02:25 AM
Post: #8
RE: I became one of the 15c collecting Crowd
(10-28-2023 01:54 AM)Gerson W. Barbosa Wrote:  
(10-28-2023 12:19 AM)Johnh Wrote:  I tried integrating e^(x^3) , x= 0 to 6, on the hp15C CE and Touch 15i emulator at full speed. It did indeed converge, using display SCI 6, which is an many digits as can be displayed directly. The calculator got there in 17 seconds, and the emulator in about 2 seconds. With SCI 5 it was about 7sec and 1sec respectively.

Exactly the same value was produced by the calculator and emulator. In SCI 6:

5.963 938 x 10^91

Try integrating from x = 5 to x = 6 and compare the results and times. The HP-15C app by HP gives the answers instantly (too bad the blinking display bug still persists after all those years).

With x= 5 to 6, both machines run in close to half the time as for 0 to 6. And of course, the result is the same to the 6 decimal places as used above. At x=5, the function still has almost 40 more orders of magnitude to rise before it gets to x = 6 !
Find all posts by this user
Quote this message in a reply
10-28-2023, 04:57 AM
Post: #9
RE: I became one of the 15c collecting Crowd
Knowing that the result will be a huge number, with many many zeros, working with decimals will be useless.

Just fix 0 decimals and perform integration: the result will appear quickly: 6 E 91.

If more accuracy is needed, a calculator maybe is not the right tool to use.



Put a calculator into your life!
Visit this user's website Find all posts by this user
Quote this message in a reply
10-28-2023, 11:11 AM (This post was last modified: 10-28-2023 11:21 AM by John Keith.)
Post: #10
RE: I became one of the 15c collecting Crowd
For reference, this integration takes 65 seconds on the HP 50 in STD mode. All 12 digits are correct.

Strangely, in SCI 6 mode, the integration takes 32.8 seconds, and the actual result is accurate to 11 digits ( error of 6 ULPs).
Find all posts by this user
Quote this message in a reply
10-28-2023, 11:24 PM
Post: #11
RE: I became one of the 15c collecting Crowd
(sorry if this thread is shifting a bit from the initial discussion in the OP about hp15c CE's)

Interesting to hear about the results from different machines. So I tried it on my HP35s. There are two ways on this calc, either using a programmed subroutine, or using an equation. I found that the EQN method ran quicker, and in SCI 6 mode the results were:

Program method: 2 min 30 sec
EQN mode 1 min 45 sec

Both give the same result, correct to 6 decimal places as I found on the 15C, and after revealing more sig figs after the run, accurate until one digit off in the 9th decimal place.

The HP15C CE ran in 17 sec with SCI 6, and resulted in one digit off in the 7th decimal place.

So maybe there are a few differences in the algo's being used across the years, with more or fewer guard digits. But all are doing a great job at dealing with this rather crazy function and it's a testament to the very clever and adaptable numerical integration methods being used in all the hp's. At high-school we learnt about the trapezium method, and then the accuracy benefits of Simpsons method, but this seems to be a lot better again.

My tests also reinforced an impression I've been developing about my two HP's. For simple quick number crunching on the fly, with some adhoc programming and a few clever features using things like SOLVE or INTEGRATE, the HP15 is actually simpler and quicker, and its clearer to read and its more compact and cuter too!. But the HP35s does a lot more and the alpha labels, alpha-numeric display and better editing features make it better for running more complex tasks. It's buttons feel good too and its display is fine, but there's more you have to look for and do to find everything.
Find all posts by this user
Quote this message in a reply
10-29-2023, 12:01 AM
Post: #12
RE: I became one of the 15c collecting Crowd
(10-28-2023 11:24 PM)Johnh Wrote:  ..
Interesting to hear about the results from different machines. So I tried it on my HP35s. There are two ways on this calc, either using a programmed subroutine, or using an equation. I found that the EQN method ran quicker, and in SCI 6 mode the results were:

Program method: 2 min 30 sec
EQN mode 1 min 45 sec

Both give the same result, correct to 6 decimal places as I found on the 15C, and after revealing more sig figs after the run, accurate until one digit off in the 9th decimal place.

The HP15C CE ran in 17 sec with SCI 6, and resulted in one digit off in the 7th decimal place.

So maybe there are a few differences in the algo's being used across the years, with more or fewer guard digits. But all are doing a great job at dealing with this rather crazy function and it's a testament to the very clever and adaptable numerical integration methods being used in all the hp's. At high-school we learnt about the trapezium method, and then the accuracy benefits of Simpsons method, but this seems to be a lot better again.
...

It should be noted that William Kahan was responsible for creating the underlying algorithms for the Solver and Integration functions on the HP-34C and HP-15C. He is also largely responsible for determining the advanced feature set of the HP-15C. The HP-15C team wrote the HP-15C firmware in the assembly language of the HP Nut processor used on those models.

The firmware for the HP 35s was written in C by Kinpo Electronics, who also manufactured the calculator for HP. This model uses a Sunplus/Generalplus 8502 microcontroller (with CPU core based on MOS 6502). Kinpo worked from a functional specification document provided by HP but I do not know if any elements of the original HP algorithms were used by Kinpo.

Very different animals.
Visit this user's website Find all posts by this user
Quote this message in a reply
10-29-2023, 01:10 AM
Post: #13
RE: I became one of the 15c collecting Crowd
(08-16-2023 11:55 AM)Albert Chan Wrote:  We could estimate ∫(e^x^3, x = 0 .. 6) without calculator.

Let y = e^x^3 , dy = e^x^3 * (3*x^2) dx

∫(e^x^3, x = 0 .. 6) = 1/3 * ∫(ln(y)^(-2/3), y = 1 .. e^6^3)

Integrand f(y) = ln(y)^(-2/3) is decreasing, *very flat* on the right, shaped like └------

∫(y dx) = ∫(1/(3x^2) dy)

A high growth function, going "vertical", viewed from y-axis is very flat!

We flatten it a bit more, before integrate, with y=z^3, dy = 3*z^2 dz
HP71B INTEGRAL internal u-transform should turn this into nice bell shape.

∫(e^x^3, x = a .. b) = ∫((3*ln(z))^(-2/3)*z^2, z = e^(a^3/3) .. e^(b^3/3))

10 DEF FNZ(Z) @ N=N+1 @ FNZ=(3*LN(Z))^(-2/3)*Z*Z @ END DEF
20 INPUT "P,A,B = ";P,A,B
30 N=0 @ DISP INTEGRAL(EXP(A^3/3),EXP(B^3/3),P,FNZ(IVAR)), N
40 GOTO 20

>DESTROY ALL @ RUN

P,A,B = 1e-3, 0,6
 5.96393763345E91      15
P,A,B = 1e-6, 0,6
 5.96393808826E91      31
P,A,B = 1e-9, 0,6
 5.96393809181E91      63

(10-28-2023 01:54 AM)Gerson W. Barbosa Wrote:  Try integrating from x = 5 to x = 6 and compare the results and times.

Interestingly, integrate from 5 .. 6 produce curve of same shape!
In other words, with 5 .. 6, same sample points, same integral result.
Find all posts by this user
Quote this message in a reply
10-30-2023, 12:46 AM
Post: #14
RE: I became one of the 15c collecting Crowd
.
Hi, Johnh,

Quote:Interesting to hear about the results from different machines.

Good. Here's some other HP results for you, obtained directly from the command line (no programming needed) using the HP-71B:
    >INTEGRAL(0,6,1E-4,EXP(IVAR*IVAR*IVAR))

      5.96393743820E91 in 0.39" @ 128x (50" physical), ~7 correct digits

    >INTEGRAL(0,6,1E-6,EXP(IVAR*IVAR*IVAR))

      5.96393809255E91 in 0.78" @ 128x (1' 40" physical), ~10 correct digits
Again, note that no programming was needed, just a very short expression executed directly from the command line and there you are.

Frankly, this isn't a really difficult integral at all, I've seen much, much worse of the same size and furthermore, though the modified Romberg method was surely optimal for the reasons Kahan gives in his HP Journal article re Integral on the HP-34C (mainly because of the serious HP-34C memory limitations,) there are much better, much faster methods (even if coded in user code, let alone in assembler) for machines with no such memory constraints (e.g. the HP-71B and most RPL models,) so I don't quite understand why they weren't used instead.

Just to speculate a little, perhaps to try and achieve some production costs reduction by reusing the old Romberg algorithm instead of implementing a better one and its documentation anew.

V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
10-30-2023, 03:27 PM
Post: #15
RE: I became one of the 15c collecting Crowd
(10-29-2023 01:10 AM)Albert Chan Wrote:  Interestingly, integrate from 5 .. 6 produce curve of same shape!
In other words, with 5 .. 6, same sample points, same integral result.

INTEGRAL first map limit lo .. hi to -1 .. 1 LHS, then integrate u-transformed RHS
(02-03-2020 11:15 PM)Albert Chan Wrote:  \(\large \int _{-1} ^1 f(x) dx = {3 \over 2}\int _{-1} ^ 1 (1-u^2) f \left(
{ u (3-u^2) \over 2} \right) du \)

If integral limits hi ≫ lo, numerically hi ± lo ≈ hi

m(x) = (hi+lo)/2 + (hi-lo)/2 * x ≈ hi/2 + hi/2 * x

End-points (x = ±1) never evaluated --> ULP(hi/2) ≤ m(x) < hi

if hi ≫ lo, lo is adjusted up, slightly below ULP(hi/2)

Quote:∫(y dx) = ∫(1/(3x^2) dy)

Integrate by parts, we get a rough estimate of integral (first term)

∫(1/(3x^2) dy) = y/(3x^2) + ∫(2y/(3x^3) dx) = y/(3x^2) + 2/3 ∫(1/(3x^5) dy)

We assume big B --> A=0 will be self-adjusted, not needed.

∫(e^x^3, x = 0 .. B)

10 DEF FNZ(Z) @ N=N+1 @ FNZ=(3*LN(Z))^(-5/3)*Z*Z @ END DEF
20 INPUT "P,B = ";P,B @ I=(EXP(B^3)-1)/(3*B*B)
30 N=0 @ DISP I+2/3*INTEGRAL(1,EXP(B^3/3),P,FNZ(IVAR)),N
40 GOTO 20

>RUN
P,B = 1e-3, 6
 5.96393808841E91      15
P,B = 1e-6, 6
 5.96393809187E91      31

P,B = 1e-3, 10
 6.57128896511E431    15
P,B = 1e-6, 10
 6.57128896529E431    31

(08-16-2023 11:55 AM)Albert Chan Wrote:  Generatlize above [integration by parts], with same d = p*b^p

∫(e^x^p, x = 0 .. b) = (e^b^p-1) * b/d * (1 + (p-1)/d * (1 + (2p-1)/d * (1 + (3p-1)/d * ...
Note: code might not converge. It quit if integral converged, or starting to diverge.

∫(e^x^P, x = 0 .. B)

10 INPUT "P,B = ";P,B @ D=P*B^P @ I=(EXP(B^P)-1)/(D/B)
20 T=P-1 @ C=T/D @ S=C @ DISP I
30 REPEAT @ DISP I+I*S @ T=T+P @ C=C*T/D @ S=S+C
40 UNTIL 1+C=1 OR T>D

>RUN
P,B = 3, 6
 5.94544458536E91
 5.96379472297E91
 5.96393631354E91
 5.96393806157E91
 5.96393809124E91
 5.96393809188E91

>RUN
P,B = 3, 10
 6.5669037134E431
 6.57128164921E431
 6.57128894577E431
 6.57128896523E431
 6.5712889653E431
Find all posts by this user
Quote this message in a reply
11-02-2023, 09:42 PM
Post: #16
RE: I became one of the 15c collecting Crowd
I had fixed the digits using FIX to have the problem, the manual says slightly later that FIX, SCI or ENG will do but FIX Doesn't.
Find all posts by this user
Quote this message in a reply
Post Reply 




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