New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
efficient algorithm to compute continued fraction of a sum of continued fractions #19120
Comments
Branch: u/mirgee/my_sage_1 |
Commit: |
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
Hello, Some remarks:
@@ -530,6 +530,8 @@ class ContinuedFraction_base(SageObject):
if a == ZZ_0 and b == ZZ_0 and i: # rational case
return 0
i += 1
+ if i == 300:
+ return 0 I understand why you did it but it is definitely not a solution. What you can do is to raise a
Vincent |
comment:5
And last but not the least: it would be very nice to have Gosper algorithm within Sage!! |
comment:6
Hi, thanks for the great input. As for 5.: We need a way to compare instances of _infinite, and even though this is not a valid test, if enough terms are the same, the two continued fractions could be regarded as equal for most practical purposes. Another option would be to compare values, as in _real, but the problem is that
What do you think? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
Replying to @sagetrac-mirgee:
Everything would be better than an silent approximate comparison. If equality can not be decided just raise an error (see Python exceptions). I think that in that case an If you want to check equality up to some precision, you should do
or
|
comment:11
For the sake of this ticket I would not implement something like
|
comment:12
The change in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:16
rebase, squashed, py3-compatible New commits:
|
Changed branch from u/mirgee/my_sage_1 to public/ticket/19120 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:25
Replying to @videlec:
I am the author: Miroslav Kovar (miroslavkovar@protonmail.com) |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:27
Replying to @sagetrac-mirgee:
Thanks. I put your name and mail in the copyright header of the file. |
Author: Miroslav Kovar |
Reviewer: Vincent Delecroix |
comment:29
patchbot plugins complain |
comment:30
Le reference [LS1998] a une allure bizarre, avec un P isolé |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:32
Merci. Pyflakes est encore pas content:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:34
There is something wrong in the way infinity is handled. In the situation where we apply |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:36
fixed |
comment:37
ok, this seems to be ready for a positive review ? |
Changed reviewer from Vincent Delecroix to Vincent Delecroix, Frédéric Chapoton |
Changed branch from public/ticket/19120 to |
Implement a method which, taking continued fraction x as an input, computes the continued fraction of (ax+b)/(cx+d) using Gosper's algorithm. Call this method with proper arguments upon
(overlaps with the following TODO item of sage/rings/continued_fraction.py:
Add Gosper’s algorithm to compute the continued fraction of (ax + b)/(cx + d) knowing the one of x (see Gosper (1972, http://www.inwap.com/pdp10/hbaker/hakmem/cf.html), Knuth (1998, TAOCP vol 2, Exercise 4.5.3.15), Fowler (1999). See also Liardet, P. and Stambul, P. “Algebraic Computation with Continued Fractions.” J. Number Th. 73, 92-121, 1998.)
CC: @videlec @staroste
Component: number theory
Keywords: continued_fraction
Author: Miroslav Kovar
Branch/Commit:
8cafbb4
Reviewer: Vincent Delecroix, Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/19120
The text was updated successfully, but these errors were encountered: