Post Reply 
Improper Integrals with the HP-15C LE & CE
11-17-2023, 03:24 PM
Post: #41
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 12:56 PM)Voldemar Wrote:  Tried FIX 9 and FIX 7, in both attempts the calculator turned off after about 3 hours of operation.
Is it the case that the calculator does not work for more than 3 hours?

Maybe it did show the result for a fraction of second and then switched off from sheer exhaustion. Were you watching closely and attentively? Or maybe you started the calculation, went away and came back far too late? Imagine the calc’s feelings, all that hard work and when she needed you most, you weren’t there…
Find all posts by this user
Quote this message in a reply
11-17-2023, 03:27 PM (This post was last modified: 11-18-2023 03:03 AM by rprosperi.)
Post: #42
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 02:58 PM)J-F Garnier Wrote:  
(11-17-2023 01:07 PM)rprosperi Wrote:  It's a special feature, not in the manual, which I call: "Move along with your life, there is no point at all to let this run any longer". If you really need this result, pick a better device to calculate it for you... but I am known to have little patience... Wink

In that case, which tool (in the HP calculator class) may numerically evaluate the integral with more than the 6 decimal places that the 15c CE can (slowly) provide ? Smile

J-F

Any super computer should do nicely... you'll note I did not say "HP device"... Wink

Anyone who really NEEDS such results is unlikely to be reaching for a calculator, of any brand, or from any vintage. Thank goodness.

To expose my own lack of specific knowledge about this, I'll make the obvious guesses that the DM42, DM32, WP34 or C47 can, but no doubt these also would take longer than most reasonable people would wait. Which is not to say most readers here are reasonable, certainly we are not! And that's one of the reasons we're comforted by each other here....

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-17-2023, 03:51 PM
Post: #43
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 03:24 PM)vaklaff Wrote:  Or maybe you started the calculation, went away and came back far too late?
Exactly Smile
But I turned on the calculator and there was some result on the display, not fully calculated.
Find all posts by this user
Quote this message in a reply
11-17-2023, 04:38 PM
Post: #44
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 03:27 PM)rprosperi Wrote:  
(11-17-2023 02:58 PM)J-F Garnier Wrote:  In that case, which tool (in the HP calculator class) may numerically evaluate the integral [of 1/sqrt(x) for x = 0 to 1] with more than the 6 decimal places that the 15c CE can (slowly) provide ? Smile

J-F

To expose my own lack of specific knowledge about this, I'll make the obvious guesses that the DM42, DM32, WP34 or C47 can.

I don't know for the WPxx or Cxx, but Free42 (and likely DM42/32) can't, despite its much higher power and 34-digit accuracy. Any other challenger?

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2023, 05:08 PM
Post: #45
RE: Improper Integrals with the HP-15C LE & CE
The WP34S (actual calculator) returns 1.99999998508 in about 2 seconds. The double exponential integration algorithm, which it uses, is really good at coping with integrable singularities at the limits of integration. It does not cope so well with singularities within the range of integration. I don’t believe that there is a single algorithm that works well in all cases; since each calculator uses just one algorithm, which one is best depends upon what sort of integrals you normally evaluate.

Nigel (UK)
Find all posts by this user
Quote this message in a reply
11-17-2023, 05:13 PM
Post: #46
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 05:08 PM)Nigel (UK) Wrote:  The WP34S (actual calculator) returns 1.99999998508 in about 2 seconds. The double exponential integration algorithm, which it uses, is really good at coping with integrable singularities at the limits of integration. It does not cope so well with singularities within the range of integration. I don’t believe that there is a single algorithm that works well in all cases; since each calculator uses just one algorithm, which one is best depends upon what sort of integrals you normally evaluate.

8 correct places. Quite good, indeed, and really fast.
Yes, I know the many discussions about the merits of the various methods.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
11-17-2023, 08:28 PM
Post: #47
RE: Improper Integrals with the HP-15C LE & CE
My Casio fx-CG20 returned 1.99999995 in 5 seconds. I don't know what algorithm it uses.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
11-17-2023, 09:11 PM (This post was last modified: 11-17-2023 09:56 PM by Voldemar.)
Post: #48
RE: Improper Integrals with the HP-15C LE & CE
HP 50g
1,99998390078
Long, I don't know, an hour
HP Prime in Home mode and in CAS mode
2
Immediately
Find all posts by this user
Quote this message in a reply
11-18-2023, 12:14 AM
Post: #49
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 01:07 PM)rprosperi Wrote:  It's a special feature, not in the manual, which I call: "Move along with your life, there is no point at all to let this run any longer". If you really need this result, pick a better device to calculate it for you... but I am known to have little patience... Wink

At that point, it's time to call a friend named Wolfram Alpha. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
11-18-2023, 02:16 AM
Post: #50
RE: Improper Integrals with the HP-15C LE & CE
(11-17-2023 09:11 PM)Voldemar Wrote:  HP 50g
1,99998390078

Other results on a 50g:

\begin{array}{clrr}
\hline
{\textbf{FIX}} & {\textbf{Rounded Result}} & {\textbf{Actual Result}} & {\textbf{IERR}} \\
\hline
0 & 2. & 1.86741548121 & 1.80693901574 \\
1 & 1.9 & 1.86741548121 & .180693901574 \\
2 & 1.98 & 1.98343207731 & 1.97334339834E-2 \\
3 & 1.999 & 1.99894753972 & 1.99831015657E-3 \\
4 & 1.9999 & 1.99987053054 & 1.99978859323E-4 \\
5 & 1.99998 & 1.99998381632 & 1.9999735715E-5 \\
6 & 1.999984 & 1.99998390078 & -1.9999735715E-6 \\
7 & 1.9999839 & 1.99998390078 & -1.9999735715E-7 \\
8 & 1.99998390 & 1.99998390078 & -1.9999735715E-8 \\
9 & 1.999983901 & 1.99998390078 & -1.9999735715E-9 \\
10 & 1.9999839008 & 1.99998390078 & -1.9999735715E-10 \\
11 & 1.99998390078 & 1.99998390078 & -1.9999735715E-11 \\
\end{array}

So whichever method is used in the 50g, it doesn't appear that there's much value trying to go above FIX 6 for the display mode. At least for this example. I'll leave it to those much more knowledgeable than me for what this actually means in practice.
Find all posts by this user
Quote this message in a reply
11-18-2023, 03:32 AM
Post: #51
RE: Improper Integrals with the HP-15C LE & CE
On my CASIO fx-991CW, using endpoints of 5*10^-19 to 1, the integration, after ~13.4 seconds produces 1.999999999 The CASIO must try using the zero endpoint if the endpoints are entered from 0 to 1 as it will throw a math error. This ~$20 calculator uses 21, sometimes 22 digits in it’s calculations.
Find all posts by this user
Quote this message in a reply
11-18-2023, 03:47 AM (This post was last modified: 11-18-2023 05:08 AM by Valentin Albillo.)
Post: #52
RE: Improper Integrals with the HP-15C LE & CE
.
Hi, all,

Some comments on some messages posted by you. Lessee ...

(11-14-2023 07:49 PM)Commie Wrote:  I just want to point out that the integral 1/sqrt(x) =2.sqrt(x). It's easy to see that 2(sqrt(1)-sqrt(0))=2 exactly with a bit of thought before reaching for the hp15c ce.

It seems you aren't getting the point. Of course this integral is trivial to symbolically integrate, even by hand, and thus immediately get the result but that's not the idea, no one's interested in the result in and of itself.

The reason I posted this particular improper integral and its real interest is to ascertain how accurate and fast the various integration methods available in/for HP calcs are when numerically dealing with this seemingly simple integral, in particular Namir's modification of a so-so implementation of 16-point Gaussian quadrature written by someone else in the very distant past, which proves to be unable to deal with this integral.

(11-17-2023 01:07 PM)rprosperi Wrote:  If you really need this result, pick a better device to calculate it for you...[...]

No one "really needs" this result, what people might be interested in is how various integration methods either built-in or user-programmed behave in their HP calculators.

As for picking a better device, it's often the case (and here in particular) that picking a better integration procedure will get the result fast and accurately on the HP device, say the HP-15C CE or the HP-71B, for instance.

(11-17-2023 02:58 PM)J-F Garnier Wrote:  
(11-17-2023 01:07 PM)rprosperi Wrote:  If you really need this result, pick a better device to calculate it for you [...]

In that case, which tool (in the HP calculator class) may numerically evaluate the integral with more than the 6 decimal places that the 15c CE can (slowly) provide ? Smile

Well, I posted this example of a seemingly simple, unassuming improper integral taken from the test suite I created full of hard tests for my ancient integration program which I wrote for the HP-71B several decades ago. It would compute this integral and many others to high accuracy in a matter of seconds. So this is one answer to your question.

(11-17-2023 03:27 PM)rprosperi Wrote:  Any super computer should do nicely... you'll note I did not say "HP device"... Wink [...] I'll make the obvious guesses that the DM42, DM32, WP34 or C47 can, but no doubt these also would take longer than most reasonable people would wait.

No need and No. As I said above, your "lowly" HP calc can compute that particular integral fast and accurately by simply using a suitably better integration procedure than the ancient built-in Romberg's method. I remember that my HP-71B BASIC program mentioned above could compute normal integrals as fast as the assembler INTEGRAL keyword and difficult integrals many times faster/more accurately, up to 100x. So a fast device surely helps but a better method helps the most.

(11-17-2023 04:38 PM)J-F Garnier Wrote:  I don't know for the WPxx or Cxx, but Free42 (and likely DM42/32) can't, despite its much higher power and 34-digit accuracy. Any other challenger?

Yes, a physical WP43 calculator using its internal integration procedure takes about 24" with ACC = 1E-22 to return I2 = 2 (displayed, actually 1.999 999 999 999 999 793 311 720 040 405 29, i.e. 17 correct places save 2 ulp.

Regards.
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
11-18-2023, 05:16 AM
Post: #53
RE: Improper Integrals with the HP-15C LE & CE
My TI-Nspire CX 2 (non CAS) reports 2. immediately. When I subtract 2 from the answer of 2., I get 0.
Find all posts by this user
Quote this message in a reply
11-18-2023, 09:18 AM
Post: #54
RE: Improper Integrals with the HP-15C LE & CE
Sorry for hijacking
My Casio fx-CG50 returned 1.999999995 in 2.5 seconds
Find all posts by this user
Quote this message in a reply
11-18-2023, 10:24 AM
Post: #55
RE: Improper Integrals with the HP-15C LE & CE
(11-18-2023 02:16 AM)DavidM Wrote:  Other results on a 50g:

\begin{array}{clrr}
\hline
{\textbf{FIX}} & {\textbf{Rounded Result}} & {\textbf{Actual Result}} & {\textbf{IERR}} \\
\hline
0 & 2. & 1.86741548121 & 1.80693901574 \\
1 & 1.9 & 1.86741548121 & .180693901574 \\
2 & 1.98 & 1.98343207731 & 1.97334339834E-2 \\
3 & 1.999 & 1.99894753972 & 1.99831015657E-3 \\
4 & 1.9999 & 1.99987053054 & 1.99978859323E-4 \\
5 & 1.99998 & 1.99998381632 & 1.9999735715E-5 \\
6 & 1.999984 & 1.99998390078 & -1.9999735715E-6 \\
7 & 1.9999839 & 1.99998390078 & -1.9999735715E-7 \\
8 & 1.99998390 & 1.99998390078 & -1.9999735715E-8 \\
9 & 1.999983901 & 1.99998390078 & -1.9999735715E-9 \\
10 & 1.9999839008 & 1.99998390078 & -1.9999735715E-10 \\
11 & 1.99998390078 & 1.99998390078 & -1.9999735715E-11 \\
\end{array}

So whichever method is used in the 50g, it doesn't appear that there's much value trying to go above FIX 6 for the display mode. At least for this example. I'll leave it to those much more knowledgeable than me for what this actually means in practice.

The negative IERR value indicates that the Romberg algorithm didn't reach the target accuracy within the sample limit (32768, or maybe 65536 - not sure).
The same cause affects Free42.
On the contrary, the 15c has (apparently) no limit for the number of samples, and keeps trying forever...

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
11-18-2023, 10:52 AM
Post: #56
RE: Improper Integrals with the HP-15C LE & CE
(11-18-2023 03:32 AM)lrdheat Wrote:  On my CASIO fx-991CW, using endpoints of 5*10^-19 to 1, the integration, after ~13.4 seconds produces 1.999999999 The CASIO must try using the zero endpoint if the endpoints are entered from 0 to 1 as it will throw a math error. This ~$20 calculator uses 21, sometimes 22 digits in it’s calculations.
Casio fx-991ES (three generations older than fx-991CW), 0 to 1 error, 0.00000001 to 1, about a minute, result 1.9998
Find all posts by this user
Quote this message in a reply
11-18-2023, 11:00 AM
Post: #57
RE: Improper Integrals with the HP-15C LE & CE
Concerning a better method for this integral would be a double exponential method as e.g implemented on the (DM42) INTDE wil give you 12 digits in seconds.
But I have no idea if there would be room for this on the 15C nor how good it with be with only 12? digits for calculation.
brgds Gjermund
Find all posts by this user
Quote this message in a reply
11-18-2023, 10:38 PM
Post: #58
RE: Improper Integrals with the HP-15C LE & CE
Though irrelevant to the discussion of numerical integration algorithms, the HP 50 in Exact mode returns the answer 2 in less than a second. I would guess that the Prime in CAS mode does as well but I don't have my Prime handy.
Find all posts by this user
Quote this message in a reply
11-18-2023, 11:29 PM
Post: #59
RE: Improper Integrals with the HP-15C LE & CE
(11-18-2023 10:38 PM)John Keith Wrote:  Though irrelevant to the discussion of numerical integration algorithms, the HP 50 in Exact mode returns the answer 2 in less than a second.
True
Find all posts by this user
Quote this message in a reply
11-19-2023, 01:11 AM (This post was last modified: 11-19-2023 03:50 PM by Namir.)
Post: #60
RE: Improper Integrals with the HP-15C LE & CE
(11-18-2023 10:38 PM)John Keith Wrote:  Though irrelevant to the discussion of numerical integration algorithms, the HP 50 in Exact mode returns the answer 2 in less than a second. I would guess that the Prime in CAS mode does as well but I don't have my Prime handy.

Yes the HP Prime in CAS mode gives the anwer of 2.
Find all posts by this user
Quote this message in a reply
Post Reply 




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