Hi all,
I've discovered a bizarre bug in repeatedly comparing a rational with an element of AA:
sage: left_side = AA(2**(1/2) - 2**(1/3))
sage: right_side = 808620184/5240825825
sage: left_side < right_side
True
sage: left_side < right_side
False
The fraction in right_side was obtained via:
continued_fraction(left_side).convergent(15)
One can see because the contined fraction convergents alternate from smaller than to larger than the number they are approximating, that the correct answer is True. There seems to be something rather special about this fraction as demonstrated below:
sage: for n in range(30):
....: print("{}: {}".format(n, left_side < continued_fraction(left_side).convergent(n)))
....:
0: False
1: True
2: False
3: True
4: False
5: True
6: False
7: True
8: False
9: True
10: False
11: True
12: False
13: True
14: False
15: False
16: False
17: True
18: False
19: True
20: False
21: True
22: False
23: True
24: False
25: True
26: False
27: True
28: False
29: True
The comparison with the convergent 15 is the only one it gets wrong! Bizarre...
I first noticed the issue in stable version 8.9, but it seems to still be present in the development branch.
Best regards,
Pat Hooper