PDQ Algorithm: Infinite precision best fraction within tolerance

02242019, 10:29 PM
(This post was last modified: 02242019 10:56 PM by cdmackay.)
Post: #21




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(12132013 05:09 AM)Joe Horn Wrote: Examples (performed in CAS, not Home, for perfect accuracy): (02242019 08:36 PM)smartin Wrote: Example #2: pdq(\(\pi\),14) = \(\dfrac{111513555}{35495867}\) I get pdq(\(\pi\),14) = \(\dfrac{47627751}{15160384}\), on the Android emulator (2.1.14181) in both Home & CAS, using the code that I copied and pasted directly into the program editor, from the first post in this thread. edit: I get the same on my Prime G2, and also the MacOS virtual Prime (both same firmware as above) using the hpprgm files downloaded from hpcalc. shouldn't be relevant, but: Number Format: Standard, 12 epsilon: 1e12 Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot Casio, Rockwell 18R 

02252019, 11:10 AM
Post: #22




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02242019 08:36 PM)smartin Wrote: Finally inspired to try out PDQ on the Prime, but I could not get all the examples to work out. I'm using PDQ from hpcalc.org (https://www.hpcalc.org/details/7477) on a Prime with CAS ver 1.4.9 and ROM 2.1.14181. That's because you are using the builtin pi, which is less accurate than the precision you're asking for. Instead of using the builtin pi, use PI500 as your input instead; it's accurate to 500 digits. PI500 is available in the original posting. <0ɸ0> Joe 

02252019, 05:56 PM
Post: #23




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02252019 11:10 AM)Joe Horn Wrote: That's because you are using the builtin pi, which is less accurate than the precision you're asking for. Instead of using the builtin pi, use PI500 as your input instead; it's accurate to 500 digits. PI500 is available in the original posting. Joe, how is it that I get the same value as in your post, using the inbuilt pi, but smartin gets a different value using the same expression as me? Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot Casio, Rockwell 18R 

02262019, 03:17 AM
Post: #24




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02252019 05:56 PM)cdmackay Wrote: Joe, how is it that I get the same value as in your post, using the inbuilt pi, but smartin gets a different value using the same expression as me? Perhaps he accidentally keyed pdq(pi,15) instead of pdq(pi,14). That's just a guess, but it seems likely, since his result is the correct output for pdq(pi,15). <0ɸ0> Joe 

02262019, 03:45 PM
Post: #25




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02262019 03:17 AM)Joe Horn Wrote: Perhaps he accidentally keyed pdq(pi,15) instead of pdq(pi,14). That's just a guess, but it seems likely, since his result is the correct output for pdq(pi,15). argh! Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot Casio, Rockwell 18R 

01262020, 12:32 AM
(This post was last modified: 01262020 01:06 AM by cdmackay.)
Post: #26




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(12132013 05:09 AM)Joe Horn Wrote: Here is a handy variable for PDQ experimentation. sorry, this is no doubt a silly question, but, how do I get the above useful variable into my physical calculator, without having to type it all in? I'd assumed that there must be some way of doing it with the Connectivity Kit, but after a lot of fiddling, I can't see how to do it. I tried pasting it into the virtual Prime app, and from there I can see it in that calculator's CAS Vars entry in the CK. But I can't see to get it from there into my physical Prime, nor into the "Content" area. thanks… Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot Casio, Rockwell 18R 

01262020, 02:41 AM
Post: #27




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(01262020 12:32 AM)cdmackay Wrote:(12132013 05:09 AM)Joe Horn Wrote: Here is a handy variable for PDQ experimentation. Although there must be a better way to do it than my way, here's how I do it. Create a text file on your PC called PI500.TXT which contains the following plain text (w/o carriage returns): Code: PI500:=27530008686166622188536681168621832641085194972343166639705257535483379211746872245213816426118566031785395965298122882489033378100981777951172882274097171557418795742061925144552169213716681963659555722849977577631546439135328548027359232783581546654/8763073931532466069709318081865989548356038360219180799766883466801091951835810620316848615678705592355956178010775004819317000458201135712222333217497308440528564736054334807204294716450847741868745166444326331871073187679996748368181816770785368793 Now create a blank Note on your Virtual Prime and/or your real Prime via the Connectivity Kit. Paste the above text file into that Note for safekeeping. Now paste it into CAS and evaluate it, which creates the desired CAS var. Any time the CAS var gets destroyed (which seems to happen to me annoyingly often) just copy that Note and paste it into CAS again. If the Note ever gets lost (happens very rarely), copy it again from PI500.TXT as before. Ridiculously complicated, but it's how I've been doing it for years. If anybody knows of a better way of creating & saving the above PI500 as a CAS var, please share it with us. <0ɸ0> Joe 

01262020, 08:34 PM
Post: #28




RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(01262020 02:41 AM)Joe Horn Wrote: Although there must be a better way to do it than my way, here's how I do it. Perfect! thanks very much, Joe. Glad I wasn't missing anything obvious Cambridge, UK 41CL/DM41X 12/15C/16C DM15/16 17B/II/II+ 28S 42S/DM42 32SII 48GX 50g 35s WP34S PrimeG2 WP43S/pilot Casio, Rockwell 18R 

« Next Oldest  Next Newest »

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