Post Reply 
PDQ Algorithm: Infinite precision best fraction within tolerance
02-24-2019, 08:36 PM
Post: #20
RE: PDQ Algorithm: Infinite precision best fraction within tolerance
(12-13-2013 05:09 AM)Joe Horn Wrote:  PDQ Algorithm for HP Prime, by Joe Horn

Example #1: What is the best fraction that's equal to \(\pi\pm\dfrac{1}{800}\)? Answer: \(\dfrac{179}{57}\), which is the same answer as given by Patrice's FareyDelta program. This is a difficult problem, because \(\dfrac{179}{57}\) is not a principal convergent of pi.

Example #2: What is the best fraction that's equal to \(\pi\pm\dfrac{1}{10^{14}}\)? Patrice's FareyDelta program can't handle that problem, because it is limited by the 12-digit accuracy of Home math. PDQ gets the right answer, though: \(\dfrac{58466453}{18610450}\).

Example #3: What is the best fraction for \(\pi\pm\dfrac{13131}{10^{440}}\)? PDQ returns the correct ratio of two huge integers (221 digits over 220 digits) in less than one second. (It takes the HP 50g over two minutes using System RPL). This is an extreme case, since the numbers are so huge, and once again the answer is not one of pi's principal convergents. Piece of cake for Prime+PDQ, which yields the unique correct answer:
\(\frac{197589170636854062408454380413327813798855733721902369198118555167226743​04730662906703593620215835931889230827416036013979330716090096564056017111952129​356153172850632330284830147063755110178945173800035059898203820427519}{628945864​16566610363809944329675177193853240546238323897010336439848926113959966464032961​05227342931817856832425836690143454522392566443183092738965162183777760340854050​065970057153850182984658932709234874407013579584688}\)

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}\)

As with trying any new program my first thought is operator error (or some setting on the Prime).

Another related question:
For example #3, even though it appears that the return fraction accurately represents pi to about 436 decimal places, is it true that one is not actually getting pi to that accuracy, just a lot of zeros after the precision of pi within the Prime is reached (12 digits)?

Thanks,
Steve
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: PDQ Algorithm: Infinite precision best fraction within tolerance - smartin - 02-24-2019 08:36 PM



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