Best Rational Approximation Calculation Utility For Windows
A common request is for a utility to calculate best rational approximations (this can be done using a continued fraction algorithm explained in the materials linked to from this page). Best rational approximations of this type are sometimes useful in microcontroller work.
The console-mode utility supplied on this page was created using Microsoft Visual C++ 6.0, and has no external dependencies (no .DLL dependencies, for example). It should run on any Windows 95 or later system.
The screen snapshot below shows the utility being used to find the best rational approximation to p (or actually, to 3.14159265359 since p is irrational) with numerator not exceeding 65,535 and denominator not exceeding 32,767. The screen snapshot shows that this best rational approximation is 65,298/20,785.
The underlying algorithms are O(log N) and an arbitrary-precision integer library is used, so they should work for any practical case.
This standalone utility and other supporting documents can be downloaded from the links in the table below.
|Download Link||Description||File Size And MD5|
|cfbrapab.exe||Windows utility to calculate best rational approximations.||Size:
|paper_brap_detailed.pdf||Detailed paper explaining the mathematical basis of best rational approximation. (Note: this paper was never published, and copyrights do not apply.)||Size:
|paper_brap_reduced.pdf||Less detailed paper explaining how to calculate best rational approximations. (Note: this paper was never published, and copyrights do not apply.)||Size:
|book_c4_c5.pdf||Chapters 4 (Farey Series) and 5 (Continued Fractions) of book, under construction. This document gives much more detail about the mathematical basis of best rational approximation. (Note: the copyright status of the book is uncertain. For the present time, no copyrights apply.)||Size:
This web page is maintained by David T. Ashley, was last updated on March 29, 2008, required approximately 0.000055s (0.000048s user, 0.000007s system) to generate, and is part of esrgweba version 0.00a. Local time on this server (at the time the page was served) is 11:52:19 am (UTC, GMT +0000) on February 25, 2018.