simon-git: spigot (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Oct 7 10:45:02 BST 2017
TL;DR:
366ff2f New Python script to find a fraction in an interval.
Repository: https://git.tartarus.org/simon/spigot.git
On the web: https://git.tartarus.org/?p=simon/spigot.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2017-10-07 10:45:02
commit 366ff2fa1b8456d4b28a1c4fc4c408d97219bd26
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=366ff2fa1b8456d4b28a1c4fc4c408d97219bd26;hp=df57f3c46b3dd682d6d6ad601f5c399822235cca
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Oct 7 09:49:57 2017 +0100
New Python script to find a fraction in an interval.
I first saw a reference to this method at
https://blog.plover.com/math/age-fraction-2.html
but I found that it wasn't quite as fast in all cases as it should be,
e.g. trying to find a rational between 1/3 and eulergamma^2. I
implemented an enhancement to the algorithm (documented in the code)
to accelerate it in the case where a large number of successive steps
of the binary search are going to go in the same direction, and now
that example runs in three iterations instead of over 700.
python/mediant.py | 193 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 193 insertions(+)
More information about the tartarus-commits
mailing list