Post Reply 
PDQ Algorithm: Infinite precision best fraction within tolerance
02-24-2019, 10:29 PM (This post was last modified: 02-24-2019 10:56 PM by cdmackay.)
Post: #21
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(12-13-2013 05:09 AM)Joe Horn Wrote:  Examples (performed in CAS, not Home, for perfect accuracy):

• pdq(pi,14) --> \(\dfrac{47627751}{15160384}\) (different, because pi is not equal to PI500).

(02-24-2019 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: 1e-12

Cambridge, UK
41CL, 12C, DM15L/16L, 71B, 17B, 28S, DM42, 48GX, 17bII+, 50g (HP & newRPL), 30b (WP 34S), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
02-25-2019, 11:10 AM
Post: #22
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02-24-2019 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.

Example #1: works as advertised
but,
Example #2: pdq(\(\pi\),14) = \(\dfrac{111513555}{35495867}\)

Example #3: pdq(\(\pi,\dfrac{13131}{10^{440}}\)) = \(\dfrac{27633741218861}{8796093022208}\)

That's because you are using the built-in pi, which is less accurate than the precision you're asking for. Instead of using the built-in pi, use PI500 as your input instead; it's accurate to 500 digits. PI500 is available in the original posting.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
02-25-2019, 05:56 PM
Post: #23
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02-25-2019 11:10 AM)Joe Horn Wrote:  That's because you are using the built-in pi, which is less accurate than the precision you're asking for. Instead of using the built-in 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, 12C, DM15L/16L, 71B, 17B, 28S, DM42, 48GX, 17bII+, 50g (HP & newRPL), 30b (WP 34S), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
02-26-2019, 03:17 AM
Post: #24
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02-25-2019 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-
Visit this user's website Find all posts by this user
Quote this message in a reply
02-26-2019, 03:45 PM
Post: #25
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(02-26-2019 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! Smile

Cambridge, UK
41CL, 12C, DM15L/16L, 71B, 17B, 28S, DM42, 48GX, 17bII+, 50g (HP & newRPL), 30b (WP 34S), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
Post Reply 




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