HP 15C and INT(1/√(1x),0,1)

11262017, 07:51 PM
(This post was last modified: 11262017 07:57 PM by salvomic.)
Post: #1




HP 15C and INT(1/√(1x),0,1)
hi,
I'm trying to get in HP 15C the integral Integrate[1/Sqrt[1  x], {x, 0, 1}] \[ \int_0^1{\frac{1}{\sqrt{1x}}}dx \] With this code: Code:
The real HP15C is running but after 30 mins no result; the emulator iOS HP15 returns 1.999870566 after 1~2 min (the HP50g emulator returns 1.9999839292, the hardware HP50g doesn't return result after a few minutes...) The actual result is 2 (Prime, Wolfram...). I wonder: 1. Is there a better way to get it in hardware HP15C? 2. Why the result in emulator is not 2? Thank you, Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

11262017, 11:01 PM
(This post was last modified: 11262017 11:09 PM by Dieter.)
Post: #2




RE: HP 15C and INT(1/√(1x),0,1)
(11262017 07:51 PM)salvomic Wrote: With this code: What are the two ENTERs supposed to do? They are not required. (11262017 07:51 PM)salvomic Wrote: then 0 ENTER 1, f ∫ 1 What display setting do you use here? Remember, this setting directly influences the accuracy of the result – and thus the execution time. Code: 01 LBL 1 Set FIX 4, and the official HP emulator returns 1,9999 almost immediately. FIX 6 already causes the emulator to run for a while... until it stops with Error 0. (11262017 07:51 PM)salvomic Wrote: I wonder: Answers to both questions can be found in the 15C Advanced Functions Handbook which explains the Integrate function in detail. Take a look at the graph near x=1 and you'll see why this integrand is not trivial and why you should not expect a plain 2. As x approaches 1 the function approaches infinity. The AFH shows how such cases can be handled. It's always a good idea to start with a moderate display setting like SCI 2 or FIX 2 or maybe FIX 4. Higher settings may cause very long integration times, especially on a hardware 15C. Dieter 

11262017, 11:13 PM
(This post was last modified: 11262017 11:16 PM by peacecalc.)
Post: #3




RE: HP 15C and INT(1/√(1x),0,1)
Hello Salvo,
try your little program LBL1 without step 03 and 05 (both ENTER). Because if you use your function with lets say 0.2 you get: at step 01: 0.2 xreg at step 02: 0.2 xreg, yreg at step 04: 0.8 xreg, 0.2 yreg at step 05: 0.8 xreg, 0.8 yreg, 0.2 zreg at step 07: 1/√0.8 xreg, 0.8 yreg, 0.2 zreg but the values in yreg and zreg are useless for the buildin integralprogram, it may interfer with next looping because then treg is loaded and this reg copies it's value to the zreg if there is a stackdown command. Okay, Dieter was fast as flash, but I can't delete my post. 

11272017, 01:33 AM
Post: #4




RE: HP 15C and INT(1/√(1x),0,1)
Good evening (at least where I live)
I tested your integral on my (hardware) HP 50g. In exact mode, I receive the answer of 2 immediately. In approx. mode on the HP 50g with a fix of 4, I get 1.9999 in a matter of 3 to 4 minutes. I did not time it. I did not use the Equation Writer and I was in RPN mode. I used the integral function that is on the [TAN] key and I built the equation on the stack with RPN. It's fun. Next I tested your integral on my Dad's (hardware 1987) HP15C. I entered the equation as such... 1.) LBL 1 2.) 1 3.) SWAP 4.)  5.) SQRT 6.) 1/x 7.) RTN I set the HP15C to a fix of 2 and integrated the integral from 0 to 1. In a time of 2 minutes and 42 seconds, I got the answer of 1.99. Then I set the 15C to a fix of 4 and attempted to integrate the integral again. In a time of 16 minutes and 28 seconds, I stopped the 15C and didn't get an answer as a result. I can't give any advice as I am not a proficient user of the HP15C ONLY because I don't own one yet. But I hope my input on how I solved the integral on my calculators (and my Dad's) proved useful. Oh and I can help with the HP 50g. I would say I am a solid user of the machine. 

11272017, 09:38 AM
(This post was last modified: 11272017 09:57 AM by salvomic.)
Post: #5




RE: HP 15C and INT(1/√(1x),0,1)
(11262017 11:01 PM)Dieter Wrote: What are the two ENTERs supposed to do?hi Dieter, you are right! Without the ENTER I get 1.9999 in iOS in about 2 min (1 min with SCI 4). In hardware HP15C no result after 27 min now with your program. I controlled that all was ok with ON/y^x procedure (all flags and 88.88.88.88.88), I reset also the continuous memory (ON/) but the same with FIX 4, with FIX 2 I get 1.99 after about 3 mins Quote:...Nothing, FIX 4. I thought there was something wrong in Reg but it seems not. Quote:Set FIX 4, and the official HP emulator returns 1,9999 almost immediately.ok here in iOS. Also SCI 4 got 1.9999 after 1 min. However not in hardware: this is strange by me: FIX 4 and nothing happens after 27 min, also with SCI 4... Quote:Answers to both questions can be found in the 15C Advanced Functions Handbook which explains the Integrate function in detail. Take a look at the graph near x=1 and you'll see why this integrand is not trivial and why you should not expect a plain 2. As x approaches 1 the function approaches infinity. The AFH shows how such cases can be handled. Thanks! I'll look there. The integral isn't trial at all. (11262017 11:13 PM)peacecalc Wrote: Hello Salvo, thanks a lot! also your contribute is important for me. (11272017 01:33 AM)Carsen Wrote: Good evening (at least where I live)well, in Exact in 50g I missed EVAL... Using it with EQN editor I get 2 immediatly, but with std setting in "number format" mode no luck after a few minutes. With FIX 4 I got the result 1.9999 in less than 3 min. Quote:Next I tested your integral on my Dad's (hardware 1987) HP15C. I entered the equation as such...the same as the Dieter program, here: ok in iOS, nothing after various minutes in Hardware... Quote:Then I set the 15C to a fix of 4 and attempted to integrate the integral again. In a time of 16 minutes and 28 seconds, I stopped the 15C and didn't get an answer as a result.In fact! Quote:I can't give any advice as I am not a proficient user of the HP15C ONLY because I don't own one yet. But I hope my input on how I solved the integral on my calculators (and my Dad's) proved useful. Oh and I can help with the HP 50g. I would say I am a solid user of the machine.thank you! HP 50g is a very "big" machine, precise and solid, indeed. I like it (also I like the Prime). Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

11272017, 07:40 PM
(This post was last modified: 11282017 09:42 PM by salvomic.)
Post: #6




RE: HP 15C and INT(1/√(1x),0,1)
I need also a good emulator for Mac OS X...
I made tries on these with different results in Mac OS X 10.13.1 High Sierra using the program for INT(1/√(1x),0,1): Code:
• Free 15C RPN [HP 15C.com] not working with the program: it hangs, without showing "running", with the Mac rainbow spinner... • HP 15C Simulator [HP15C Simulator]: the old version doesn't start at all; the last beta starts, but returns "error 0". Has HP an "original" working emulator for Mac OS X (like that wonderful in iOS)? Thank you. Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01082018, 04:07 PM
(This post was last modified: 01092018 02:35 PM by salvomic.)
Post: #7




RE: HP 15C and INT(1/√(1x),0,1)
I could try a confrontation between a classic and a Limited edition HP15.
They started in the same instant, running to calculate the “not trivial” integral: ∫(1/(√(1x)),0,1) that’s close 2. Both started with four digit precision (FIX 4). LE returned the results (1.9999) after about 3 mins, then it started again with 6 digit precision (FIX 6). After 50 mins the classic 15C (FIX 4) was still running, instead the LE (FIX 6) gave up with “Error 0” message ("Improper mathematics operation": why?) The code is: Code:
After 75 mins the old HP15C is still running... At this time (after a pause) I start again LE with FIX5. After 25 mins LE returns 1.99999 and old HP15 still running (just now since 100 mins)... At the end I stopped HP15C (old) after about 2h without the result (with FIX4)... Besides the different speed, I wonder if the error in LE with FIX6 was only random or a limit for it (but I don't think)... Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01082018, 09:35 PM
(This post was last modified: 01082018 09:36 PM by salvomic.)
Post: #8




RE: HP 15C and INT(1/√(1x),0,1)
(01082018 08:37 PM)Mike (Stgt) Wrote: ... hello Mike, thanks for advice. Yes, actually I'm using the Prime and 50g to solve that type of integrals. With old calculators (like the HP15) I like to test their capability and the various times of execution. I never noted issues in HP15C (classic) until I tried that integral (and the first time with FIX9!) and the routine never end, so I wondered why... So I'm trying the same thing in the various calculator I've. With 50g or Prime the result 2 is returned in few seconds... I noted also the same problem of HP15C in HP41C with Advanced pac: the used routine should be the same, I believe (reading the manual of the module. It's better with the HP42s, and definitely with Free42, emulator of HP15, but not i41CX that has the same problem that the real HP41CX. However, you're right, if it's stupid but it works, it isn't stupid When I want use HP15C I'll keen FIX low: 2 or 3 and go with wind... I haven't a 40g, at the moment, only 39g (but still I have not tried in it). ciao, Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01082018, 10:15 PM
Post: #9




RE: HP 15C and INT(1/√(1x),0,1)
(01082018 04:07 PM)salvomic Wrote: I could try a confrontation between a classic and a Limited edition HP15. The indefinite integral is –2√(1–x) so the integral from 0 to 1 is exactly 2. (01082018 04:07 PM)salvomic Wrote: After 50 mins the classic 15C (FIX 4) was still running, instead the LE (FIX 6) gave up with “Error 0” message ("Improper mathematics operation": why?) You can find out yourself: as soon as the error occurs, switch to program mode an see at which line you are. Since the stack is filled with x, press R↓ to check x. I suspect that the error is caused by the 1/x instruction, and this may happen if x is so close to 1 that 1–x is evaluated to zero, which leads to an attempt to divide by zero. But this is just a guess. ;) This usually does not happen as the interval should not be evaluated at its limits. But if Δx eventually becomes extremely small this may well be possible. Dieter 

01082018, 10:38 PM
Post: #10




RE: HP 15C and INT(1/√(1x),0,1)
(01082018 10:15 PM)Dieter Wrote: You can find out yourself: as soon as the error occurs, switch to program mode an see at which line you are. Since the stack is filled with x, press R↓ to check x. I'll try again. I suspect also that the problem is with 1/x. I found that with FIX2, 3,4,5 no error is reported, but with 6 LE returns the error (the old HP15C I don't know as normally I put it off after two hours without results, as to wait without result it is boring a lot). ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01092018, 12:16 PM
Post: #11




RE: HP 15C and INT(1/√(1x),0,1)
Test with HP 42s and Free42.
Both returns a result with a few seconds with accuracy 1E9, but maybe I miss something... Code (function label FX): Code:
Input: LLIM 0 ULIM 1 ACC 1E9 then ∫f(x) HP 42s returns 1.867415 Free42 returns 1.933972 both are no close to 1.9999 Are the different due only to different long float library? Anyone with DM42 could try, please? Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01092018, 12:49 PM
Post: #12




RE: HP 15C and INT(1/√(1x),0,1)
(01092018 12:16 PM)salvomic Wrote: Test with HP 42s and Free42. ACC = 1E9?? Try 1E5 Greetings, Massimo +×÷ ↔ left is right and right is wrong 

01092018, 01:26 PM
Post: #13




RE: HP 15C and INT(1/√(1x),0,1)
(01092018 12:16 PM)salvomic Wrote: Test with HP 42s and Free42. What? An accuracy of ±1000000000 ? (01092018 12:16 PM)salvomic Wrote: but maybe I miss something... You bet. #) ACC=1E–5 on Free42 returns an integral of 1,99587 almost immediately. (01092018 12:16 PM)salvomic Wrote: Are the different due only to different long float library? AFAIK neither Free42 nor DM42 use a longfloat library. Dieter 

01092018, 01:32 PM
(This post was last modified: 01092018 04:57 PM by salvomic.)
Post: #14




RE: HP 15C and INT(1/√(1x),0,1)
(01092018 12:49 PM)Massimo Gnerucci Wrote: ACC = 1E9?? yes! what a silly I was... Thank Massimo, with 1E6 Free 42 (iOS) returns 1.999998 after a few seconds, HP 42s with 1E6 still running after 90 mins... ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01092018, 01:34 PM
Post: #15




RE: HP 15C and INT(1/√(1x),0,1)
(01092018 01:26 PM)Dieter Wrote: You bet. #) yes, Dieter, I don't know why I was missing the  sign! Free42 returns the result quick also with 1E6... Salvo ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

01092018, 03:42 PM
Post: #16




RE: HP 15C and INT(1/√(1x),0,1)
(01092018 12:16 PM)salvomic Wrote: Anyone with DM42 could try, please? DM42, no USB power: ACC = 0.01 1.983493 time < 1s ACC = 0.001 1.998968 time ~ 4s ACC = 0.0001 1.999871 time ~ 28s I also broke it into two segments (0 to 0.9999, ACC 0.0001 and 0.9999 to 1, ACC 0.01) and got 1.999932 (with 0.000195 summed error) in ~ 2s. 

01092018, 04:53 PM
Post: #17




RE: HP 15C and INT(1/√(1x),0,1)
I’ve removed two steps from your function code:
Code:
On the DM42 with Main and Goose LCD refresh disabled and USB power it takes 1’07” to return 1,99998387978 with ACC=1E5 and 2’39” when on battery. With Main and Goose LCD refresh enabled it takes 1’19’’ on USB power and 3’26” on battery. (01092018 01:26 PM)Dieter Wrote: ACC=1E–5 on Free42 returns an integral of 1,99587 almost immediately.Are you using the decimal or the binary version of Free32? 

01092018, 06:19 PM
Post: #18




RE: HP 15C and INT(1/√(1x),0,1)  
01092018, 06:31 PM
Post: #19




RE: HP 15C and INT(1/√(1x),0,1)
(01082018 10:15 PM)Dieter Wrote: I suspect that the error is caused by the 1/x instruction, and this may happen if x is so close to 1 that 1–x is evaluated to zero, which leads to an attempt to divide by zero. But this is just a guess. ;) I now tried the integrate function of Free42 Decimal 1.5.5. with a modified function that records the largest X during integration. For ACC=1E–8 (result: 1.99999596995) the largest X was 0,999999999956, i.e. 1–4,4E–11. With 10 digit precision this rounds to 1 so that 1–x becomes zero and 1/x generates an error. But once again – try this on your 15C and see what you get. Dieter 

01092018, 06:58 PM
Post: #20




RE: HP 15C and INT(1/√(1x),0,1)
(01092018 04:53 PM)Didier Lachieze Wrote: I’ve removed two steps from your function code: Didier, thanks for tests! I'm trying your code with HP42s and HP15 (original and LE) again... HP 42s: accuracy 1E6: no results after 4h, then I stopped the calculator accuracy 1E5: 1.999967 (Y=0.000020) after 1h10m (01082018 10:15 PM)Dieter Wrote: ...Interesting... (01082018 10:15 PM)Dieter Wrote: But once again – try this on your 15C and see what you get. ok Dieter, similar result here with Free42... Now, I'll try again with your hints in the real HP42. However, yesterday I tried and here the results: (01082018 04:07 PM)salvomic Wrote: ... original HP15 had problems already with 1E5, HP 15C LE returned the result with 1E5 in 25 minutes but returned error with 1E6... ∫aL√0mic (IT9CLU), HP Prime 50g 41CX 71b 42s 12C 15C  DM42 WP34s :: Prime Soft. Lib 

« Next Oldest  Next Newest »

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